diff options
Diffstat (limited to 'editors/code/src/client.ts')
-rw-r--r-- | editors/code/src/client.ts | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index 11894973c..aaf2ef40e 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts | |||
@@ -2,18 +2,14 @@ import * as lc from 'vscode-languageclient'; | |||
2 | import * as vscode from 'vscode'; | 2 | import * as vscode from 'vscode'; |
3 | 3 | ||
4 | import { Config } from './config'; | 4 | import { Config } from './config'; |
5 | import { ensureServerBinary } from './installation/server'; | ||
6 | import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; | 5 | import { CallHierarchyFeature } from 'vscode-languageclient/lib/callHierarchy.proposed'; |
7 | 6 | ||
8 | export async function createClient(config: Config): Promise<null | lc.LanguageClient> { | 7 | export async function createClient(config: Config, serverPath: string): Promise<lc.LanguageClient> { |
9 | // '.' Is the fallback if no folder is open | 8 | // '.' Is the fallback if no folder is open |
10 | // TODO?: Workspace folders support Uri's (eg: file://test.txt). | 9 | // TODO?: Workspace folders support Uri's (eg: file://test.txt). |
11 | // It might be a good idea to test if the uri points to a file. | 10 | // It might be a good idea to test if the uri points to a file. |
12 | const workspaceFolderPath = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? '.'; | 11 | const workspaceFolderPath = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? '.'; |
13 | 12 | ||
14 | const serverPath = await ensureServerBinary(config.serverSource); | ||
15 | if (!serverPath) return null; | ||
16 | |||
17 | const run: lc.Executable = { | 13 | const run: lc.Executable = { |
18 | command: serverPath, | 14 | command: serverPath, |
19 | options: { cwd: workspaceFolderPath }, | 15 | options: { cwd: workspaceFolderPath }, |