You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.
@faustinoaq Did some digging on this - I believe it is due to the way Sublime LSP sets its text points. So we send the our response which contains different ranges. These ranges get converted into Sublime Regions. Sublime is overlapping the regions it creates because all of our text edits have the same MAX value, which essentially converts them all into one region (This is why we are only seeing the first line get formatted )https://github.com/crystal-lang-tools/scry/blob/master/src/scry/formatter.cr#L34
I looked at how Go's Language server does it and it looks like they send back a single text edit for the entire format https://github.com/sourcegraph/go-langserver/blob/master/langserver/format.go#L53. I did the same on our and it seems to solve the problem, since we only send back a single Range and Sublime uses a single region. Is there any particular reason we would need to send back each individual TextEdit since we end up formatting the entire document anyway?
On ST3 to reproduce this issue try scry formatting disabling crystal
auto_format
on crystal package setting:As you can see scry formatting is almost deleting all file text.
Ref: #34
The text was updated successfully, but these errors were encountered: