File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -24,10 +24,14 @@ export function registerCodeActionFixAllCommands(
24
24
}
25
25
26
26
export async function getFixAllResponse (
27
- data : LSPAny ,
27
+ data : RoslynProtocol . CodeActionResolveData ,
28
28
languageServer : RoslynLanguageServer ,
29
29
outputChannel : vscode . OutputChannel
30
30
) {
31
+ if ( ! data . FixAllFlavors ) {
32
+ throw new Error ( `FixAllFlavors is missing from data ${ JSON . stringify ( data ) } ` ) ;
33
+ }
34
+
31
35
const result = await vscode . window . showQuickPick ( data . FixAllFlavors , {
32
36
placeHolder : vscode . l10n . t ( 'Pick a fix all scope' ) ,
33
37
} ) ;
@@ -41,7 +45,7 @@ export async function getFixAllResponse(
41
45
async ( _ , token ) => {
42
46
if ( result ) {
43
47
const fixAllCodeAction : RoslynProtocol . RoslynFixAllCodeAction = {
44
- title : data . title ,
48
+ title : data . UniqueIdentifier ,
45
49
data : data ,
46
50
scope : result ,
47
51
} ;
@@ -71,7 +75,7 @@ export async function getFixAllResponse(
71
75
72
76
async function registerFixAllResolveCodeAction (
73
77
languageServer : RoslynLanguageServer ,
74
- codeActionData : any ,
78
+ codeActionData : RoslynProtocol . CodeActionResolveData ,
75
79
outputChannel : vscode . OutputChannel
76
80
) {
77
81
if ( codeActionData ) {
Original file line number Diff line number Diff line change @@ -188,6 +188,15 @@ export interface RoslynFixAllCodeAction extends CodeAction {
188
188
scope : string ;
189
189
}
190
190
191
+ /**
192
+ * Should match the definition on the server side, but only the properties we require on the client side.
193
+ * https://github.com/dotnet/roslyn/blob/bd5c00e5e09de8564093f42d87fe49d4971f2e84/src/LanguageServer/Protocol/Handler/CodeActions/CodeActionResolveData.cs#L16C20-L16C41
194
+ */
195
+ export interface CodeActionResolveData {
196
+ UniqueIdentifier : string ;
197
+ FixAllFlavors ?: string [ ] ;
198
+ }
199
+
191
200
export interface NamedPipeInformation {
192
201
pipeName : string ;
193
202
}
You can’t perform that action at this time.
0 commit comments