@@ -21,31 +21,7 @@ private Grammar getRscGrammar() {
2121 : p [attributes = attributes + \tag ("category" (category ))];
2222
2323 return visit (rsc ) {
24-
25- // The following mapping is based on:
26- // - https://github.com/usethesource/rascal/blob/83023f60a6eb9df7a19ccc7a4194b513ac7b7157/src/org/rascalmpl/values/parsetrees/TreeAdapter.java#L44-L59
27- // - https://github.com/usethesource/rascal-language-servers/blob/752fea3ea09101e5b22ee426b11c5e36db880225/rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/util/SemanticTokenizer.java#L121-L142
28- // With updates based on:
29- // - https://github.com/eclipse-lsp4j/lsp4j/blob/f235e91fbe2e45f62e185bbb9f6d21bed48eb2b9/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/Protocol.xtend#L5639-L5695
30- // - https://github.com/usethesource/rascal-language-servers/blob/88be4a326128da8c81d581c2b918b4927f2185be/rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/util/SemanticTokenizer.java#L134-L152
31- case \tag ("category" ("Normal" )) => \tag ("category" ("source" ))
32- case \tag ("category" ("Type" )) => \tag ("category" ("type" )) // Updated (before: storage.type)
33- case \tag ("category" ("Identifier" )) => \tag ("category" ("variable" ))
34- case \tag ("category" ("Variable" )) => \tag ("category" ("variable" ))
35- case \tag ("category" ("Constant" )) => \tag ("category" ("string" )) // Updated (before: constant)
36- case \tag ("category" ("Comment" )) => \tag ("category" ("comment" ))
37- case \tag ("category" ("Todo" )) => \tag ("category" ("comment" ))
38- case \tag ("category" ("Quote" )) => \tag ("category" ("string" )) // Updated (before: meta.string)
39- case \tag ("category" ("MetaAmbiguity" )) => \tag ("category" ("invalid" ))
40- case \tag ("category" ("MetaVariable" )) => \tag ("category" ("variable" ))
41- case \tag ("category" ("MetaKeyword" )) => \tag ("category" ("keyword" )) // Updated (before: keyword.other)
42- case \tag ("category" ("MetaSkipped" )) => \tag ("category" ("string" ))
43- case \tag ("category" ("NonterminalLabel" )) => \tag ("category" ("variable" )) // Updated (before: variable.parameter)
44- case \tag ("category" ("Result" )) => \tag ("category" ("string" )) // Updated (before: text)
45- case \tag ("category" ("StdOut" )) => \tag ("category" ("string" )) // Updated (before: text)
46- case \tag ("category" ("StdErr" )) => \tag ("category" ("string" )) // Updated (before: text)
47-
48- // With additional hot-patching as discussed:
24+ // Temporarily hot-patch Rascal's own grammar as discussed here:
4925 // - https://github.com/SWAT-engineering/rascal-textmate/pull/6
5026 case p : prod (label ("integer" , sort ("Literal" )), _, _) => setCategory (p , "constant.numeric" )
5127 case p : prod (label ("real" , sort ("Literal" )), _, _) => setCategory (p , "constant.numeric" )
0 commit comments