fix(lsp): color the own soft keyword

`own` is consumed by the annotation parser, so it never appears as a
symbol and the editor showed it uncolored. Emit a keyword semantic token
for the name `own`; identifiers/keywords otherwise stay with the TextMate
grammar.

This also unblocks symbol colors after an `own` annotation once the
server is rebuilt (the old binary could not parse `own` at all and lost
every later symbol).
This commit is contained in:
TermiNexus committed 2026-11-02 18:55:15 +08:00
1 parent c37b8dc52c
commit c95290f913
1 file changed
+3
+3
View File
@@ -24,6 +24,7 @@ define ST_METHOD = 3
define ST_PARAMETER = 4
define ST_VARIABLE = 5
define ST_PROPERTY = 6
define ST_KEYWORD = 7
define ST_COMMENT = 8
define ST_STRING = 9
define ST_NUMBER = 10
@@ -462,6 +463,8 @@ def _LexStream(pool: memhub.MemManager*,
typ = ST_STRING
elif tok.type == ast.TokenType.Number:
typ = ST_NUMBER
elif tok.type == ast.TokenType.Name and tok.str_val is not None and string.strcmp(tok.str_val, "own") == 0:
typ = ST_KEYWORD
end_line0: int = line0
end_col: int = tok.col_offset
if tok.end_lineno > tok.lineno and tok.end_col_offset > 0: