LSP: Fix spec violations that break the VSCode outline #99295
+43
−1
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #98164
This contains fixes to two situations that would break the vscode outline:
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 noclass_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.0
but the line is set1
, 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 withoutextends
andclass_name
statements.