Skip to content
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

Implement code action to replace ==/!= with ===/!== #1048

Merged
merged 3 commits into from Apr 26, 2022

Conversation

fredrikekre
Copy link
Member

This implements a new code action, CompareNothingWithTripleEqual, which
offers to replace == and != with === and !==, respectively, for the
corresponding linter warning(s).

This implements a new code action, CompareNothingWithTripleEqual, which
offers to replace == and != with === and !==, respectively, for the
corresponding linter warning(s).
@fredrikekre
Copy link
Member Author

From https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#textDocument_codeAction it looks like the response can also contain the diagnostics that the edit resolves? I am not sure how to pass that, and if it is necessary (the file will be relinted anyway, is it just so users can see that it actually resolves something?

@fredrikekre
Copy link
Member Author

I guess those would show up as quickfixes to the linter messages or something?

@davidanthoff davidanthoff added this to the Next Patch milestone Apr 5, 2022
@fredrikekre
Copy link
Member Author

I played around a bit more but I think that linking diagnostics to fixes like that require quite some more changes (e.g. returning CodeActions instead of Commands from codeAction request, and support for data in various structs, which is in version 3.16) so I think that can be done in a future PR.

@pfitzseb pfitzseb merged commit e9c1db9 into julia-vscode:master Apr 26, 2022
@fredrikekre fredrikekre deleted the fe/nothing-action branch April 26, 2022 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants