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 was archived by the owner on Dec 29, 2022. It is now read-only.
Due to the way that Emacs text change hooks are implemented, it's not possible for it to generate proper didChange events as per LSP protocol.
This is due to the fact that it can't calculate correct range.end value, only range.start and rangeLength. Why it is so is outlined in microsoft/language-server-protocol#9 discussion, but I can go into more detail if needed. But the end result is that it isn't possible for Emacs to make use of RLS, because presently RLS takes only range.start and range.end into consideration.
Now, since knowing just range.start and rangeLength is also sufficient for proper handling of the event, there is a possibility for RLS to also support Emacs and similar editors by using rangeLength field, if it's present, and falling back to range.end otherwise.
This will allow such editors to send garbage in range.end field, but still stay functional. Hopefully, LSP spec writers will realise the problem and legitimise absence of range.end field in the next version of the protocol.
Note that VSCode also sends rangeLength field, so using Emacs isn't necessary to implement the suggested workaround.
Due to the way that Emacs text change hooks are implemented, it's not possible for it to generate proper didChange events as per LSP protocol.
This is due to the fact that it can't calculate correct
range.end
value, onlyrange.start
andrangeLength
. Why it is so is outlined in microsoft/language-server-protocol#9 discussion, but I can go into more detail if needed. But the end result is that it isn't possible for Emacs to make use of RLS, because presently RLS takes onlyrange.start
andrange.end
into consideration.Now, since knowing just
range.start
andrangeLength
is also sufficient for proper handling of the event, there is a possibility for RLS to also support Emacs and similar editors by usingrangeLength
field, if it's present, and falling back torange.end
otherwise.This will allow such editors to send garbage in range.end field, but still stay functional. Hopefully, LSP spec writers will realise the problem and legitimise absence of
range.end
field in the next version of the protocol.Note that VSCode also sends
rangeLength
field, so using Emacs isn't necessary to implement the suggested workaround.cc @alanz
The text was updated successfully, but these errors were encountered: