From c0dbf9da45f22a3399f19992fefefb0f666dfbcc Mon Sep 17 00:00:00 2001 From: Mark IJbema Date: Mon, 16 Feb 2026 12:53:33 +0100 Subject: [PATCH] refactor(vscode): remove redundant hasWorkspace flag from FileIgnoreController --- .../autocomplete/shims/FileIgnoreController.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/packages/kilo-vscode/src/services/autocomplete/shims/FileIgnoreController.ts b/packages/kilo-vscode/src/services/autocomplete/shims/FileIgnoreController.ts index 8dec80d11..c314aacaf 100644 --- a/packages/kilo-vscode/src/services/autocomplete/shims/FileIgnoreController.ts +++ b/packages/kilo-vscode/src/services/autocomplete/shims/FileIgnoreController.ts @@ -15,22 +15,20 @@ function toPosix(filePath: string): string { } export class FileIgnoreController { - private readonly hasWorkspace: boolean private workspacePath: string private ignoreInstance: Ignore = ignore() private loadedContents: Array<{ file: string; content: string }> = [] private readonly realpathCache = new Map() constructor(workspacePath?: string) { - this.hasWorkspace = Boolean(workspacePath) - this.workspacePath = this.hasWorkspace ? path.resolve(workspacePath!) : "" + this.workspacePath = workspacePath ? path.resolve(workspacePath) : "" } async initialize(): Promise { this.ignoreInstance = ignore() this.loadedContents = [] - if (!this.hasWorkspace) { + if (!this.workspacePath) { return } @@ -101,7 +99,7 @@ export class FileIgnoreController { * When no workspace path was provided, denies all access. */ validateAccess(filePath: string): boolean { - if (!this.hasWorkspace) { + if (!this.workspacePath) { return false } @@ -119,7 +117,7 @@ export class FileIgnoreController { * When no workspace path was provided, returns an empty array. */ filterPaths(paths: string[]): string[] { - if (!this.hasWorkspace) { + if (!this.workspacePath) { return [] } return paths.filter((candidate) => this.validateAccess(candidate))