about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorEdwin Cheng <edwin0cheng@gmail.com>2020-02-21 10:04:03 +0800
committerEdwin Cheng <edwin0cheng@gmail.com>2020-02-21 18:33:45 +0800
commit4e48a73f9c342544e4eabd1c1cd31cdfb6a6e5e3 (patch)
tree209de25b4853a596750d2963b2adec705db4efc0 /editors/code/src
parent88014fcec04721350abc156efb1e18889fca5255 (diff)
downloadrust-4e48a73f9c342544e4eabd1c1cd31cdfb6a6e5e3.tar.gz
rust-4e48a73f9c342544e4eabd1c1cd31cdfb6a6e5e3.zip
Improve server version info
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/commands/index.ts1
-rw-r--r--editors/code/src/commands/server_version.ts9
-rw-r--r--editors/code/src/main.ts1
3 files changed, 11 insertions, 0 deletions
diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts
index bebd99ca931..839245f4875 100644
--- a/editors/code/src/commands/index.ts
+++ b/editors/code/src/commands/index.ts
@@ -13,6 +13,7 @@ export * from './syntax_tree';
 export * from './expand_macro';
 export * from './runnables';
 export * from './ssr';
+export * from './server_version';
 
 export function collectGarbage(ctx: Ctx): Cmd {
     return async () => {
diff --git a/editors/code/src/commands/server_version.ts b/editors/code/src/commands/server_version.ts
new file mode 100644
index 00000000000..3a982a418a5
--- /dev/null
+++ b/editors/code/src/commands/server_version.ts
@@ -0,0 +1,9 @@
+import * as vscode from 'vscode';
+import { ServerVersion } from '../installation/server';
+import { Cmd } from '../ctx';
+
+export function serverVersion(): Cmd {
+    return () => {
+        vscode.window.showInformationMessage('rust-analyzer version : ' + ServerVersion);
+    };
+}
\ No newline at end of file
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index a22e0bc6660..de19a44e517 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -55,6 +55,7 @@ export async function activate(context: vscode.ExtensionContext) {
     ctx.registerCommand('run', commands.run);
     ctx.registerCommand('onEnter', commands.onEnter);
     ctx.registerCommand('ssr', commands.ssr);
+    ctx.registerCommand('serverVersion', commands.serverVersion);
 
     // Internal commands which are invoked by the server.
     ctx.registerCommand('runSingle', commands.runSingle);