-
Notifications
You must be signed in to change notification settings - Fork 199
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
Fix #411 Allow to specify kind of code action to execute #598
Conversation
These shortcuts may be simple enough that they can be in |
Agree. If you think those shortcuts are not worth a separate PR, I can add it here. |
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.
Please try to do the Lisp refactorings I suggest, otherwise go ahead and I'll do this cleanup later. Conceptually, I think the code is clean.
Agree. Add them here. Maybe in a separate commit, but not strictly necessary. |
If you add the shortcuts, edit the README.md file too to mention them. Also, edit the NEWS.md file if you can find a terse way to describe this feature. |
Ok, will do in a few days. Thanks! |
Just to confirm that the code as it is seems to work with either code-actions provided by menu and clicking them, and executing a code-action as the example for organize imports at the top post here. |
Can we keep |
Sure, of course. Though I personally would do |
8aa0ff2
to
51b90e5
Compare
I've tweaked this PR. It's ready for squashing and pushing IMO (after commit msg where I should appear as BTW your macro was fine, but some people including me, prefer macros to not secretly intern symbols, since it helps when finding definitions. A function defining macro should theoretically be called |
Looks absolutely good to me.
Got it. Thanks! |
…e actions Make eglot-code-actions accept a new action-kind argument. If there is only one action of that kind, apply it. This allows us to create actions shortcuts like eglot-code-action-organize-imports, etc. * eglot.el (eglot-code-actions): Accept new argument action-kind. (eglot--code-action): New function-defining helper macro. (eglot-code-action-organize-imports) (eglot-code-action-extract) (eglot-code-action-inline) (eglot-code-action-rewrite) (eglot-code-action-quickfix): New commands. * README.md: Mention new feature. * NEWS.md: Mention new feature. Co-authored-by: João Távora <[email protected]>
51b90e5
to
3796887
Compare
…ed code actions See also joaotavora/eglot#598. Make eglot-code-actions accept a new action-kind argument. If there is only one action of that kind, apply it. This allows us to create actions shortcuts like eglot-code-action-organize-imports, etc. * eglot.el (eglot-code-actions): Accept new argument action-kind. (eglot--code-action): New function-defining helper macro. (eglot-code-action-organize-imports) (eglot-code-action-extract) (eglot-code-action-inline) (eglot-code-action-rewrite) (eglot-code-action-quickfix): New commands. * README.md: Mention new feature. * NEWS.md: Mention new feature. Co-authored-by: João Távora <[email protected]>
…ed code actions See also joaotavora/eglot#598. Make eglot-code-actions accept a new action-kind argument. If there is only one action of that kind, apply it. This allows us to create actions shortcuts like eglot-code-action-organize-imports, etc. * eglot.el (eglot-code-actions): Accept new argument action-kind. (eglot--code-action): New function-defining helper macro. (eglot-code-action-organize-imports) (eglot-code-action-extract) (eglot-code-action-inline) (eglot-code-action-rewrite) (eglot-code-action-quickfix): New commands. * README.md: Mention new feature. * NEWS.md: Mention new feature. Co-authored-by: João Távora <[email protected]>
See also #598. Make eglot-code-actions accept a new action-kind argument. If there is only one action of that kind, apply it. This allows us to create actions shortcuts like eglot-code-action-organize-imports, etc. * eglot.el (eglot-code-actions): Accept new argument action-kind. (eglot--code-action): New function-defining helper macro. (eglot-code-action-organize-imports) (eglot-code-action-extract) (eglot-code-action-inline) (eglot-code-action-rewrite) (eglot-code-action-quickfix): New commands. * README.md: Mention new feature. * NEWS.md: Mention new feature. Co-authored-by: João Távora <[email protected]> #411: joaotavora/eglot#411 #598: joaotavora/eglot#598
See also joaotavora/eglot#598. Make eglot-code-actions accept a new action-kind argument. If there is only one action of that kind, apply it. This allows us to create actions shortcuts like eglot-code-action-organize-imports, etc. * eglot.el (eglot-code-actions): Accept new argument action-kind. (eglot--code-action): New function-defining helper macro. (eglot-code-action-organize-imports) (eglot-code-action-extract) (eglot-code-action-inline) (eglot-code-action-rewrite) (eglot-code-action-quickfix): New commands. * README.md: Mention new feature. * NEWS.md: Mention new feature. Co-authored-by: João Távora <[email protected]> GitHub-reference: close joaotavora/eglot#411
Make
eglot-code-actions
acceptaction-kind
argument. If there areonly one action of that kind, apply it.
This will allow to create shortcuts for actions of the specific kind.
(eglot-code-actions): Use it; Accept new argument
action-kind
.Execute the only action of that kind.
(eglot-code-action-inline, eglot-code-action-extract,
eglot-code-action-rewrite, eglot-code-action-quickfix,
eglot-code-action-organize-imports): New commands.
eglot-code-actions
function; Mention new commands.