diff options
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 | } | ||