@@ -3,7 +3,7 @@ import { remoteAssistIsEnabled } from "./logic/available";
3
3
import { getSqlDocument } from "./logic/parse" ;
4
4
5
5
class 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 [ ] } ) {
7
7
super ( title , kind ) ;
8
8
}
9
9
}
@@ -32,7 +32,7 @@ export const actionProvider = languages.registerCodeActionsProvider({ language:
32
32
const action = new SqlCodeAction ( `Generate bind statement` , CodeActionKind . QuickFix , {
33
33
document,
34
34
statementOffset : currentStatement . range . end ,
35
- bindCount : markers . length
35
+ names : markers . map ( marker => marker . named || `?` )
36
36
} ) ;
37
37
38
38
codeActions . push ( action ) ;
@@ -52,7 +52,7 @@ export const actionProvider = languages.registerCodeActionsProvider({ language:
52
52
const endOfStatementPos = document . positionAt ( codeAction . file . statementOffset ) ;
53
53
const lineOfStatement = document . lineAt ( endOfStatementPos . line ) ;
54
54
55
- let statement = `bind: ${ new Array ( codeAction . file . bindCount ) . fill ( `v` ) . join ( `, ` ) } ` ;
55
+ let statement = `bind: ${ codeAction . file . names . join ( `, ` ) } ` ;
56
56
57
57
codeAction . edit . insert ( document . uri , lineOfStatement . range . end , `\n${ statement } ;` ) ;
58
58
return codeAction ;
0 commit comments