aboutsummaryrefslogtreecommitdiff
path: root/editors/code
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code')
-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 0de45bb30..f909f8db2 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
33export async function createClient(config: Config, serverPath: string, workspaceFolder: vscode.WorkspaceFolder): Promise<lc.LanguageClient> { 33export async function createClient(config: Config, serverPath: string, cwd: string): 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 },
41 }; 41 };
42 const serverOptions: lc.ServerOptions = { 42 const serverOptions: lc.ServerOptions = {
43 run, 43 run,
diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts
index 255d57f5e..86b5f3629 100644
--- a/editors/code/src/ctx.ts
+++ b/editors/code/src/ctx.ts
@@ -19,9 +19,9 @@ export class Ctx {
19 config: Config, 19 config: Config,
20 extCtx: vscode.ExtensionContext, 20 extCtx: vscode.ExtensionContext,
21 serverPath: string, 21 serverPath: string,
22 workspaceFolder: vscode.WorkspaceFolder, 22 cwd: string,
23 ): Promise<Ctx> { 23 ): Promise<Ctx> {
24 const client = await createClient(config, serverPath, workspaceFolder); 24 const client = await createClient(config, serverPath, cwd);
25 const res = new Ctx(config, extCtx, client, serverPath); 25 const res = new Ctx(config, extCtx, client, serverPath);
26 res.pushCleanup(client.start()); 26 res.pushCleanup(client.start());
27 await client.onReady(); 27 await client.onReady();
diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts
index c1e2b97c3..7ba16120c 100644
--- a/editors/code/src/main.ts
+++ b/editors/code/src/main.ts
@@ -53,7 +53,7 @@ export async function activate(context: vscode.ExtensionContext) {
53 // registers its `onDidChangeDocument` handler before us. 53 // registers its `onDidChangeDocument` handler before us.
54 // 54 //
55 // This a horribly, horribly wrong way to deal with this problem. 55 // This a horribly, horribly wrong way to deal with this problem.
56 ctx = await Ctx.create(config, context, serverPath, workspaceFolder); 56 ctx = await Ctx.create(config, context, serverPath, workspaceFolder.uri.fsPath);
57 57
58 // Commands which invokes manually via command palette, shortcut, etc. 58 // Commands which invokes manually via command palette, shortcut, etc.
59 59