-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FEATURE] Autocompletion #4709
[FEATURE] Autocompletion #4709
Conversation
@@ -4,6 +4,9 @@ | |||
// Provide a title to the process in `ps` | |||
process.title = 'ember'; | |||
|
|||
var autocomplete = require('../lib/utilities/cli-command-completion'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this instead be run in cli/index.js ?
changes in bin/ember
come at a big cost, as bin/ember
is meant to work across all versions of ember-cli. In all but the most extreme cases there is a moratorium on changes to it.
awesome |
break; | ||
case 'zsh': | ||
fs.appendFileSync(initFile, template('. <(' + this.program + ' --completion)')); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as a fish
user I would love to have autocomplete
support for it as well. If you don't have time, I can investigate this myself at a later date.
0e04c93
to
65b519a
Compare
ca9fb60
to
e65c58f
Compare
👏 This looks awesome. |
ae8a163
to
2429991
Compare
a8c220e
to
623b1fc
Compare
@kellyselden @lazybensch whats the word on this. |
@stefanpenner i am still trying to get the specs green. (it may not seem like it though, since i am always amending to my last commit) Feature works fine on my machine and all but I really have a hard time getting the CI happy. On travis, now there only are a couple of tests red on windows is another story. I don't have a windows machine to test on so i am currently using appveyor to test my changes. thats a frustratingly slow process :( |
@lazybensch can you explain why you introduced the CliCommand class? does that offer anything that the Command class isn't offering? also why did you introduce another JSON manifest format thingy instead of reusing the output of |
This way you could create a postinstall npm script that invalidates the cache, and you never have to deal with the install issue.
|
@knownasilya wouldn't a postinstall only invalidate the cache on the contributor machine that is adding an addon via |
No, because |
@knownasilya well thx for the suggestion then. I'll implement it the way you described. @Turbo87 a CliCommand is, despite the similar name, a semantically different thing (for example do also blueprints need a CliCommand representation). This Class describes the actual words that are displayed on the command line and what words should follow etc. The I have not touched this so far because, well... you see this feature is way more involved as i first anticipated and i would have prefered to "not care" about this for now, get a mergeable MVP, and DRY-ing up the json generation in a later PR but just now as i wrote this thought down i already realize that this is not a good idea :D also i've red IDE integration a couple of times in context of |
It might even make sense to add the postinstall to new projects via the app blueprint in this PR. |
take https://github.com/Turbo87/intellij-emberjs for example. it allows you to run
good point. but it is implemented now, so IMHO we should try to reuse what already exists.
can you give examples of what isn't playing along?
thus my suggestion to cache the output similar to what you're suggesting in this PR
I actually would like to propose the opposite: cache the output of |
well, here are a few arguments why i would prefere using the cli-command-generator:
I believe the last point is bigger then it seems. Because addon authors are able to help users with suggestions.For example imagine ember-deploy would be a monolithic addon (instead of using plugins) that would let you deploy to any destination. The addon introduces a I think at this point it also becomes clear why a cliCommand is not a command, despite being a blueprint, you could add "autocomplete suggestions" for your command, those would technically only by arguments to your command but still work with shell completion. |
I totally agree on that, but I still think it's worth the effort. The alternative of having essentially two JSON outputs (the
I think it should be reasonably easy to convert the current
correct me if I'm wrong, but I think we could still do the same thing if we used the other JSON output. we would need to figure out if the last "cli command" was a command or blueprint, look it up and then add the |
I hope i am not wearing you out with this discussion but there is one point i think i haven't made clear: option A
option B
Not only is option B a lot more effort on my side to have the same result; I argue that option A and option B have the exact same result. Actually if i squash my commits i bet you could not tell which option i chose as following option B would result in a decoupled documented module that supports the features i mentioned. But that is exactly what i already have implemented in |
I guess it boils down to the question which of the formats is more generic and can be used by more than just the autocompletion code. I would personally answer this question with the |
I still feel adding those properties to the autocompletion would be less effort then adding the missing properties to the help code. also i am not quite sure if i can produce the structure needed for autocompletion out of the help-json but think the other way around is not that hard (as i said, i would add addon and blueprint information as meta data to all the cliCommands in my hash |
☔ The latest upstream changes (presumably #5612) made this pull request unmergeable. Please resolve the merge conflicts. |
Added to tomorrow's ember-cli core team meeting agenda. |
@lazybensch can you change this PR to use the |
So what's happening here, is this issue going anywhere? |
closing this for now due to missing activity. would love it if someone would pick it up again though. |
check out the RFC to learn more about this feature.
things left to be done:
fish
supportto entertain you until then: