diff options
author | Tim <[email protected]> | 2020-03-31 09:05:22 +0100 |
---|---|---|
committer | Tim Hutt <[email protected]> | 2020-03-31 09:06:52 +0100 |
commit | a781a58fe2cefefbf9bf505247df78fd750a8f13 (patch) | |
tree | b0a332117f094a98ca9818bb1da53df2a29f3262 /editors/code/src/client.ts | |
parent | 6e535915bda524de34f011f75067132e88a3a3cc (diff) |
Throw error if no folder is opened
Diffstat (limited to 'editors/code/src/client.ts')
-rw-r--r-- | editors/code/src/client.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index c9819e457..0de45bb30 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts | |||
@@ -30,14 +30,14 @@ export function configToServerOptions(config: Config) { | |||
30 | }; | 30 | }; |
31 | } | 31 | } |
32 | 32 | ||
33 | export async function createClient(config: Config, serverPath: string, workspaceFolder: vscode.WorkspaceFolder | null): Promise<lc.LanguageClient> { | 33 | export async function createClient(config: Config, serverPath: string, workspaceFolder: vscode.WorkspaceFolder): Promise<lc.LanguageClient> { |
34 | // '.' Is the fallback if no folder is open | 34 | // '.' Is the fallback if no folder is open |
35 | // TODO?: Workspace folders support Uri's (eg: file://test.txt). | 35 | // TODO?: Workspace folders support Uri's (eg: file://test.txt). |
36 | // It might be a good idea to test if the uri points to a file. | 36 | // It might be a good idea to test if the uri points to a file. |
37 | 37 | ||
38 | const run: lc.Executable = { | 38 | const run: lc.Executable = { |
39 | command: serverPath, | 39 | command: serverPath, |
40 | options: { cwd: workspaceFolder?.uri.fsPath ?? '.' }, | 40 | options: { cwd: workspaceFolder.uri.fsPath }, |
41 | }; | 41 | }; |
42 | const serverOptions: lc.ServerOptions = { | 42 | const serverOptions: lc.ServerOptions = { |
43 | run, | 43 | run, |