From 934227361623b258d833be20e464e1509cb432ad Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sun, 24 May 2020 16:18:46 +0200 Subject: Document matchingBrace LSP request --- editors/code/src/commands/matching_brace.ts | 4 ++-- editors/code/src/rust-analyzer-api.ts | 7 +++---- 2 files changed, 5 insertions(+), 6 deletions(-) (limited to 'editors') diff --git a/editors/code/src/commands/matching_brace.ts b/editors/code/src/commands/matching_brace.ts index a60776e2d..9c418b887 100644 --- a/editors/code/src/commands/matching_brace.ts +++ b/editors/code/src/commands/matching_brace.ts @@ -9,9 +9,9 @@ export function matchingBrace(ctx: Ctx): Cmd { const client = ctx.client; if (!editor || !client) return; - const response = await client.sendRequest(ra.findMatchingBrace, { + const response = await client.sendRequest(ra.matchingBrace, { textDocument: { uri: editor.document.uri.toString() }, - offsets: editor.selections.map(s => + positions: editor.selections.map(s => client.code2ProtocolConverter.asPosition(s.active), ), }); diff --git a/editors/code/src/rust-analyzer-api.ts b/editors/code/src/rust-analyzer-api.ts index 73f36432f..900c5cd5b 100644 --- a/editors/code/src/rust-analyzer-api.ts +++ b/editors/code/src/rust-analyzer-api.ts @@ -40,12 +40,11 @@ export interface ExpandedMacro { export const expandMacro = request>("expandMacro"); -export interface FindMatchingBraceParams { +export interface MatchingBraceParams { textDocument: lc.TextDocumentIdentifier; - offsets: Vec; + positions: lc.Position[]; } -export const findMatchingBrace = request>("findMatchingBrace"); - +export const matchingBrace = new lc.RequestType('experimental/matchingBrace'); export interface PublishDecorationsParams { uri: string; -- cgit v1.2.3