From c95290f913b2790ddb8d320ca1e6f57f65055a74 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Mon, 2 Nov 2026 18:55:15 +0800 Subject: [PATCH] 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). --- App/lib/lsp/LspSemantic.vp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/App/lib/lsp/LspSemantic.vp b/App/lib/lsp/LspSemantic.vp index 987627d..5c1ff0f 100644 --- a/App/lib/lsp/LspSemantic.vp +++ b/App/lib/lsp/LspSemantic.vp @@ -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: