From b905d723652b12f189559992a5f9292e282a5682 Mon Sep 17 00:00:00 2001 From: mst-mkt Date: Mon, 6 Jul 2026 03:47:04 +0900 Subject: [PATCH] fix: Syntax highlighting broken for variable declarations with type annotations --- syntaxes/nushell.tmLanguage.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/syntaxes/nushell.tmLanguage.json b/syntaxes/nushell.tmLanguage.json index 63bf2f2..178c33d 100644 --- a/syntaxes/nushell.tmLanguage.json +++ b/syntaxes/nushell.tmLanguage.json @@ -601,11 +601,15 @@ ] }, "define-variable": { - "match": "(let|mut|(?:export\\s+)?const)\\s+(\\w+)\\s+(=)", + "match": "(let|mut|(?:export\\s+)?const)\\s+(\\w+)(?:\\s*(:)\\s*([^=]+?))?\\s+(=)", "captures": { "1": { "name": "keyword.other.nushell" }, "2": { "name": "variable.other.nushell" }, - "3": { + "3": { "name": "punctuation.separator.nushell" }, + "4": { + "patterns": [{ "include": "#types" }] + }, + "5": { "patterns": [{ "include": "#operators" }] } }