Skip to content

Commit

Permalink
feat(cmds): ssr extension
Browse files Browse the repository at this point in the history
  • Loading branch information
fannheyward committed May 25, 2020
1 parent b3b32ee commit c47c988
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/cmds/ssr.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { workspace } from 'coc.nvim';
import { Cmd, Ctx } from '../ctx';
import * as ra from '../rust-analyzer-api';
import { applySourceChange } from '../source_change';

export function ssr(ctx: Ctx): Cmd {
return async () => {
Expand All @@ -20,7 +19,7 @@ export function ssr(ctx: Ctx): Cmd {
parseOnly: false,
};

const change = await ctx.client.sendRequest(ra.ssr, param);
await applySourceChange(change);
const edit = await ctx.client.sendRequest(ra.ssr, param);
await workspace.applyEdit(edit);
};
}
2 changes: 1 addition & 1 deletion src/rust-analyzer-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export interface SsrParams {
query: string;
parseOnly: boolean;
}
export const ssr = request<SsrParams, SourceChange>('ssr');
export const ssr = new RequestType<SsrParams, WorkspaceEdit, unknown>('experimental/ssr');

export const publishDecorations = notification<PublishDecorationsParams>('publishDecorations');

Expand Down

0 comments on commit c47c988

Please sign in to comment.