-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add special-case-highlighting parameter to parsing service #502
Add special-case-highlighting parameter to parsing service #502
Conversation
…ll2024-collector-modes
…nd make corresponding changes in the Java part)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional comments
rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/util/ISemanticTokens.java
Outdated
Show resolved
Hide resolved
rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/util/SemanticTokenizer.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except that we're missing the typescript side of the dedicated parser configuration.
rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/parametric/ParserOnlyContribution.java
Outdated
Show resolved
Hide resolved
rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/util/ISemanticTokens.java
Outdated
Show resolved
Hide resolved
Quality Gate failedFailed conditions |
Overview
Before this PR, the semantic highlighter applied a special case for
syntax
-in-syntax
(sub)trees. However, this gave rise to unexpected behavior and caused #456.After this PR:
syntax
tree (with category) hassyntax
children #456.To control whether or not the special case is applied for DSLs, this PR temporarily -- for the next few release cycles -- adds keyword parameter
usesSpecialCaseHighlighting
to constructorparsing
of ADTLanguageServer
.true
. Existing grammars that rely on the special case will have the expected highlighting. They could be updated (encouraged), andusesSpecialCaseHighlighting
could be set totrue
(encouraged).false
. Existing grammars that rely on the special case may not have the expected highlighting. Either they should be updated (encouraged), orusesSpecialCaseHighlighting
should be set totrue
(discouraged).usesSpecialCaseHighlighting
will be removed (i.e., the special case ceases to exist). Existing grammars that rely on the special case may not have the expected highlighting. They must be updated.A few details
The updated constructor:
rascal-language-servers/rascal-lsp/src/main/rascal/util/LanguageServer.rsc
Lines 248 to 249 in 9175367
The updated docs:
rascal-language-servers/rascal-lsp/src/main/rascal/util/LanguageServer.rsc
Lines 173 to 183 in 9175367
The updated Pico language server as an example:
rascal-language-servers/rascal-lsp/src/main/rascal/demo/lang/pico/LanguageServer.rsc
Lines 48 to 50 in 9175367