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

LSP: Fix spec violations that break the VSCode outline #99295

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

Conversation

HolonProduction
Copy link
Member

@HolonProduction HolonProduction commented Nov 15, 2024

Fixes #98164

This contains fixes to two situations that would break the vscode outline:

  1. The one described in [LSP] Scripts doesn't begin with extends in the first line shows 'can't find symbols' in the outline #98164:
    As noticed in the issue: with the comment on the first line, the range of the root symbol shifts, which is fine. However, the spec for selectionRange requires the selection range to be inside of the range. When the class has no class_name we would just leave the selection range on its default of the start of the first line. With the root symbol shift this means, that the selection range is outside the range which is a spec violation and breaks the VSCode outline.

Figuring this out was so much more work than the three line fix would make it seem TwT

  1. The conversion between GDScript positions and LSP positions did not take a special case into account where the GDScript column is set to 0 but the line is set 1, for this case it would output an invalid lsp column value of -1 which would break the VSCode outline as well. This case can happen in scripts without extends and class_name statements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[LSP] Scripts doesn't begin with extends in the first line shows 'can't find symbols' in the outline
2 participants