aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/commands.ts')
-rw-r--r--editors/code/src/commands.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index cbda619ea..3729a71de 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -125,7 +125,7 @@ export function joinLines(ctx: Ctx): Cmd {
125 ranges: editor.selections.map((it) => client.code2ProtocolConverter.asRange(it)), 125 ranges: editor.selections.map((it) => client.code2ProtocolConverter.asRange(it)),
126 textDocument: ctx.client.code2ProtocolConverter.asTextDocumentIdentifier(editor.document), 126 textDocument: ctx.client.code2ProtocolConverter.asTextDocumentIdentifier(editor.document),
127 }); 127 });
128 editor.edit((builder) => { 128 await editor.edit((builder) => {
129 client.protocol2CodeConverter.asTextEdits(items).forEach((edit: any) => { 129 client.protocol2CodeConverter.asTextEdits(items).forEach((edit: any) => {
130 builder.replace(edit.range, edit.newText); 130 builder.replace(edit.range, edit.newText);
131 }); 131 });
@@ -236,7 +236,7 @@ export function ssr(ctx: Ctx): Cmd {
236 const request = await vscode.window.showInputBox(options); 236 const request = await vscode.window.showInputBox(options);
237 if (!request) return; 237 if (!request) return;
238 238
239 vscode.window.withProgress({ 239 await vscode.window.withProgress({
240 location: vscode.ProgressLocation.Notification, 240 location: vscode.ProgressLocation.Notification,
241 title: "Structured search replace in progress...", 241 title: "Structured search replace in progress...",
242 cancellable: false, 242 cancellable: false,
@@ -457,10 +457,10 @@ export function reloadWorkspace(ctx: Ctx): Cmd {
457} 457}
458 458
459export function showReferences(ctx: Ctx): Cmd { 459export function showReferences(ctx: Ctx): Cmd {
460 return (uri: string, position: lc.Position, locations: lc.Location[]) => { 460 return async (uri: string, position: lc.Position, locations: lc.Location[]) => {
461 const client = ctx.client; 461 const client = ctx.client;
462 if (client) { 462 if (client) {
463 vscode.commands.executeCommand( 463 await vscode.commands.executeCommand(
464 'editor.action.showReferences', 464 'editor.action.showReferences',
465 vscode.Uri.parse(uri), 465 vscode.Uri.parse(uri),
466 client.protocol2CodeConverter.asPosition(position), 466 client.protocol2CodeConverter.asPosition(position),
@@ -474,7 +474,7 @@ export function applyActionGroup(_ctx: Ctx): Cmd {
474 return async (actions: { label: string; arguments: lc.CodeAction }[]) => { 474 return async (actions: { label: string; arguments: lc.CodeAction }[]) => {
475 const selectedAction = await vscode.window.showQuickPick(actions); 475 const selectedAction = await vscode.window.showQuickPick(actions);
476 if (!selectedAction) return; 476 if (!selectedAction) return;
477 vscode.commands.executeCommand( 477 await vscode.commands.executeCommand(
478 'rust-analyzer.resolveCodeAction', 478 'rust-analyzer.resolveCodeAction',
479 selectedAction.arguments, 479 selectedAction.arguments,
480 ); 480 );
@@ -510,7 +510,7 @@ export function openDocs(ctx: Ctx): Cmd {
510 const doclink = await client.sendRequest(ra.openDocs, { position, textDocument }); 510 const doclink = await client.sendRequest(ra.openDocs, { position, textDocument });
511 511
512 if (doclink != null) { 512 if (doclink != null) {
513 vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(doclink)); 513 await vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(doclink));
514 } 514 }
515 }; 515 };
516 516