about summary refs log tree commit diff
path: root/editors/code/src
diff options
context:
space:
mode:
authorTim <tdhutt@gmail.com>2020-03-31 10:23:18 +0100
committerTim Hutt <timh@graphcore.ai>2020-03-31 10:24:01 +0100
commit3eb45b99223ae6a708d82c52d656c697bc993c3b (patch)
tree4dfb02c7d39debea0486f96a0fdccb3a288b70b3 /editors/code/src
parent9ef1e9efc6039c9299cbb866118ff92cb4467202 (diff)
downloadrust-3eb45b99223ae6a708d82c52d656c697bc993c3b.tar.gz
rust-3eb45b99223ae6a708d82c52d656c697bc993c3b.zip
Pass string instread of WorkspaceFolder
Diffstat (limited to 'editors/code/src')
-rw-r--r--editors/code/src/client.ts4
-rw-r--r--editors/code/src/ctx.ts4
-rw-r--r--editors/code/src/main.ts2
3 files changed, 5 insertions, 5 deletions
diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts
index 0de45bb3040..f909f8db26b 100644
--- a/editors/code/src/client.ts
+++ b/editors/code/src/client.ts
@@ -30,14 +30,14 @@ export function configToServerOptions(config: Config) {
     };
 }
 
-export async function createClient(config: Config, serverPath: string, workspaceFolder: vscode.WorkspaceFolder): Promise<lc.LanguageClient> {
+export async function createClient(config: Config, serverPath: string, cwd: string): Promise<lc.LanguageClient> {
     // '.' 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 run: lc.Executable = {
         command: serverPath,
-        options: { cwd: workspaceFolder.uri.fsPath },
+        options: { cwd },
     };
     const serverOptions: lc.ServerOptions = {
         run,
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index 255d57f5e7e..86b5f362954 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -19,9 +19,9 @@ export class Ctx {
         config: Config,
         extCtx: vscode.ExtensionContext,
         serverPath: string,
-        workspaceFolder: vscode.WorkspaceFolder,
+        cwd: string,
     ): Promise<Ctx> {
-        const client = await createClient(config, serverPath, workspaceFolder);
+        const client = await createClient(config, serverPath, cwd);
         const res = new Ctx(config, extCtx, client, serverPath);
         res.pushCleanup(client.start());
         await client.onReady();
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index c1e2b97c334..7ba16120c3a 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -53,7 +53,7 @@ export async function activate(context: vscode.ExtensionContext) {
     // registers its `onDidChangeDocument` handler before us.
     //
     // This a horribly, horribly wrong way to deal with this problem.
-    ctx = await Ctx.create(config, context, serverPath, workspaceFolder);
+    ctx = await Ctx.create(config, context, serverPath, workspaceFolder.uri.fsPath);
 
     // Commands which invokes manually via command palette, shortcut, etc.