Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Commit ca24ad1

Browse files
committed
Pass CodeActionKind through our middleware to populate menus
1 parent e0c90b0 commit ca24ad1

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rust-analyzer/editors/code/src/client.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export function createClient(serverPath: string, cwd: string): lc.LanguageClient
6666
return Promise.resolve(null);
6767
});
6868
},
69-
// Using custom handling of CodeActions where each code action is resloved lazily
69+
// Using custom handling of CodeActions where each code action is resolved lazily
7070
// That's why we are not waiting for any command or edits
7171
async provideCodeActions(document: vscode.TextDocument, range: vscode.Range, context: vscode.CodeActionContext, token: vscode.CancellationToken, _next: lc.ProvideCodeActionsSignature) {
7272
const params: lc.CodeActionParams = {
@@ -87,7 +87,8 @@ export function createClient(serverPath: string, cwd: string): lc.LanguageClient
8787
continue;
8888
}
8989
assert(isCodeActionWithoutEditsAndCommands(item), "We don't expect edits or commands here");
90-
const action = new vscode.CodeAction(item.title);
90+
const kind = client.protocol2CodeConverter.asCodeActionKind((item as any).kind);
91+
const action = new vscode.CodeAction(item.title, kind);
9192
const group = (item as any).group;
9293
const id = (item as any).id;
9394
const resolveParams: ra.ResolveCodeActionParams = {
@@ -116,6 +117,7 @@ export function createClient(serverPath: string, cwd: string): lc.LanguageClient
116117
result[index] = items[0];
117118
} else {
118119
const action = new vscode.CodeAction(group);
120+
action.kind = items[0].kind;
119121
action.command = {
120122
command: "rust-analyzer.applyActionGroup",
121123
title: "",

0 commit comments

Comments
 (0)