aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/client.ts
diff options
context:
space:
mode:
authorTim <[email protected]>2020-03-30 18:12:22 +0100
committerTim Hutt <[email protected]>2020-03-30 21:23:21 +0100
commit768aa4259fce15f313042892739ed4d8b7e518b4 (patch)
treef50618675b04ea7d29490fc942fb6cde6b3c161a /editors/code/src/client.ts
parent671926ac93f0ff921758a919eaf87c056979189f (diff)
Add basic task support
This adds basic support for running `cargo build`, `cargo run`, etc.
Diffstat (limited to 'editors/code/src/client.ts')
-rw-r--r--editors/code/src/client.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index d72ecc58f..c9819e457 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -30,15 +30,14 @@ export function configToServerOptions(config: Config) {
30 }; 30 };
31} 31}
32 32
33export async function createClient(config: Config, serverPath: string): Promise<lc.LanguageClient> { 33export async function createClient(config: Config, serverPath: string, workspaceFolder: vscode.WorkspaceFolder | null): 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 const workspaceFolderPath = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? '.';
38 37
39 const run: lc.Executable = { 38 const run: lc.Executable = {
40 command: serverPath, 39 command: serverPath,
41 options: { cwd: workspaceFolderPath }, 40 options: { cwd: workspaceFolder?.uri.fsPath ?? '.' },
42 }; 41 };
43 const serverOptions: lc.ServerOptions = { 42 const serverOptions: lc.ServerOptions = {
44 run, 43 run,