From 8e4ab703c8ccba9b8e979a0c1fc0cbd41c3a0350 Mon Sep 17 00:00:00 2001 From: Evan Date: Fri, 31 Jan 2025 16:57:24 -0800 Subject: [PATCH] wip --- .../llm-access-control/LLMFileAccessController.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/services/llm-access-control/LLMFileAccessController.ts b/src/services/llm-access-control/LLMFileAccessController.ts index 5410e8c823..298bfc08eb 100644 --- a/src/services/llm-access-control/LLMFileAccessController.ts +++ b/src/services/llm-access-control/LLMFileAccessController.ts @@ -2,6 +2,7 @@ import path from "path" import { fileExistsAtPath } from "../../utils/fs" import fs from "fs/promises" import ignore, { Ignore } from "ignore" +import * as vscode from "vscode" /** * Controls LLM access to files by enforcing ignore patterns. @@ -11,6 +12,8 @@ import ignore, { Ignore } from "ignore" export class LLMFileAccessController { private cwd: string private ignoreInstance: Ignore + private fileWatcher: vscode.FileSystemWatcher | undefined + private disposables: vscode.Disposable[] = [] /** * Default patterns that are always ignored for security @@ -20,9 +23,13 @@ export class LLMFileAccessController { constructor(cwd: string) { this.cwd = cwd this.ignoreInstance = ignore() - - // Add default patterns immediately this.ignoreInstance.add(LLMFileAccessController.DEFAULT_PATTERNS) + + // Set up file watcher for .clineignore + this.setupFileWatcher() + + // Load initial patterns + this.loadCustomPatterns() } /**