Skip to content

fix: Syntax highlighting broken for record keys containing brackets#232

Merged
fdncred merged 1 commit into
nushell:mainfrom
mst-mkt:main
May 24, 2026
Merged

fix: Syntax highlighting broken for record keys containing brackets#232
fdncred merged 1 commit into
nushell:mainfrom
mst-mkt:main

Conversation

@mst-mkt
Copy link
Copy Markdown
Contributor

@mst-mkt mst-mkt commented May 24, 2026

Issue

resolve #231

Summary

This PR fixes an issue where brackets included in record keys were being treated as actual functional brackets, causing highlighting to break.
The scope for the entire key has been changed from a single variable.other.nushell to a compound scope prefixed with string.quoted.*.

Changes

Updated the two rules for quoted keys within repository.braced-expression in syntaxes/nushell.tmLanguage.json:

-      "1": { "name": "variable.other.nushell" },
+      "1": { "name": "string.quoted.double.nushell variable.other.nushell" },
-      "1": { "name": "variable.other.nushell" },
+      "1": { "name": "string.quoted.single.nushell variable.other.nushell" },

Background Information

Verification

After applying these changes locally, I built the extension as a .vsix file and verified that the highlighting is rendered correctly when loaded.

image

@fdncred
Copy link
Copy Markdown
Contributor

fdncred commented May 24, 2026

cool. Thanks!

@fdncred fdncred merged commit bb6a4dd into nushell:main May 24, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Syntax highlighting broken for record keys containing brackets

2 participants