-
Notifications
You must be signed in to change notification settings - Fork 34
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
Order of suggestions of code-fixes is not really optimized, especially with imports #9
Comments
It looks like there is :) I thought there wasnt. ‘CodeAction.isPreferred’ |
On the same spec there’s also CodeActionKind:
It seems one possible value for that is So I guess we should prioritise isPreferred and quickfix-kind actions, and in that order? |
pending on ionide/LanguageServerProtocol#4 |
ok, that one has been merged |
I have published 0.1.8, which should pull (it might take a couple of minutes for the package to show up on https://www.nuget.org/packages/csharp-ls/0.1.8) |
This works 100% as I described in the "expected" section in the issue, so I guess I have no choice but consider this 100% resolved 😄 |
Consider the following code:
a/Class1.cs
b/Class2.cs
Then put your cursor on
Class1()
and invokeM-x lsp-execute-code-action
in Emacs, or similar action in other editor.Observed that
You will be provided several different options:
(Screenshot for demonstrationg-purposes. Does not match example code 1-to-1)
Expected that
Generally, in my experience, some actions are almost always "more" preferred than others.
In this particular case I almost always want to have
using
-statements as first suggestion, explicit-namespacing as second and create new class as third and expect to find code-fixes in that order.Does the LSP protocol provide any sort of ... priority for the code actions or is it up to the LSP-client itself to determine how to present them?
The text was updated successfully, but these errors were encountered: