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

Fix textDocument/formatting operations #98

Merged
merged 2 commits into from
Feb 25, 2024

Conversation

Guldoman
Copy link
Member

Fixes #86.

Also this applies formatting TextEdits in reverse order (from bottom to top) which should result in edits occurring at the intended locations.
This assumes that the TextEdits are sent by the servers already sorted. If this ends up to not be the case for all servers, we'll add range sorting code.

TODO: for servers that just send a single big TextEdit, we should find some heuristic to move the cursor to an appropriate location (maybe trying to keep it on the same line+col would be enough). See #31.

The `TextEdit` ranges don't consider the intermediate doc states, so applying them in reverse order (from bottom to top) should result in edits occurring at the intended locations.
@Guldoman Guldoman merged commit b11b930 into lite-xl:master Feb 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Formatting fails with pylsp
1 participant