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

Workaround inconsistency in intersection between ranges. #839

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bastianbeischer
Copy link

Sadly there is some confusion about ranges in the LSP protocol. It turns out
that VS code, when requesting code actions, sends range s,e in the request,
with the associated meaning that e is included in the range, i.e. the interval
is [s,e]. The emacs lsp-mode also uses this convention.

However, the protocl specifies that the end in the range s,e should not be part
of the interval, i.e. s,e is supposed to correspond to [s,e[:

https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#range

This was brought up with emacs-lsp, where the maintainer stated that he prefers
to stay compatbile with VS code rather than the protocol, and that the protocol
should likely be amended:

emacs-lsp/lsp-mode#3144

If that is the case, ccls intersection between ranges should be amended for now,
such that the end parameter is part of the range.

Sadly there is some confusion about ranges in the LSP protocol. It turns out
that VS code, when requesting code actions, sends range s,e in the request,
with the associated meaning that e is _included_ in the range, i.e. the interval
is [s,e]. The emacs lsp-mode also uses this convention.

However, the protocl specifies that the end in the range s,e should not be part
of the interval, i.e. s,e is supposed to correspond to [s,e[:

https://microsoft.github.io/language-server-protocol/specifications/specification-3-17/#range

This was brought up with emacs-lsp, where the maintainer stated that he prefers
to stay compatbile with VS code rather than the protocol, and that the protocol
should likely be amended:

emacs-lsp/lsp-mode#3144

If that is the case, ccls intersection between ranges should be amended for now,
such that the end parameter is part of the range.
@bastianbeischer
Copy link
Author

Fixes #838

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.

2 participants