diff options
author | Galilée 'Bill' Enguehard <[email protected]> | 2020-05-21 22:27:38 +0100 |
---|---|---|
committer | Galilée 'Bill' Enguehard <[email protected]> | 2020-05-21 22:27:38 +0100 |
commit | 7fece3bdd2450c0807f7dd742239cae95f0cc65e (patch) | |
tree | 866c4db826c959e79c63a6727bdb9f2c61e6fc4f /editors/code/src/main.ts | |
parent | db926218b2082077750291f8426ddd28b284cd08 (diff) | |
parent | 59732df8d40dfadc6dcf5951265416576399712a (diff) |
Merge branch 'master' of github.com:rust-analyzer/rust-analyzer into modname_spacing
Diffstat (limited to 'editors/code/src/main.ts')
-rw-r--r-- | editors/code/src/main.ts | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index efd56a84b..8b0a9d870 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts | |||
@@ -8,10 +8,9 @@ import { activateInlayHints } from './inlay_hints'; | |||
8 | import { activateStatusDisplay } from './status_display'; | 8 | import { activateStatusDisplay } from './status_display'; |
9 | import { Ctx } from './ctx'; | 9 | import { Ctx } from './ctx'; |
10 | import { Config, NIGHTLY_TAG } from './config'; | 10 | import { Config, NIGHTLY_TAG } from './config'; |
11 | import { log, assert } from './util'; | 11 | import { log, assert, isValidExecutable } from './util'; |
12 | import { PersistentState } from './persistent_state'; | 12 | import { PersistentState } from './persistent_state'; |
13 | import { fetchRelease, download } from './net'; | 13 | import { fetchRelease, download } from './net'; |
14 | import { spawnSync } from 'child_process'; | ||
15 | import { activateTaskProvider } from './tasks'; | 14 | import { activateTaskProvider } from './tasks'; |
16 | 15 | ||
17 | let ctx: Ctx | undefined; | 16 | let ctx: Ctx | undefined; |
@@ -78,6 +77,8 @@ export async function activate(context: vscode.ExtensionContext) { | |||
78 | ctx.registerCommand('syntaxTree', commands.syntaxTree); | 77 | ctx.registerCommand('syntaxTree', commands.syntaxTree); |
79 | ctx.registerCommand('expandMacro', commands.expandMacro); | 78 | ctx.registerCommand('expandMacro', commands.expandMacro); |
80 | ctx.registerCommand('run', commands.run); | 79 | ctx.registerCommand('run', commands.run); |
80 | ctx.registerCommand('debug', commands.debug); | ||
81 | ctx.registerCommand('newDebugConfig', commands.newDebugConfig); | ||
81 | 82 | ||
82 | defaultOnEnter.dispose(); | 83 | defaultOnEnter.dispose(); |
83 | ctx.registerCommand('onEnter', commands.onEnter); | 84 | ctx.registerCommand('onEnter', commands.onEnter); |
@@ -90,6 +91,7 @@ export async function activate(context: vscode.ExtensionContext) { | |||
90 | ctx.registerCommand('debugSingle', commands.debugSingle); | 91 | ctx.registerCommand('debugSingle', commands.debugSingle); |
91 | ctx.registerCommand('showReferences', commands.showReferences); | 92 | ctx.registerCommand('showReferences', commands.showReferences); |
92 | ctx.registerCommand('applySourceChange', commands.applySourceChange); | 93 | ctx.registerCommand('applySourceChange', commands.applySourceChange); |
94 | ctx.registerCommand('applySnippetWorkspaceEdit', commands.applySnippetWorkspaceEditCommand); | ||
93 | ctx.registerCommand('selectAndApplySourceChange', commands.selectAndApplySourceChange); | 95 | ctx.registerCommand('selectAndApplySourceChange', commands.selectAndApplySourceChange); |
94 | 96 | ||
95 | ctx.pushCleanup(activateTaskProvider(workspaceFolder)); | 97 | ctx.pushCleanup(activateTaskProvider(workspaceFolder)); |
@@ -179,10 +181,7 @@ async function bootstrapServer(config: Config, state: PersistentState): Promise< | |||
179 | 181 | ||
180 | log.debug("Using server binary at", path); | 182 | log.debug("Using server binary at", path); |
181 | 183 | ||
182 | const res = spawnSync(path, ["--version"], { encoding: 'utf8' }); | 184 | if (!isValidExecutable(path)) { |
183 | log.debug("Checked binary availability via --version", res); | ||
184 | log.debug(res, "--version output:", res.output); | ||
185 | if (res.status !== 0) { | ||
186 | throw new Error(`Failed to execute ${path} --version`); | 185 | throw new Error(`Failed to execute ${path} --version`); |
187 | } | 186 | } |
188 | 187 | ||