Skip to content

Commit 3b7b5f5

Browse files
authored
Support raw strings (#197)
1 parent 16446cd commit 3b7b5f5

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

language-configuration.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,14 @@
2424
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
2525
{ "open": "\"", "close": "\"", "notIn": ["string"] },
2626
{ "open": "`", "close": "`", "notIn": ["string", "comment"] },
27-
{ "open": "/**", "close": " */", "notIn": ["string"] }
27+
{ "open": "/**", "close": " */", "notIn": ["string"] },
28+
{ "open": "r#'", "close": "'#", "notIn": ["string"] },
29+
{ "open": "r##'", "close": "'##", "notIn": ["string"] },
30+
{ "open": "r###'", "close": "'###", "notIn": ["string"] },
31+
{ "open": "r####'", "close": "'####", "notIn": ["string"] },
32+
{ "open": "r#####'", "close": "'#####", "notIn": ["string"] },
33+
{ "open": "r######'", "close": "'######", "notIn": ["string"] }
34+
// and so on...
2835
],
2936
// symbols that can be used to surround a selection
3037
"surroundingPairs": [

syntaxes/nushell.tmLanguage.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
{ "include": "#string-double-quote" },
2121
{ "include": "#string-interpolated-double" },
2222
{ "include": "#string-interpolated-single" },
23-
{ "include": "#string-bare" }
23+
{ "include": "#string-bare" },
24+
{ "include": "#string-raw" }
2425
]
2526
},
2627
"string-escape": {
@@ -31,6 +32,17 @@
3132
"match": "[^$\\[{(\"',|#\\s|][^\\[\\]{}()\"'\\s#,|]*",
3233
"name": "string.bare.nushell"
3334
},
35+
"string-raw": {
36+
"begin": "(?<=r)(#+)'",
37+
"beginCaptures": {
38+
"0": { "name": "punctuation.definition.string.begin.nushell" }
39+
},
40+
"end": "'\\1",
41+
"endCaptures": {
42+
"0": { "name": "punctuation.definition.string.end.nushell" }
43+
},
44+
"name": "string.raw.nushell"
45+
},
3446
"string-single-quote": {
3547
"begin": "'",
3648
"beginCaptures": {

0 commit comments

Comments
 (0)