diff --git a/editors/code/src/client.ts b/editors/code/src/client.ts index cb8beb343e..69dbe25353 100644 --- a/editors/code/src/client.ts +++ b/editors/code/src/client.ts @@ -33,7 +33,7 @@ export function createClient(serverPath: string, workspace: Workspace, extraEnv: Object.assign(newEnv, extraEnv); let cwd = undefined; - if (workspace.kind == "Workspace Folder") { + if (workspace.kind === "Workspace Folder") { cwd = workspace.folder.fsPath; }; @@ -50,7 +50,7 @@ export function createClient(serverPath: string, workspace: Workspace, extraEnv: ); let initializationOptions = vscode.workspace.getConfiguration("rust-analyzer"); - if (workspace.kind == "Detached files") { + if (workspace.kind === "Detached Files") { initializationOptions = { "detachedFiles": workspace.files.map(file => file.uri.fsPath), ...initializationOptions }; } diff --git a/editors/code/src/ctx.ts b/editors/code/src/ctx.ts index dbfb9c6a1d..22c5f62a1c 100644 --- a/editors/code/src/ctx.ts +++ b/editors/code/src/ctx.ts @@ -9,12 +9,12 @@ import { ServerStatusParams } from './lsp_ext'; export type Workspace = { - kind: 'Workspace Folder', - folder: vscode.Uri, + kind: 'Workspace Folder'; + folder: vscode.Uri; } | { - kind: 'Detached files', - files: vscode.TextDocument[], + kind: 'Detached Files'; + files: vscode.TextDocument[]; }; export class Ctx { diff --git a/editors/code/src/main.ts b/editors/code/src/main.ts index 1a4af548d3..b735186fe1 100644 --- a/editors/code/src/main.ts +++ b/editors/code/src/main.ts @@ -47,9 +47,9 @@ async function tryActivate(context: vscode.ExtensionContext) { const workspaceFolder = vscode.workspace.workspaceFolders?.[0]; if (workspaceFolder === undefined) { - let rustDocuments = vscode.workspace.textDocuments.filter(document => isRustDocument(document)); + const rustDocuments = vscode.workspace.textDocuments.filter(document => isRustDocument(document)); if (rustDocuments.length > 0) { - ctx = await Ctx.create(config, context, serverPath, { kind: 'Detached files', files: rustDocuments }); + ctx = await Ctx.create(config, context, serverPath, { kind: 'Detached Files', files: rustDocuments }); } else { throw new Error("no rust files are opened"); }