@@ -58,9 +58,7 @@ export function setCheckerAvailableContext(additionalState = true) {
5858 commands . executeCommand ( `setContext` , CHECKER_AVAILABLE_CONTEXT , available ) ;
5959}
6060
61- let checkerRunning = false ;
6261export function setCheckerRunningContext ( isRunning : boolean ) {
63- checkerRunning = isRunning ;
6462 commands . executeCommand ( `setContext` , CHECKER_RUNNING_CONTEXT , isRunning ) ;
6563}
6664
@@ -122,7 +120,8 @@ interface SqlDiagnostic extends Diagnostic {
122120
123121async function validateSqlDocument ( document : TextDocument , specificStatement ?: number ) {
124122 const checker = SQLStatementChecker . get ( ) ;
125- if ( remoteAssistIsEnabled ( ) && checker && ! checkerRunning ) {
123+ const job = remoteAssistIsEnabled ( true ) ;
124+ if ( checker && job ) {
126125 const basename = document . fileName ? path . basename ( document . fileName ) : `Untitled` ;
127126 if ( isSafeDocument ( document ) ) {
128127 setCheckerRunningContext ( true ) ;
@@ -183,7 +182,7 @@ async function validateSqlDocument(document: TextDocument, specificStatement?: n
183182
184183 let syntaxChecked : SqlSyntaxError [ ] | undefined ;
185184 try {
186- syntaxChecked = await window . withProgress ( { location : ProgressLocation . Window , title : `$(sync-spin) Checking SQL Syntax` } , ( ) => { return checker . checkMultipleStatements ( sqlStatementContents ) } ) ;
185+ syntaxChecked = await window . withProgress ( { location : ProgressLocation . Window , title : `$(sync-spin) Checking SQL Syntax` } , ( ) => { return checker . checkMultipleStatements ( job , sqlStatementContents ) } ) ;
187186 } catch ( e ) {
188187 window . showErrorMessage ( `${ basename } : the SQL syntax checker failed to run. ${ e . message } ` ) ;
189188 syntaxChecked = undefined ;
0 commit comments