Implement lens for impls and support resolving lenses.

This commit is contained in:
Jeremy Kolb 2019-02-01 08:44:23 -05:00 committed by kjeremy
parent 13a2bdb0a8
commit 6ac4cca6c1
4 changed files with 97 additions and 3 deletions

View file

@ -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