Skip to content

Commit

Permalink
feat(cmds): matchingBrace extension
Browse files Browse the repository at this point in the history
  • Loading branch information
fannheyward committed May 25, 2020
1 parent c47c988 commit ad3656e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/cmds/matching_brace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
6 changes: 3 additions & 3 deletions src/rust-analyzer-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ export interface ExpandedMacro {
}
export const expandMacro = request<ExpandMacroParams, Option<ExpandedMacro>>('expandMacro');

export interface FindMatchingBraceParams {
export interface MatchingBraceParams {
textDocument: TextDocumentIdentifier;
offsets: Vec<Position>;
positions: Position[];
}
export const findMatchingBrace = request<FindMatchingBraceParams, Vec<Position>>('findMatchingBrace');
export const matchingBrace = new RequestType<MatchingBraceParams, Position[], unknown>('experimental/matchingBrace');

export interface PublishDecorationsParams {
uri: string;
Expand Down

0 comments on commit ad3656e

Please sign in to comment.