diff options
| author | Edwin Cheng <edwin0cheng@gmail.com> | 2020-02-21 10:04:03 +0800 |
|---|---|---|
| committer | Edwin Cheng <edwin0cheng@gmail.com> | 2020-02-21 18:33:45 +0800 |
| commit | 4e48a73f9c342544e4eabd1c1cd31cdfb6a6e5e3 (patch) | |
| tree | 209de25b4853a596750d2963b2adec705db4efc0 /editors/code/src | |
| parent | 88014fcec04721350abc156efb1e18889fca5255 (diff) | |
| download | rust-4e48a73f9c342544e4eabd1c1cd31cdfb6a6e5e3.tar.gz rust-4e48a73f9c342544e4eabd1c1cd31cdfb6a6e5e3.zip | |
Improve server version info
Diffstat (limited to 'editors/code/src')
| -rw-r--r-- | editors/code/src/commands/index.ts | 1 | ||||
| -rw-r--r-- | editors/code/src/commands/server_version.ts | 9 | ||||
| -rw-r--r-- | editors/code/src/main.ts | 1 |
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); |
