Skip to content

Commit 3eb45b9

Browse files
TimmmmTim Hutt
authored andcommitted
Pass string instread of WorkspaceFolder
1 parent 9ef1e9e commit 3eb45b9

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

editors/code/src/client.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,14 @@ export function configToServerOptions(config: Config) {
3030
};
3131
}
3232

33-
export async function createClient(config: Config, serverPath: string, workspaceFolder: vscode.WorkspaceFolder): Promise<lc.LanguageClient> {
33+
export async function createClient(config: Config, serverPath: string, cwd: string): Promise<lc.LanguageClient> {
3434
// '.' Is the fallback if no folder is open
3535
// TODO?: Workspace folders support Uri's (eg: file://test.txt).
3636
// It might be a good idea to test if the uri points to a file.
3737

3838
const run: lc.Executable = {
3939
command: serverPath,
40-
options: { cwd: workspaceFolder.uri.fsPath },
40+
options: { cwd },
4141
};
4242
const serverOptions: lc.ServerOptions = {
4343
run,

editors/code/src/ctx.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ export class Ctx {
1919
config: Config,
2020
extCtx: vscode.ExtensionContext,
2121
serverPath: string,
22-
workspaceFolder: vscode.WorkspaceFolder,
22+
cwd: string,
2323
): Promise<Ctx> {
24-
const client = await createClient(config, serverPath, workspaceFolder);
24+
const client = await createClient(config, serverPath, cwd);
2525
const res = new Ctx(config, extCtx, client, serverPath);
2626
res.pushCleanup(client.start());
2727
await client.onReady();

editors/code/src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export async function activate(context: vscode.ExtensionContext) {
5353
// registers its `onDidChangeDocument` handler before us.
5454
//
5555
// 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);
5757

5858
// Commands which invokes manually via command palette, shortcut, etc.
5959

0 commit comments

Comments
 (0)