aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands.ts
diff options
context:
space:
mode:
authorSahandevs <[email protected]>2021-02-07 18:22:32 +0000
committerSahandevs <[email protected]>2021-02-07 18:22:32 +0000
commit1bb4e973ffaffd78a01ba5abb90096d11a2ddb42 (patch)
treec11a44377dcca59d241c45ceb7ae89a06358d8fd /editors/code/src/commands.ts
parent1d0e93b58ee3a43881526c9405ca0120fe6ddb20 (diff)
handle Thenable type rejects
Diffstat (limited to 'editors/code/src/commands.ts')
-rw-r--r--editors/code/src/commands.ts15
1 files changed, 10 insertions, 5 deletions
diff --git a/editors/code/src/commands.ts b/editors/code/src/commands.ts
index cbda619ea..3469fe5ec 100644
--- a/editors/code/src/commands.ts
+++ b/editors/code/src/commands.ts
@@ -129,7 +129,8 @@ export function joinLines(ctx: Ctx): Cmd {
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 });
132 }); 132 })
133 .then(() => {}, console.error);
133 }; 134 };
134} 135}
135 136
@@ -246,7 +247,8 @@ export function ssr(ctx: Ctx): Cmd {
246 }); 247 });
247 248
248 await vscode.workspace.applyEdit(client.protocol2CodeConverter.asWorkspaceEdit(edit)); 249 await vscode.workspace.applyEdit(client.protocol2CodeConverter.asWorkspaceEdit(edit));
249 }); 250 })
251 .then(() => {}, console.error);
250 }; 252 };
251} 253}
252 254
@@ -465,7 +467,8 @@ export function showReferences(ctx: Ctx): Cmd {
465 vscode.Uri.parse(uri), 467 vscode.Uri.parse(uri),
466 client.protocol2CodeConverter.asPosition(position), 468 client.protocol2CodeConverter.asPosition(position),
467 locations.map(client.protocol2CodeConverter.asLocation), 469 locations.map(client.protocol2CodeConverter.asLocation),
468 ); 470 )
471 .then(() => {}, console.error);
469 } 472 }
470 }; 473 };
471} 474}
@@ -477,7 +480,8 @@ export function applyActionGroup(_ctx: Ctx): Cmd {
477 vscode.commands.executeCommand( 480 vscode.commands.executeCommand(
478 'rust-analyzer.resolveCodeAction', 481 'rust-analyzer.resolveCodeAction',
479 selectedAction.arguments, 482 selectedAction.arguments,
480 ); 483 )
484 .then(() => {}, console.error);
481 }; 485 };
482} 486}
483 487
@@ -510,7 +514,8 @@ export function openDocs(ctx: Ctx): Cmd {
510 const doclink = await client.sendRequest(ra.openDocs, { position, textDocument }); 514 const doclink = await client.sendRequest(ra.openDocs, { position, textDocument });
511 515
512 if (doclink != null) { 516 if (doclink != null) {
513 vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(doclink)); 517 vscode.commands.executeCommand("vscode.open", vscode.Uri.parse(doclink))
518 .then(() => {}, console.error);
514 } 519 }
515 }; 520 };
516 521