Skip to content

Commit 23e5e16

Browse files
committed
##sql syntax highlighting and skip in diagnostics, #70
1 parent e0333a4 commit 23e5e16

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

src/providers/ObjectScriptDiagnosticProvider.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ export class ObjectScriptDiagnosticProvider {
130130
continue;
131131
}
132132

133-
if (text.match(/&sql/i)) {
133+
if (text.match(/(?:&|##)sql/i)) {
134134
sql = true;
135135
sqlParens = 0;
136136
}

syntaxes/objectscript-macros.tmLanguage.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
{ "include": "#define" },
99
{ "include": "#def1arg" },
1010
{ "include": "#ifdef" },
11-
{ "include": "#comment-line" }
11+
{ "include": "#comment-line" },
12+
{ "include": "#sql" }
1213
],
1314

1415
"repository": {
@@ -123,6 +124,20 @@
123124
"endCaptures": { "0": { "name": "punctuation.definition.objectscript" } }
124125
}
125126
]
127+
},
128+
"sql": {
129+
"patterns": [
130+
{
131+
"begin": "(?i)(##sql)(\\()",
132+
"beginCaptures": {
133+
"1": { "name": "keyword.special.sql.objectscript" },
134+
"2": { "name": "punctuation.objectscript" }
135+
},
136+
"patterns": [{ "include": "source.sql" }],
137+
"contentName": "meta.embedded.block.sql",
138+
"end": "\\)"
139+
}
140+
]
126141
}
127142
}
128143
}

0 commit comments

Comments
 (0)