diff options
author | Veetaha <[email protected]> | 2020-02-24 22:56:57 +0000 |
---|---|---|
committer | Veetaha <[email protected]> | 2020-02-24 22:56:57 +0000 |
commit | 9ea63d5a86b8217c25f0db49a535105b345ceae1 (patch) | |
tree | b4388333f2ee11da375959c855a73b6bdbb5815f | |
parent | 8a8a4d08ef6c695cce04f5e306fad83cc9abddcd (diff) |
vscode: migrate ssr to rust-analyzer-api.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..63c36ce80 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 | } | ||