-
Notifications
You must be signed in to change notification settings - Fork 54
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
Formatting selected code doesn't work anymore, the whole file is formatted instead #1127
Comments
See lsp4e/org.eclipse.lsp4e/src/org/eclipse/lsp4e/operations/format/LSPFormatter.java Lines 58 to 67 in e3404b4
According to this code, the range parameters (the given text selection) are only used if the LS does not support document formatting and if the text selection has length 0. That does not make sense to me. It seems the last change on LSPFormatter accidentally changed the conditions. |
Also adapt mock server to support range formatting and add tests.
Issue
If you select some text in an LSP-based text editor and then you use the shortcut for formatting code (Ctrl + Shift + F on PCs), then the whole file is formatted instead of formatting the selected text only.
The text was updated successfully, but these errors were encountered: