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(
2424}
2525
2626export async function getFixAllResponse (
27- data : LSPAny ,
27+ data : RoslynProtocol . CodeActionResolveData ,
2828 languageServer : RoslynLanguageServer ,
2929 outputChannel : vscode . OutputChannel
3030) {
31+ if ( ! data . FixAllFlavors ) {
32+ throw new Error ( `FixAllFlavors is missing from data ${ JSON . stringify ( data ) } ` ) ;
33+ }
34+
3135 const result = await vscode . window . showQuickPick ( data . FixAllFlavors , {
3236 placeHolder : vscode . l10n . t ( 'Pick a fix all scope' ) ,
3337 } ) ;
@@ -41,7 +45,7 @@ export async function getFixAllResponse(
4145 async ( _ , token ) => {
4246 if ( result ) {
4347 const fixAllCodeAction : RoslynProtocol . RoslynFixAllCodeAction = {
44- title : data . title ,
48+ title : data . UniqueIdentifier ,
4549 data : data ,
4650 scope : result ,
4751 } ;
@@ -71,7 +75,7 @@ export async function getFixAllResponse(
7175
7276async function registerFixAllResolveCodeAction (
7377 languageServer : RoslynLanguageServer ,
74- codeActionData : any ,
78+ codeActionData : RoslynProtocol . CodeActionResolveData ,
7579 outputChannel : vscode . OutputChannel
7680) {
7781 if ( codeActionData ) {
Original file line number Diff line number Diff line change @@ -188,6 +188,15 @@ export interface RoslynFixAllCodeAction extends CodeAction {
188188 scope : string ;
189189}
190190
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+
191200export interface NamedPipeInformation {
192201 pipeName : string ;
193202}
You can’t perform that action at this time.
0 commit comments