File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -96,6 +96,8 @@ export class ObjectScriptDiagnosticProvider {
9696 let endingComma = false ;
9797 let isCode = ! isClass ;
9898 let jsScript = false ;
99+ let js = false ;
100+ let jsParens = 0 ;
99101 let sql = false ;
100102 let sqlParens = 0 ;
101103 for ( let i = 0 ; i < document . lineCount ; i ++ ) {
@@ -108,6 +110,18 @@ export class ObjectScriptDiagnosticProvider {
108110 jsScript = true ;
109111 }
110112
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+
111125 if ( text . match ( / & s q l / i) ) {
112126 sql = true ;
113127 sqlParens = 0 ;
Original file line number Diff line number Diff line change 6060 "embeddedSQL" : {
6161 "patterns" : [
6262 {
63- "begin" : " (&sql)(\\ ()" ,
63+ "begin" : " (?i)( &sql)(\\ ()" ,
6464 "beginCaptures" : {
6565 "1" : { "name" : " keyword.special.sql.objectscript" },
6666 "2" : { "name" : " punctuation.objectscript" }
7474 "embeddedJS" : {
7575 "patterns" : [
7676 {
77- "begin" : " (&js)(<)" ,
77+ "begin" : " (?i)( &js(cript)? )(<)" ,
7878 "beginCaptures" : {
7979 "1" : { "name" : " keyword.special.js.objectscript" },
8080 "2" : { "name" : " punctuation.objectscript" }
You can’t perform that action at this time.
0 commit comments