From 6ac4cca6c1fc188ae0fda62fb81a9855a51b7530 Mon Sep 17 00:00:00 2001 From: Jeremy Kolb Date: Fri, 1 Feb 2019 08:44:23 -0500 Subject: Implement lens for impls and support resolving lenses. --- editors/code/src/extension.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'editors/code/src/extension.ts') diff --git a/editors/code/src/extension.ts b/editors/code/src/extension.ts index 0b2a6095b..a0be70202 100644 --- a/editors/code/src/extension.ts +++ b/editors/code/src/extension.ts @@ -70,6 +70,18 @@ export function activate(context: vscode.ExtensionContext) { 'rust-analyzer.applySourceChange', commands.applySourceChange.handle ); + registerCommand( + 'rust-analyzer.showReferences', + (uri: string, position: lc.Position, locations: lc.Location[]) => { + vscode.commands.executeCommand( + 'editor.action.showReferences', + vscode.Uri.parse(uri), + Server.client.protocol2CodeConverter.asPosition(position), + locations.map(Server.client.protocol2CodeConverter.asLocation) + ); + } + ); + overrideCommand('type', commands.onEnter.handle); // Notifications are events triggered by the language server -- cgit v1.2.3