diff options
Diffstat (limited to 'editors/code/src/commands/ssr.ts')
-rw-r--r-- | editors/code/src/commands/ssr.ts | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/editors/code/src/commands/ssr.ts b/editors/code/src/commands/ssr.ts index 9b814612a..eee48c693 100644 --- a/editors/code/src/commands/ssr.ts +++ b/editors/code/src/commands/ssr.ts | |||
@@ -1,6 +1,8 @@ | |||
1 | import { Ctx, Cmd } from '../ctx'; | ||
2 | import { applySourceChange, SourceChange } from '../source_change'; | ||
3 | import * as vscode from 'vscode'; | 1 | import * as vscode from 'vscode'; |
2 | import * as ra from "../rust-analyzer-api"; | ||
3 | |||
4 | import { Ctx, Cmd } from '../ctx'; | ||
5 | import { applySourceChange } from '../source_change'; | ||
4 | 6 | ||
5 | export function ssr(ctx: Ctx): Cmd { | 7 | export function ssr(ctx: Ctx): Cmd { |
6 | return async () => { | 8 | return async () => { |
@@ -21,16 +23,8 @@ export function ssr(ctx: Ctx): Cmd { | |||
21 | 23 | ||
22 | if (!request) return; | 24 | if (!request) return; |
23 | 25 | ||
24 | const ssrRequest: SsrRequest = { arg: request }; | 26 | const change = await client.sendRequest(ra.ssr, { arg: request }); |
25 | const change = await client.sendRequest<SourceChange>( | ||
26 | 'rust-analyzer/ssr', | ||
27 | ssrRequest, | ||
28 | ); | ||
29 | 27 | ||
30 | await applySourceChange(ctx, change); | 28 | await applySourceChange(ctx, change); |
31 | }; | 29 | }; |
32 | } | 30 | } |
33 | |||
34 | interface SsrRequest { | ||
35 | arg: string; | ||
36 | } | ||