Support Range semantic highlighting
Hi @CsCherrYY, I'm an AI Support assistant here to help with your issue. While the team reviews your request, I wanted to provide some possible tips and documentation that might help you in the meantime.
Current status
There is no built-in support for range-based semantic highlighting (i.e. the LSP textDocument/semanticTokens/range request) in the Java extension today. It only provides full-document semantic tokens.
Workarounds & suggestions
- You can still enable full-document semantic highlighting in your
settings.json:"java.semanticHighlighting.enabled": true, "editor.semanticHighlighting.enabled": true - For large files, consider breaking them into smaller types or using outline folding to reduce the visible surface area.
- If you hit performance or offset glitches after big edits, see the related issues below.
Related issues (high confidence)
-
Problem messages / semantic tokens getting offset after frequent changes – this discusses semantic highlighting glitches and potential fixes:
https://github.com/redhat-developer/vscode-java/issues/1633 -
Semantic highlighting breaks after large document changes (undo/redo, git reset) and discussion on a consistent repro:
https://github.com/redhat-developer/vscode-java/issues/1597#issuecomment-681974556
Other references with low confidence
- Selection occurrences are not highlighted at the vertical scroll bar (LSP
textDocument/documentHighlighttrace logs)
https://github.com/redhat-developer/vscode-java/issues/240#issuecomment-309028160
The team will respond to your issue shortly. I hope these suggestions are helpful in the meantime. If this comment helped you, please give it a 👍. If the suggestion was not helpful or incorrect, please give it a 👎. Your feedback helps us improve!