@@ -719,7 +719,7 @@ async function globalsOrRoutines(
719719}
720720
721721export async function onCompletion ( params : CompletionParams ) : Promise < CompletionItem [ ] | null > {
722- var result : CompletionItem [ ] = [ ] ;
722+ let result : CompletionItem [ ] = [ ] ;
723723 const doc = documents . get ( params . textDocument . uri ) ;
724724 if ( doc === undefined ) { return null ; }
725725 const parsed = await getParsedDocument ( params . textDocument . uri ) ;
@@ -729,14 +729,14 @@ export async function onCompletion(params: CompletionParams): Promise<Completion
729729 const prevline = doc . getText ( Range . create ( Position . create ( params . position . line , 0 ) , params . position ) ) ;
730730 const prevlineLower = prevline . toLowerCase ( ) ;
731731 const classregex = / ^ c l a s s [ ] + % ? [ \p{ L} \d ] + ( \. { 1 } [ \p{ L} \d ] + ) * + e x t e n d s [ ] + ( \( ( [ % ] ? [ \p{ L} \d ] + ( \. { 1 } [ \p{ L} \d ] + ) * , [ ] * ) * ) ? $ / iu;
732- var firsttwotokens = "" ;
732+ let firsttwotokens = "" ;
733733 if ( parsed [ params . position . line ] . length >= 2 ) {
734734 firsttwotokens = doc . getText ( Range . create (
735735 params . position . line , parsed [ params . position . line ] [ 0 ] . p ,
736736 params . position . line , parsed [ params . position . line ] [ 1 ] . p + parsed [ params . position . line ] [ 1 ] . c
737737 ) ) ;
738738 }
739- var thistoken : number = - 1 ;
739+ let thistoken : number = - 1 ;
740740 for ( let i = 0 ; i < parsed [ params . position . line ] . length ; i ++ ) {
741741 const symbolstart : number = parsed [ params . position . line ] [ i ] . p ;
742742 const symbolend : number = parsed [ params . position . line ] [ i ] . p + parsed [ params . position . line ] [ i ] . c ;
@@ -775,7 +775,6 @@ export async function onCompletion(params: CompletionParams): Promise<Completion
775775 const settings = await getLanguageServerSettings ( params . textDocument . uri ) ;
776776 const asRegex = / \s + a s \s + $ / ;
777777 const parenAndCommaRegex = / [ , ( ] \s * $ / ;
778- const squareAndCommaRegex = / [ , [ ] \s * $ / ;
779778
780779 if ( prevline . endsWith ( "$$$" ) && [ ld . cos_langindex , ld . sql_langindex ] . includes ( triggerlang ) ) {
781780 // This is a macro
0 commit comments