mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Refactor server lifecycle
This commit is contained in:
parent
0849f7001c
commit
087af54069
12 changed files with 216 additions and 199 deletions
|
@ -6,13 +6,14 @@ import { applySourceChange, SourceChange } from '../source_change';
|
|||
export function joinLines(ctx: Ctx): Cmd {
|
||||
return async () => {
|
||||
const editor = ctx.activeRustEditor;
|
||||
if (!editor) return;
|
||||
const client = ctx.client;
|
||||
if (!editor || !client) return;
|
||||
|
||||
const request: JoinLinesParams = {
|
||||
range: ctx.client.code2ProtocolConverter.asRange(editor.selection),
|
||||
range: client.code2ProtocolConverter.asRange(editor.selection),
|
||||
textDocument: { uri: editor.document.uri.toString() },
|
||||
};
|
||||
const change = await ctx.client.sendRequest<SourceChange>(
|
||||
const change = await client.sendRequest<SourceChange>(
|
||||
'rust-analyzer/joinLines',
|
||||
request,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue