From 60bc255a430b7381bfd34cc4b0b552c5d625fd3a Mon Sep 17 00:00:00 2001 From: Mark McCulloh Date: Fri, 12 Apr 2024 16:15:58 -0400 Subject: [PATCH] fix: keywords are highlighted incorrectly in objects/structs (#6223) Fixes #6208 Fixes #2595 Before: image After: image *By submitting this pull request, I confirm that my contribution is made under the terms of the [Wing Cloud Contribution License](https://github.com/winglang/wing/blob/main/CONTRIBUTION_LICENSE.md)*. --- .../vscode-wing/syntaxes/wing.tmLanguage.json | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/apps/vscode-wing/syntaxes/wing.tmLanguage.json b/apps/vscode-wing/syntaxes/wing.tmLanguage.json index 119c5e26e6f..f3bc85b1d2a 100644 --- a/apps/vscode-wing/syntaxes/wing.tmLanguage.json +++ b/apps/vscode-wing/syntaxes/wing.tmLanguage.json @@ -6,6 +6,12 @@ { "include": "#template-string" }, + { + "include": "#object-keys" + }, + { + "include": "#members" + }, { "include": "#keywords" }, @@ -23,9 +29,6 @@ }, { "include": "#identifiers" - }, - { - "include": "#members" } ], "repository": { @@ -188,6 +191,18 @@ } } ] + }, + "object-keys": { + "patterns": [ + { + "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*:", + "captures": { + "1": { + "name": "variable.wing" + } + } + } + ] } } }