Skip to content

Commit 40a1511

Browse files
committed
Rename JsxTag to Module.
1 parent 77dae25 commit 40a1511

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

analysis/src/SemanticTokens.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ module Token = struct
33

44
(* This needs to stay synced with the same legend in `server.ts` *)
55
(* See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocument_semanticTokens *)
6-
type tokenType = Keyword | Variable | Type | JsxTag
6+
type tokenType = Keyword | Variable | Type | Module
77
type tokenModifiers = NoModifier
88

99
let tokenTypeToString = function
1010
| Keyword -> "0"
1111
| Variable -> "1"
1212
| Type -> "2"
13-
| JsxTag -> "3"
13+
| Module -> "3"
1414

1515
let tokenModifiersToString = function NoModifier -> "0"
1616

@@ -94,14 +94,14 @@ let emitLongident ~backwards ~pos ~jsx ~lid ~debug emitter =
9494
emitter
9595
|> emitFromPos pos
9696
(fst pos, snd pos + String.length id)
97-
~type_:(if isUppercaseId id then Token.JsxTag else Token.Variable)
97+
~type_:(if isUppercaseId id then Module else Token.Variable)
9898
| id :: segments when isUppercaseId id || isLowercaseId id ->
9999
if debug then Printf.printf "Ldot: %s %s\n" id (posToString pos);
100100
let length = String.length id in
101101
emitter
102102
|> emitFromPos pos
103103
(fst pos, snd pos + length)
104-
~type_:(if isUppercaseId id then Token.JsxTag else Token.Variable);
104+
~type_:(if isUppercaseId id then Module else Token.Variable);
105105
loop (fst pos, snd pos + length + 1) segments
106106
| _ -> ()
107107
in

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"semanticTokenScopes": [
3232
{
3333
"scopes": {
34-
"jsx-tag": ["entity.name.tag"]
34+
"module-tag": ["entity.name.tag"]
3535
}
3636
}
3737
],

server/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -760,7 +760,7 @@ function onMessage(msg: m.Message) {
760760
completionProvider: { triggerCharacters: [".", ">", "@", "~", '"'] },
761761
semanticTokensProvider: {
762762
legend: {
763-
tokenTypes: ["keyword", "variable", "type", "jsx-tag"],
763+
tokenTypes: ["keyword", "variable", "type", "module-tag"],
764764
tokenModifiers: [],
765765
},
766766
documentSelector: null,

0 commit comments

Comments
 (0)