From 4e48a73f9c342544e4eabd1c1cd31cdfb6a6e5e3 Mon Sep 17 00:00:00 2001 From: Edwin Cheng Date: Fri, 21 Feb 2020 10:04:03 +0800 Subject: Improve server version info --- editors/code/src/commands/index.ts | 1 + editors/code/src/commands/server_version.ts | 9 +++++++++ editors/code/src/main.ts | 1 + 3 files changed, 11 insertions(+) create mode 100644 editors/code/src/commands/server_version.ts (limited to 'editors/code/src') diff --git a/editors/code/src/commands/index.ts b/editors/code/src/commands/index.ts index bebd99ca9..839245f48 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 000000000..3a982a418 --- /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 a22e0bc66..de19a44e5 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); -- cgit v1.2.3