eclipse-langium / langium

Next-gen language engineering / DSL framework
https://langium.org/
MIT License
663 stars 61 forks source link

Fix range comparison #1525

Closed jindong-zhannng closed 1 month ago

jindong-zhannng commented 1 month ago

The start of ranges in LSP is zero-based.

I don't know is this function still in use, just fix it while reading source codes.

jindong-zhannng commented 1 month ago

I added test cases to cover all my changes. For the range comparison, here is a reference implementation from vscode: https://github.com/microsoft/vscode/blob/addd445017c9c5531b89851dc8dc9bec4f1dd0f8/src/vs/editor/common/core/range.ts#L420C16-L420C31