File tree 2 files changed +16
-2
lines changed
2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ export class ObjectScriptDiagnosticProvider {
96
96
let endingComma = false ;
97
97
let isCode = ! isClass ;
98
98
let jsScript = false ;
99
+ let js = false ;
100
+ let jsParens = 0 ;
99
101
let sql = false ;
100
102
let sqlParens = 0 ;
101
103
for ( let i = 0 ; i < document . lineCount ; i ++ ) {
@@ -108,6 +110,18 @@ export class ObjectScriptDiagnosticProvider {
108
110
jsScript = true ;
109
111
}
110
112
113
+ if ( text . match ( / & j s ( c r i p t ) ? / i) ) {
114
+ js = true ;
115
+ jsParens = 0 ;
116
+ }
117
+ if ( js ) {
118
+ jsParens = jsParens + ( text . split ( "<" ) . length - 1 ) - ( text . split ( ">" ) . length - 1 ) ;
119
+ if ( jsParens <= 0 ) {
120
+ js = false ;
121
+ }
122
+ continue ;
123
+ }
124
+
111
125
if ( text . match ( / & s q l / i) ) {
112
126
sql = true ;
113
127
sqlParens = 0 ;
Original file line number Diff line number Diff line change 60
60
"embeddedSQL" : {
61
61
"patterns" : [
62
62
{
63
- "begin" : " (&sql)(\\ ()" ,
63
+ "begin" : " (?i)( &sql)(\\ ()" ,
64
64
"beginCaptures" : {
65
65
"1" : { "name" : " keyword.special.sql.objectscript" },
66
66
"2" : { "name" : " punctuation.objectscript" }
74
74
"embeddedJS" : {
75
75
"patterns" : [
76
76
{
77
- "begin" : " (&js)(<)" ,
77
+ "begin" : " (?i)( &js(cript)? )(<)" ,
78
78
"beginCaptures" : {
79
79
"1" : { "name" : " keyword.special.js.objectscript" },
80
80
"2" : { "name" : " punctuation.objectscript" }
You can’t perform that action at this time.
0 commit comments