@@ -96,6 +96,8 @@ export class ObjectScriptDiagnosticProvider {
9696 let endingComma = false ;
9797 let isCode = ! isClass ;
9898 let jsScript = false ;
99+ let sql = false ;
100+ let sqlParens = 0 ;
99101 for ( let i = 0 ; i < document . lineCount ; i ++ ) {
100102 const line = document . lineAt ( i ) ;
101103 const text = this . stripLineComments ( line . text ) ;
@@ -106,6 +108,19 @@ export class ObjectScriptDiagnosticProvider {
106108 jsScript = true ;
107109 }
108110
111+ if ( text . match ( "&sql" ) ) {
112+ sql = true ;
113+ sqlParens = 0 ;
114+ }
115+
116+ if ( sql ) {
117+ sqlParens = sqlParens + ( text . split ( "(" ) . length - 1 ) - ( text . split ( ")" ) . length - 1 ) ;
118+ if ( sqlParens <= 0 ) {
119+ sql = false ;
120+ }
121+ continue ;
122+ }
123+
109124 if ( jsScript ) {
110125 if ( text . match ( / < \/ s c r i p t > / ) ) {
111126 jsScript = false ;
@@ -151,8 +166,9 @@ export class ObjectScriptDiagnosticProvider {
151166 code : "" ,
152167 message : "Unrecognized command" ,
153168 range,
154- severity : vscode . DiagnosticSeverity . Error ,
155- source : "" ,
169+ severity : found . toUpperCase ( ) . startsWith ( "Z" )
170+ ? vscode . DiagnosticSeverity . Warning
171+ : vscode . DiagnosticSeverity . Error ,
156172 relatedInformation : [
157173 new vscode . DiagnosticRelatedInformation (
158174 new vscode . Location ( document . uri , range ) ,
@@ -211,11 +227,11 @@ export class ObjectScriptDiagnosticProvider {
211227 ) ;
212228 if ( ! systemFunction ) {
213229 result . push ( {
214- code : "" ,
215- message : "Unrecognized system function/variable" ,
216230 range,
217- severity : vscode . DiagnosticSeverity . Error ,
218- source : "" ,
231+ message : "Unrecognized system function/variable" ,
232+ severity : found . toUpperCase ( ) . startsWith ( "$Z" )
233+ ? vscode . DiagnosticSeverity . Warning
234+ : vscode . DiagnosticSeverity . Error ,
219235 relatedInformation : [
220236 new vscode . DiagnosticRelatedInformation (
221237 new vscode . Location ( document . uri , range ) ,
@@ -224,6 +240,21 @@ export class ObjectScriptDiagnosticProvider {
224240 ] ,
225241 } ) ;
226242 }
243+ if ( systemFunction && systemFunction . deprecated ) {
244+ result . push ( {
245+ range,
246+ code : systemFunction . code || "" ,
247+ severity : vscode . DiagnosticSeverity . Warning ,
248+ message : "Deprecated system function/variable" ,
249+ tags : [ vscode . DiagnosticTag . Deprecated ] ,
250+ relatedInformation : [
251+ new vscode . DiagnosticRelatedInformation (
252+ new vscode . Location ( document . uri , range ) ,
253+ `System function or variable '${ found } ' deprecated`
254+ ) ,
255+ ] ,
256+ } ) ;
257+ }
227258 }
228259 }
229260 return result ;
0 commit comments