Skip to content

Commit eaf5773

Browse files
committed
tm syntax: add variable fields in "variables"
get rid of non-fixed text width lookbehind, incompatible with PCRE regex
1 parent 4a7ec6e commit eaf5773

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

syntaxes/nushell.tmLanguage.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@
119119
"name": "variable.parameter.nushell"
120120
},
121121
"variables": {
122-
"match": "(\\$[a-zA-Z0-9_]+)",
122+
"match": "(\\$[a-zA-Z0-9_]+)((?:\\.(?:[\\w-]+|\"[\\w\\- ]+\"))+)",
123123
"captures": {
124124
"1": {
125125
"patterns": [
@@ -129,11 +129,14 @@
129129
"name": "variable.other.nushell"
130130
}
131131
]
132+
},
133+
"2": {
134+
"name": "variable.other.nushell"
132135
}
133136
}
134137
},
135138
"variable-fields": {
136-
"match": "(?<=\\)|\\}|\\]|\\$\\w+)(?:\\.(?:[\\w-]+|\"[\\w\\- ]+\"))+",
139+
"match": "(?<=\\)|\\}|\\])(?:\\.(?:[\\w-]+|\"[\\w\\- ]+\"))+",
137140
"name": "variable.other.nushell"
138141
},
139142
"internal-variables": {

0 commit comments

Comments
 (0)