File tree Expand file tree Collapse file tree
server/src/languages/tolk/semantic-tokens Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,6 +114,14 @@ export function provideTolkSemanticTokens(file: TolkFile): SemanticTokens {
114114 const name = n . childForFieldName ( "name" )
115115 if ( ! name ) return true
116116
117+ if ( name . endIndex - name . startIndex == 4 && name . text === "self" ) {
118+ tokens . node (
119+ name ,
120+ lsp . SemanticTokenTypes . keyword ,
121+ isMutable ? [ lsp . SemanticTokenModifiers . modification ] : [ ] ,
122+ )
123+ return true
124+ }
117125 tokens . node (
118126 name ,
119127 lsp . SemanticTokenTypes . parameter ,
@@ -132,6 +140,15 @@ export function provideTolkSemanticTokens(file: TolkFile): SemanticTokens {
132140 case "parameter_declaration" : {
133141 const isMutable = resolved . node . childForFieldName ( "mutate" ) !== null
134142
143+ if ( n . endIndex - n . startIndex == 4 && n . text === "self" ) {
144+ tokens . node (
145+ n ,
146+ lsp . SemanticTokenTypes . keyword ,
147+ isMutable ? [ lsp . SemanticTokenModifiers . modification ] : [ ] ,
148+ )
149+ return true
150+ }
151+
135152 tokens . node (
136153 n ,
137154 lsp . SemanticTokenTypes . parameter ,
You can’t perform that action at this time.
0 commit comments