mirror of
https://github.com/stablyai/orca.git
synced 2026-11-02 01:57:57 +00:00
* Match Quick Open queries across path terms and identifier separators * Honor ignored-file and symlink preferences on file inventory hosts * Open pasted file locations and remember successful workspace file visits * Verify bounded directory listing preferences across execution routes * Preserve symlink preferences on legacy directory fallback * Preserve bounded Quick Open terms and separator alternatives * Revoke stale Quick Open selections and preserve literal file locations * Validate recent Quick Open candidates independently on their host * Use complete old-host inventory fixtures for Quick Open compatibility * Keep Quick Open validation current across palette and workspace changes * Route recent candidates through relay file listing dispatch * Record Quick Open hook renders as test snapshots * Localize Quick Open eligibility errors and search aliases * Validate file inventory with bundled search and runtime preferences * test: use directory junction fixtures on Windows * fix: negotiate Quick Open policies with nested SSH hosts * fix: refresh cached linked folders after target changes * Retry stale expanded links after reads settle and targets recover * Scope stale refresh request lifetime to the visible workspace * test: seed linked-folder fixture before watcher startup * Keep Quick Open responsive and compatible with older hosts * Exercise directory discovery with unprivileged Windows junctions
29 lines
907 B
TypeScript
29 lines
907 B
TypeScript
import { isWindowsAbsolutePathLike } from './cross-platform-path'
|
|
import { isClipboardTextByteLengthOverLimit } from './clipboard-text'
|
|
|
|
export const QUICK_OPEN_RECENT_CANDIDATE_LIMIT = 100
|
|
const MAX_CANDIDATE_BYTES = 64 * 1024
|
|
|
|
export function quickOpenRecentCandidateSet(paths: readonly string[]): ReadonlySet<string> {
|
|
if (paths.length > QUICK_OPEN_RECENT_CANDIDATE_LIMIT) {
|
|
throw new Error('Too many Quick Open recent candidates.')
|
|
}
|
|
const candidates = new Set<string>()
|
|
for (const path of paths) {
|
|
if (isClipboardTextByteLengthOverLimit(path, MAX_CANDIDATE_BYTES)) {
|
|
throw new Error('Quick Open recent candidate path is too large.')
|
|
}
|
|
if (
|
|
!path ||
|
|
path.includes('\0') ||
|
|
path.startsWith('/') ||
|
|
isWindowsAbsolutePathLike(path) ||
|
|
path.split('/').includes('..')
|
|
) {
|
|
continue
|
|
}
|
|
candidates.add(path)
|
|
}
|
|
return candidates
|
|
}
|