summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGeorge Fraser <george@fivetran.com>2018-12-23 17:19:09 -0800
committerGeorge Fraser <george@fivetran.com>2018-12-23 17:19:09 -0800
commit888fe5075feedaf427c66a06a68089b62672beed (patch)
treeac79a0ed51131cc82f4176d93abc11d88b34ad85 /lib
parentb6ad35a751145fb1e4b820d5ea11fc596a2d156d (diff)
downloadjava-language-server-888fe5075feedaf427c66a06a68089b62672beed.zip
Find references code lens, room for optimization
Diffstat (limited to 'lib')
-rw-r--r--lib/extension.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/extension.ts b/lib/extension.ts
index dc5c2fd..a735493 100644
--- a/lib/extension.ts
+++ b/lib/extension.ts
@@ -103,7 +103,8 @@ export function activate(context: ExtensionContext) {
context.subscriptions.push(disposable);
// Register test commands
- commands.registerCommand('java.command.test.run', runTest);
+ commands.registerCommand('java.command.test.run', runTest);
+ commands.registerCommand('java.command.findReferences', runFindReferences);
// When the language client activates, register a progress-listener
client.onReady().then(() => createProgressListeners(client));
@@ -177,6 +178,11 @@ function findJavaExecutableInJavaHome(javaHome: string, binname: string) {
export function deactivate() {
}
+function runFindReferences(uri: string, lineNumber: number, column: number) {
+ // LSP is 0-based but VSCode is 1-based
+ return commands.executeCommand('editor.action.findReferences', Uri.parse(uri), {lineNumber: lineNumber+1, column: column+1});
+}
+
interface JavaTestTask extends TaskDefinition {
enclosingClass: string
method: string