@@ -3,7 +3,7 @@ import { remoteAssistIsEnabled } from "./logic/available";
33import { getSqlDocument } from "./logic/parse" ;
44
55class SqlCodeAction extends CodeAction {
6- constructor ( title : string , kind : CodeActionKind , public file : { document : TextDocument , statementOffset : number , bindCount : number } ) {
6+ constructor ( title : string , kind : CodeActionKind , public file : { document : TextDocument , statementOffset : number , names : string [ ] } ) {
77 super ( title , kind ) ;
88 }
99}
@@ -32,7 +32,7 @@ export const actionProvider = languages.registerCodeActionsProvider({ language:
3232 const action = new SqlCodeAction ( `Generate bind statement` , CodeActionKind . QuickFix , {
3333 document,
3434 statementOffset : currentStatement . range . end ,
35- bindCount : markers . length
35+ names : markers . map ( marker => marker . named || `?` )
3636 } ) ;
3737
3838 codeActions . push ( action ) ;
@@ -52,7 +52,7 @@ export const actionProvider = languages.registerCodeActionsProvider({ language:
5252 const endOfStatementPos = document . positionAt ( codeAction . file . statementOffset ) ;
5353 const lineOfStatement = document . lineAt ( endOfStatementPos . line ) ;
5454
55- let statement = `bind: ${ new Array ( codeAction . file . bindCount ) . fill ( `v` ) . join ( `, ` ) } ` ;
55+ let statement = `bind: ${ codeAction . file . names . join ( `, ` ) } ` ;
5656
5757 codeAction . edit . insert ( document . uri , lineOfStatement . range . end , `\n${ statement } ;` ) ;
5858 return codeAction ;
0 commit comments