From 79bc39ebe5aba1768821cf21b8782d1ac1e8792c Mon Sep 17 00:00:00 2001 From: tiger-eagle Date: Mon, 25 May 2020 18:33:22 +0800 Subject: [PATCH] feat(cmds): matchingBrace extension https://github.com/fannheyward/coc-rust-analyzer/issues/256 --- src/cmds/matching_brace.ts | 6 +++--- src/rust-analyzer-api.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/cmds/matching_brace.ts b/src/cmds/matching_brace.ts index d4c1101..d67fd1a 100644 --- a/src/cmds/matching_brace.ts +++ b/src/cmds/matching_brace.ts @@ -7,12 +7,12 @@ export function matchingBrace(ctx: Ctx): Cmd { const { document, position } = await workspace.getCurrentState(); if (!isRustDocument(document)) return; - const params: ra.FindMatchingBraceParams = { + const params: ra.MatchingBraceParams = { textDocument: { uri: document.uri }, - offsets: [position], + positions: [position], }; - const response = await ctx.client.sendRequest(ra.findMatchingBrace, params); + const response = await ctx.client.sendRequest(ra.matchingBrace, params); if (response.length > 0) { workspace.jumpTo(document.uri, response[0]); } diff --git a/src/rust-analyzer-api.ts b/src/rust-analyzer-api.ts index c9cf810..fae9221 100644 --- a/src/rust-analyzer-api.ts +++ b/src/rust-analyzer-api.ts @@ -45,11 +45,11 @@ export interface ExpandedMacro { } export const expandMacro = request>('expandMacro'); -export interface FindMatchingBraceParams { +export interface MatchingBraceParams { textDocument: TextDocumentIdentifier; - offsets: Vec; + positions: Position[]; } -export const findMatchingBrace = request>('findMatchingBrace'); +export const matchingBrace = new RequestType('experimental/matchingBrace'); export interface PublishDecorationsParams { uri: string;