@@ -81,17 +81,20 @@ export async function quickFixInvocation(request: SidecarQuickFixInvocationReque
81
81
export async function quickFixList ( request : SidecarQuickFixRequest ) : Promise < SidecarQuickFixResponse > {
82
82
const textDocumentUri = vscode . Uri . file ( request . fs_file_path ) ;
83
83
const requestId = request . request_id ;
84
+ const startPosition = request . range . startPosition ;
85
+ const endPosition = request . range . endPosition ;
86
+ const quickFixRange = new vscode . Range ( new vscode . Position ( startPosition . line , startPosition . character ) , new vscode . Position ( endPosition . line , endPosition . character ) ) ;
84
87
await vscode . workspace . openTextDocument ( textDocumentUri ) ;
85
88
const codeActions : vscode . CodeAction [ ] = await vscode . commands . executeCommand (
86
89
'vscode.executeCodeActionProvider' ,
87
90
textDocumentUri ,
88
- request . range ,
91
+ quickFixRange ,
89
92
) ;
90
93
const actionsFlattened : { label : string ; arguments : any ; command : string ; id : number } [ ] = [ ] ;
91
94
let actionIndex = 0 ;
92
95
// Over here try to get all the code actions which we need to execute
93
96
codeActions . forEach ( ( codeAction ) => {
94
- if ( codeAction . command ?. command === 'rust-analyzer.resolveCodeAction ' ) {
97
+ if ( codeAction . command ?. command === 'rust-analyzer.applyActionGroup ' ) {
95
98
// This means there are multiple commands in there, so we have to add it
96
99
// to the flattened list
97
100
const commandPossibleArguments = codeAction . command . arguments ?? [ ] ;
@@ -107,9 +110,11 @@ export async function quickFixList(request: SidecarQuickFixRequest): Promise<Sid
107
110
}
108
111
} else {
109
112
const actionCommand = codeAction . command ;
113
+ console . log ( 'whats the command over here' ) ;
114
+ console . log ( actionCommand ) ;
110
115
if ( actionCommand !== undefined ) {
111
116
actionsFlattened . push ( {
112
- label : codeAction . title ,
117
+ label : actionCommand . title ,
113
118
command : actionCommand . command ,
114
119
arguments : actionCommand . arguments ,
115
120
id : actionIndex ,
@@ -118,6 +123,9 @@ export async function quickFixList(request: SidecarQuickFixRequest): Promise<Sid
118
123
}
119
124
}
120
125
} ) ;
126
+ console . log ( 'actions' ) ;
127
+ console . log ( actionsFlattened ) ;
128
+ console . log ( 'actions list' ) ;
121
129
QUICK_FIX_LIST . insertForRequestId ( requestId , actionsFlattened ) ;
122
130
return {
123
131
options : actionsFlattened . map ( ( action ) => {
0 commit comments