Skip to content

Commit fc0811f

Browse files
committed
feat: Additions to regex
1 parent 674d640 commit fc0811f

15 files changed

+2533
-418
lines changed

syntaxes/regexp.tmLanguage.json

Lines changed: 21 additions & 13 deletions
Large diffs are not rendered by default.

syntaxes/tests/JSON/negatives.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,26 @@
3232
}
3333
]
3434
],
35+
"regexp": {
36+
"problemMatchers": [
37+
{
38+
"background": {
39+
"beginsPattern": "not-regex",
40+
"endsPattern": "not-regex"
41+
}
42+
}
43+
]
44+
},
45+
"problemMatchers": [
46+
{
47+
"background": {
48+
"beginsPattern": {
49+
"string": "not-regex"
50+
},
51+
"regexp": "not-regex"
52+
}
53+
}
54+
],
3555
"configurationDefaults": {
3656
"editor.tokenColorCustomizations": {
3757
"textMateRules": [

syntaxes/tests/JSON/negatives.json.snap

Lines changed: 122 additions & 0 deletions
Large diffs are not rendered by default.

syntaxes/tests/JSON/package.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,52 @@
529529
}
530530
]
531531
},
532+
"problemMatchers": [
533+
{
534+
"background": {
535+
"beginsPattern": {
536+
"regexp": "regex",
537+
"string": "string"
538+
},
539+
"endsPattern": "regex",
540+
"activeOnStart": true,
541+
"regexp": "string",
542+
"string": "string"
543+
},
544+
"pattern": [
545+
{
546+
"regexp": "^([^\\\\s].*)\\\\((\\\\d+,\\\\d+)\\\\):\\\\s*(.*)$",
547+
"file": 1,
548+
"location": 2,
549+
"message": 3
550+
}
551+
]
552+
},
553+
{
554+
"pattern": {
555+
"regexp": "^([^\\\\s].*)\\\\((\\\\d+,\\\\d+)\\\\):\\\\s*(.*)$",
556+
"file": 1,
557+
"location": 2,
558+
"message": 3
559+
}
560+
}
561+
],
562+
"problemPatterns": [
563+
{
564+
"name": "rustc",
565+
"patterns": [
566+
{
567+
"regexp": "^(warning|warn|error)(?:\\[(.*?)\\])?: (.*)$",
568+
"severity": 1,
569+
"code": 2,
570+
"message": 3
571+
}
572+
]
573+
},
574+
{
575+
"regexp": "^.*\"message\":{\"message\":\"([^\"]*).*?\"file_name\":\"([^\"]+).*?\"line_start\":(\\d+).*?\"line_end\":(\\d+).*?\"column_start\":(\\d+).*?\"column_end\":(\\d+).*}$"
576+
}
577+
],
532578
"taskDefinitions": [
533579
{
534580
"properties": {

syntaxes/tests/JSON/package.json.snap

Lines changed: 512 additions & 0 deletions
Large diffs are not rendered by default.

syntaxes/tests/JSON/schema.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,23 @@
11
{
22
"$schema": "https://json-schema.org/draft-04/schema#",
3+
"patternProperties": {
4+
"(^\\d+(-\\d+)?$)|(.+)": {
5+
"markdownDescription": "When true, a modal dialog will show if the chosen local port isn't used for forwarding.",
6+
"patternProperties": {
7+
"^[a-zA-Z0-9-_.]+[.]*\/[a-zA-Z0-9-_*]+[.]*$": {
8+
"anyOf": [
9+
{
10+
"patternProperties": {
11+
"^([a-zA-Z0-9_-]+(:[a-zA-Z0-9_-]+)?)$": {
12+
"markdownDescription": "Only 3 nested levels"
13+
}
14+
}
15+
}
16+
]
17+
}
18+
}
19+
}
20+
},
321
"pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
422
"defaultSnippets": [
523
{

syntaxes/tests/JSON/schema.json.snap

Lines changed: 167 additions & 0 deletions
Large diffs are not rendered by default.

syntaxes/tests/JSONC/language-configuration.json

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,47 +7,40 @@
77
},
88
"action": { "indent": "indent" }
99
},
10-
{ "afterText": "[]-[][[-\\]]{1}\\" }
10+
{ "afterText": "[]-[][[-\\]]{1}\\" },
11+
{
12+
"previousLineText": "^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$",
13+
"beforeText": "^\\s+([^{i\\s]|i(?!f\\b))",
14+
"action": { "indent": "outdent" }
15+
},
16+
{
17+
"beforeText": { "pattern": "//.*" },
18+
"afterText": { "pattern": "^(?!\\s*$).+" },
19+
"action": {
20+
"indent": "none",
21+
"appendText": "// "
22+
}
23+
}
1124
],
1225
"indentationRules": {
1326
"increaseIndentPattern": "<(?!\\?|(?:area|base|br|col|frame|hr|html|img|input|keygen|link|menuitem|meta|param|source|track|wbr)\\b|[^>]*\\/>)([-_\\.A-Za-z0-9]+)(?=\\s|>)\\b[^>]*>(?!.*<\\/\\1>)|<!--(?!.*-->)|\\{[^}\"']*$",
14-
"decreaseIndentPattern": "^\\s*(<\\/(?!html)[-_\\.A-Za-z0-9]+\\b[^>]*>|-->|\\})"
27+
"decreaseIndentPattern": "^\\s*(<\\/(?!html)[-_\\.A-Za-z0-9]+\\b[^>]*>|-->|\\})",
28+
"indentNextLinePattern": { "pattern": "^\\s*[\\}\\]\\)].*$" },
29+
"unIndentedLinePattern": { "pattern": "^.*(\\{[^}]*|\\([^)]*|\\[[^\\]]*)$" }
1530
},
1631
"wordPattern": "(?<=(^|(?<!\\\\)[\\[\\]{}:,\t])\\s*)(?=(?<json>[\\w/$]+))\\k<json>(?=\\s*($|[\\[\\]{}:,\"\t](?!\\\\)))|(?<=(?<!\\\\)[\" (]-?|\\b[LR]:)(?=(?<string>[a-zA-Z./$][\\w./$-]*[\\w.]))\\k<string>(?=[\" )])|(?<=(?<!\\\\)\")(?=(?<include>[\\w.#$-]+))\\k<include>(?=\")",
1732
"wordPattern": "((?<=^\\s*)@[A-Z0-9]*|(?<!^\\s*)@[\\w.*]*)(?=$|//|;|\\s)|[\\w.*-]+",
1833
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)",
1934
"wordPattern": "(#?-?\\d*\\.\\d\\w*%?)|(::?[\\w-]*(?=[^,{;]*[,{]))|(([@#.!])?[\\w-?]+%?|[@#!.])",
35+
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)",
2036
"wordPattern": {
2137
"pattern": "(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})(((\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark})|[_])?(\\p{Alphabetic}|\\p{Number}|\\p{Nonspacing_Mark}))*",
2238
"flags": "ug"
23-
}
24-
}
25-
26-
{
27-
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)",
39+
},
2840
"folding": {
2941
"markers": {
3042
"start": "^\\s*#pragma\\s+region\\b",
3143
"end": "^\\s*#pragma\\s+endregion\\b"
3244
}
33-
},
34-
"indentationRules": {
35-
"decreaseIndentPattern": { "pattern": "^\\s*[\\}\\]\\)].*$" },
36-
"increaseIndentPattern": { "pattern": "^.*(\\{[^}]*|\\([^)]*|\\[[^\\]]*)$" }
37-
},
38-
"onEnterRules": [
39-
{
40-
"previousLineText": "^\\s*(((else ?)?if|for|while)\\s*\\(.*\\)\\s*|else\\s*)$",
41-
"beforeText": "^\\s+([^{i\\s]|i(?!f\\b))",
42-
"action": { "indent": "outdent" }
43-
},
44-
{
45-
"beforeText": { "pattern": "//.*" },
46-
"afterText": { "pattern": "^(?!\\s*$).+" },
47-
"action": {
48-
"indent": "none",
49-
"appendText": "// "
50-
}
51-
}
52-
]
45+
}
5346
}

0 commit comments

Comments
 (0)