/** * Configuration scope management utilities */ /** * Find the project root by walking up to find .git, package.json, etc. * * Strategy: walk up from startPath, tracking both the first package.json * and any .git directory. Prefer .git (true repo root) over package.json * (which in monorepos appears in every workspace). This ensures sonarlint.json * at the repo root is found, not a nested workspace's package.json. */ export declare function findProjectRoot(startPath: string): string; /** * Get or create a SLOOP configuration scope for a project. * * Uses the project root (detected via package.json, .git, etc.) so all files * in the same project share one scope. * * ## CRITICAL: File registration ordering * * SLOOP calls `listFiles` immediately when it receives `addConfigurationScope`. * If no files are registered in `scopeFiles` at that point, the scope initialises * with an empty file list and analysis will hang waiting for files that SLOOP * never received. * * The correct sequence is: * 1. Pre-register file DTOs in `scopeFiles` (so `listFiles` can return them) * 2. Send `addConfigurationScope` notification to SLOOP * 3. Wait for `didChangeAnalysisReadiness` (scope is ready) * 4. Call `analyzeFilesAndTrack` * * Never scan the project directory in `listFiles` — only return the files the * caller explicitly asked to analyse. Scanning caused 500+ file responses and * multi-minute hangs on real projects. * * @param filePath - A file used to detect the project root * @param filePaths - All files to analyse (registered so listFiles returns them) */ export declare function getOrCreateScope(filePath: string, filePaths?: string[]): Promise; //# sourceMappingURL=scope.d.ts.map