-
Notifications
You must be signed in to change notification settings - Fork 913
Expose Fix Imports command to LSP Clients #9062
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
base: master
Are you sure you want to change the base?
Conversation
lahodaj
left a comment
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.
Overall seems reasonable to me, with some suggestions for small cleanups inline.
| /** Creates a new instance of JavaFixAllImports */ | ||
| private JavaFixAllImports() { | ||
| } | ||
|
|
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.
Nit: revert this removal.
| */ | ||
| public abstract class CodeActionsProvider { | ||
|
|
||
| public static final String FIX_IMPORTS_KIND = "source.fixImports"; |
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.
I suspect this should be moved to java/java.lsp.server/src/org/netbeans/modules/java/lsp/server/protocol/FixImportsCodeAction.java? (I think that's consistent with what is being done for other ordinary implementations of CodeActionsProviders.
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.
Hmm , done !
| import org.eclipse.lsp4j.CodeActionKind; | ||
| import org.eclipse.lsp4j.CodeActionParams; | ||
| import org.eclipse.lsp4j.TextEdit; | ||
| import org.eclipse.lsp4j.WorkspaceEdit; |
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.
The changes in this file do not seem to be necessary - these can be removed.
fe4b915 to
322b794
Compare
Fix Imports Code action for LSP Client
Fix Imports...as a source code action to add all missing imports in one command.Click to collapse/expand PR instructions
By opening a pull request you confirm that, unless explicitly stated otherwise, the changes -
Please make sure (eg.
git log) that all commits have a valid name and email address for you in the Author field.If you're a first time contributor, see the Contributing guidelines for more information.
If you're a committer, please label the PR before pressing "Create pull request" so that the right test jobs can run.
PR approval and merge checklist:
If this PR targets the delivery branch: don't merge. (full wiki article)