From 768aa4259fce15f313042892739ed4d8b7e518b4 Mon Sep 17 00:00:00 2001 From: Tim Date: Mon, 30 Mar 2020 18:12:22 +0100 Subject: Add basic task support This adds basic support for running `cargo build`, `cargo run`, etc. --- editors/code/src/client.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'editors/code/src/client.ts') 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) { }; } -export async function createClient(config: Config, serverPath: string): Promise { +export async function createClient(config: Config, serverPath: string, workspaceFolder: vscode.WorkspaceFolder | null): Promise { // '.' Is the fallback if no folder is open // TODO?: Workspace folders support Uri's (eg: file://test.txt). // It might be a good idea to test if the uri points to a file. - const workspaceFolderPath = vscode.workspace.workspaceFolders?.[0]?.uri.fsPath ?? '.'; const run: lc.Executable = { command: serverPath, - options: { cwd: workspaceFolderPath }, + options: { cwd: workspaceFolder?.uri.fsPath ?? '.' }, }; const serverOptions: lc.ServerOptions = { run, -- cgit v1.2.3