diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-05-25 11:17:40 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-05-25 11:17:40 +0100 |
commit | e4f91bfa578e57c1ef4be3343ebb4e8950e5dae6 (patch) | |
tree | cb0ab7180b97dfdf8347c15d6e445628f7802367 /editors/code/src/commands/ssr.ts | |
parent | 1527feb744c7911b6ca482554f0399d3ef0ebfdc (diff) | |
parent | 6058b8b0f6a24ad5b905d99d780a31b9e3d578d7 (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.ts | 30 |
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 @@ | |||
1 | import * as vscode from 'vscode'; | ||
2 | import * as ra from "../rust-analyzer-api"; | ||
3 | |||
4 | import { Ctx, Cmd } from '../ctx'; | ||
5 | |||
6 | export 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 | } | ||