Skip to content

Commit d4c231b

Browse files
mlantasdlesbre
andauthored
Reintroduce quoted string literal highlighting with correct ID handling (#1871)
* Revert "Remove quoted string literal highlighting from grammar (#1860)" This reverts commit 19ed469. * Match opening and closing quoted strings * Update CHANGELOG --------- Co-authored-by: Dorian Lesbre <[email protected]>
1 parent 4af94f3 commit d4c231b

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## Unreleased
44

55
- Add support for quoted string literal brackets (`{|`, `|}`) syntax highlighting and auto-closing pairs
6+
- Reintroduce quoted string literal highlighting with correct ID handling (#1871)
67

78
## 1.30.1
89

syntaxes/mlx.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,11 +341,27 @@
341341
"match": "\\\\\""
342342
}
343343
]
344+
},
345+
{
346+
"comment": "quoted string literal",
347+
"begin": "\\{([[:lower:]_]*)\\|",
348+
"end": "\\|\\1\\}"
344349
}
345350
]
346351
},
347352
"strings": {
348353
"patterns": [
354+
{
355+
"comment": "quoted string literal",
356+
"name": "string.quoted.braced.ocaml",
357+
"begin": "\\{(%%?[[:alpha:]_][[:word:]']*(\\.[[:alpha:]_][[:word:]']*)*[[:space:]]*)?([[:lower:]_]*)\\|",
358+
"end": "\\|\\3\\}",
359+
"beginCaptures": {
360+
"1": {
361+
"name": "keyword.other.extension.ocaml"
362+
}
363+
}
364+
},
349365
{
350366
"comment": "string literal",
351367
"name": "string.quoted.double.ocaml",

syntaxes/ocaml.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,26 @@
168168
"begin": "\"",
169169
"end": "\"",
170170
"patterns": [{ "match": "\\\\\\\\" }, { "match": "\\\\\"" }]
171+
},
172+
{
173+
"comment": "quoted string literal",
174+
"begin": "\\{([[:lower:]_]*)\\|",
175+
"end": "\\|\\1\\}"
171176
}
172177
]
173178
},
174179

175180
"strings": {
176181
"patterns": [
182+
{
183+
"comment": "quoted string literal",
184+
"name": "string.quoted.braced.ocaml",
185+
"begin": "\\{(%%?[[:alpha:]_][[:word:]']*(\\.[[:alpha:]_][[:word:]']*)*[[:space:]]*)?([[:lower:]_]*)\\|",
186+
"end": "\\|\\3\\}",
187+
"beginCaptures": {
188+
"1": { "name": "keyword.other.extension.ocaml" }
189+
}
190+
},
177191
{
178192
"comment": "string literal",
179193
"name": "string.quoted.double.ocaml",

0 commit comments

Comments
 (0)