Skip to content

Commit 8e14cb0

Browse files
committed
show references
1 parent 298ebb6 commit 8e14cb0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/extension.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ export function activate(context: vscode.ExtensionContext) {
3434
// }, null, savedContext.subscriptions);
3535

3636
vscode.commands.registerCommand("emmy.restartServer", restartServer);
37+
vscode.commands.registerCommand("emmy.showReferences", showReferences);
3738
}
3839

3940
// this method is called when your extension is deactivated
@@ -129,6 +130,14 @@ function restartServer() {
129130
}
130131
}
131132

133+
function showReferences(uri: string, pos: vscode.Position) {
134+
let u = vscode.Uri.parse(uri);
135+
let p = new vscode.Position(pos.line, pos.character);
136+
vscode.commands.executeCommand("vscode.executeReferenceProvider", u, p).then(locations => {
137+
vscode.commands.executeCommand("editor.action.showReferences", u, p, locations);
138+
});
139+
}
140+
132141
function stopServer() {
133142
if (client) {
134143
client.stop();

0 commit comments

Comments
 (0)