mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-05 08:10:14 +00:00
wip
This commit is contained in:
parent
ef8d49c768
commit
8e4ab703c8
1 changed files with 9 additions and 2 deletions
|
|
@ -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()
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue