aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/commands/ssr.ts
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2020-05-25 11:17:40 +0100
committerGitHub <[email protected]>2020-05-25 11:17:40 +0100
commite4f91bfa578e57c1ef4be3343ebb4e8950e5dae6 (patch)
treecb0ab7180b97dfdf8347c15d6e445628f7802367 /editors/code/src/commands/ssr.ts
parent1527feb744c7911b6ca482554f0399d3ef0ebfdc (diff)
parent6058b8b0f6a24ad5b905d99d780a31b9e3d578d7 (diff)
Merge #4605
4605: Reorganize TypeScript r=matklad a=matklad bors r+ 🤖 Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'editors/code/src/commands/ssr.ts')
-rw-r--r--editors/code/src/commands/ssr.ts30
1 files changed, 0 insertions, 30 deletions
diff --git a/editors/code/src/commands/ssr.ts b/editors/code/src/commands/ssr.ts
deleted file mode 100644
index 5d40a64d2..000000000
--- a/editors/code/src/commands/ssr.ts
+++ /dev/null
@@ -1,30 +0,0 @@
1import * as vscode from 'vscode';
2import * as ra from "../rust-analyzer-api";
3
4import { Ctx, Cmd } from '../ctx';
5
6export function ssr(ctx: Ctx): Cmd {
7 return async () => {
8 const client = ctx.client;
9 if (!client) return;
10
11 const options: vscode.InputBoxOptions = {
12 value: "() ==>> ()",
13 prompt: "Enter request, for example 'Foo($a:expr) ==> Foo::new($a)' ",
14 validateInput: async (x: string) => {
15 try {
16 await client.sendRequest(ra.ssr, { query: x, parseOnly: true });
17 } catch (e) {
18 return e.toString();
19 }
20 return null;
21 }
22 };
23 const request = await vscode.window.showInputBox(options);
24 if (!request) return;
25
26 const edit = await client.sendRequest(ra.ssr, { query: request, parseOnly: false });
27
28 await vscode.workspace.applyEdit(client.protocol2CodeConverter.asWorkspaceEdit(edit));
29 };
30}