aboutsummaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authorVeetaha <[email protected]>2020-02-24 22:56:57 +0000
committerVeetaha <[email protected]>2020-02-24 22:56:57 +0000
commit9ea63d5a86b8217c25f0db49a535105b345ceae1 (patch)
treeb4388333f2ee11da375959c855a73b6bdbb5815f /editors
parent8a8a4d08ef6c695cce04f5e306fad83cc9abddcd (diff)
vscode: migrate ssr to rust-analyzer-api.ts
Diffstat (limited to 'editors')
-rw-r--r--editors/code/src/commands/ssr.ts16
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 @@
1import { Ctx, Cmd } from '../ctx';
2import { applySourceChange, SourceChange } from '../source_change';
3import * as vscode from 'vscode'; 1import * as vscode from 'vscode';
2import * as ra from "../rust-analyzer-api";
3
4import { Ctx, Cmd } from '../ctx';
5import { applySourceChange } from '../source_change';
4 6
5export function ssr(ctx: Ctx): Cmd { 7export 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
34interface SsrRequest {
35 arg: string;
36}