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(inlayHint&semanticTokens): Fix range send to server #5192

Merged
merged 1 commit into from
Nov 20, 2024

Conversation

tcx4c70
Copy link
Contributor

@tcx4c70 tcx4c70 commented Nov 19, 2024

From LSP spec [1]:

.. the end position is exclusive. If you want to specify a range that
contains a line including the line ending character(s) then use an end
position denoting the start of the next line.

but it doesn't mention what we should send to server if the file hasn't EOL. VS Code will set end = { line = last line number (0-based), character = length of the last line}. This fix will change the behavior to the same as VS Code so that some language servers (such as roslyn language server) will work normally.

[1] https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#range

Copy link

codecov bot commented Nov 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.36%. Comparing base (f06e21e) to head (5a6e858).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5192   +/-   ##
=======================================
  Coverage   98.35%   98.36%           
=======================================
  Files         273      273           
  Lines       26154    26165   +11     
  Branches     5409     5413    +4     
=======================================
+ Hits        25725    25737   +12     
+ Misses        268      266    -2     
- Partials      161      162    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

src/model/textdocument.ts Outdated Show resolved Hide resolved
From LSP spec [1]:
> .. the end position is exclusive. If you want to specify a range that
> contains a line including the line ending character(s) then use an end
> position denoting the start of the next line.

but it doesn't mention what we should send to server if the file hasn't
EOL. VS Code will set end = { line = last line number (0-based),
character = length of the last line}. This fix will change the behavior
to the same as VS Code so that some language servers (such as roslyn
language server) will work normally.

[1] https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#range

Signed-off-by: Adam Tao <tcx4c70@gmail.com>
@fannheyward fannheyward merged commit a455fc7 into neoclide:master Nov 20, 2024
3 of 4 checks passed
fannheyward added a commit that referenced this pull request Nov 25, 2024
aacbbca feat: Add uriConverter.code2Protocol (#5198)
61be196 chore(packages): esbuild/eslint/jest (#5197)
13b63d7 feat(neovim): bundled neoclide/neovim (#5196)
dbfa1c9 fix(package): audit fix cross-spawn (#5193)
a455fc7 fix(inlayHint&semanticTokens): Fix range send to server (#5192)
18c34bc docs: add zoumi as a contributor for code (#5191)
f06e21e feat: improve performance for large file (#5190)
6d2e07f docs: update help for coc-dialog-input toggle-selection #5187 (#5189)
43b706a docs: add laktak as a contributor for code (#5188)
c878df6 feat: alternate keybinding for coc-dialog-input toggle-selection (#5187)
3b8869a docs: add oxalica as a contributor for code (#5182)
bf42817 docs: add wsdjeg as a contributor for code (#5181)
b271084 docs: add itsf4llofstars as a contributor for doc (#5180)
f87fcf1 docs: add brainwo as a contributor for doc (#5179)
58ba3cc docs: add tcx4c70 as a contributor for code (#5178)
a542be2 docs: add V-Mann-Nick as a contributor for code (#5177)
bc813a2 docs: add gera2ld as a contributor for code (#5176)
91a5328 docs: add merwan as a contributor for doc (#5175)
7531a84 docs: add hackergrrl as a contributor for doc (#5174)
dafa79f docs: add YongJieYongJie as a contributor for code (#5173)
a119577 docs: add cridemichel as a contributor for code (#5172)
790ab94 docs: add mehalter as a contributor for code (#5171)
acced09 docs: add cclauss as a contributor for code (#5170)
08ca74f docs: add aispeaking as a contributor for code (#5169)
4fdbab4 docs: add asmodeus812 as a contributor for code (#5165)
905cdfb docs: add 43081j as a contributor for code (#5166)
d001dd6 docs: add Kaiser-Yang as a contributor for code (#5167)
272937b docs: add de-vri-es as a contributor for code (#5168)
52b3503 docs: add A4-Tacks as a contributor for code (#5164)
d9afe33 docs: add zhixiao-zhang as a contributor for code (#5163)
30c62b7 docs: add statiolake as a contributor for code (#5162)
815a371 docs: add davidosomething as a contributor for doc (#5161)
13751e1 feat(list): add CocListMoved event (#5160)
5fdf3d6 mention coc-diagnostics-shim in docs (#5159)
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