Repository navigation
Conversation
Run the search off the async runtime, prune the folders the root configuration ignores while walking, skip the home directory and filesystem roots, cap the walk at 100k entries / 12 levels with a warning, and only look at the ancestors of the checked paths in the CLI. Coalesce reloads from watched-file events and ignore events in folders the search skips.
This was referenced Oct 23, 2026
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #881. Must merge after #881.
#881 looks for nested configuration files by walking the whole workspace folder, synchronously on the async runtime, at startup and on every configuration change. With the home directory open as a workspace (a common Neovim
root_dirfallback, or "open folder" on a parent), the walk took 159 s and loaded 149 configuration files of unrelated projects. The CLI walked the whole working directory even forcheck one.sql, and every watched-file event ran a full reload, including events fromnode_modules.What changed
spawn_blocking. The session methods that reload takeself: &Arc<Self>so the blocking task can own the session.FileSystem::find_filestakes aFindFileswith askip_directorypredicate. The callers pass the root configuration'sfiles.ignore/files.includeand gitignore (FilesSettings::is_ignored, moved out ofserver.rs). A folder below a nested configuration file is not pruned by the root settings, because that file's settings decide there, which is whatupdate_nested_settingsalready does.files.ignoreor.gitignore."check/formatonly look at the folders between the working directory and each checked path (cached per folder), and walk only below the paths that are folders.check a.sqlno longer reads every configuration file in the tree, so a broken one intests/fixtures/no longer fails it.node_modules,target, too deep, ignored by the root settings) are dropped.Measurements
Release build, warm cache, same machine (shared, so ±50%),
cargo test -p pgls_fs --release --test find_files -- --ignored --nocapture(benchmark included in this PR):.sqlfiles:src/10k,vendor/30k,build/20k gitignored,node_modules/20kvendor~walked with the cap)target/check one.sqlBehaviour changes
/as a workspace no longer applies nested configuration files there.Tests
pgls_fs/tests/find_files.rs: hidden/vendored/gitignored folders,skip_directoryup to the first configuration file, depth and entry limits; plus the ignored benchmark.pgls_workspace:the_search_skips_the_folders_the_root_configuration_ignores,the_search_skips_the_home_directory,the_search_for_paths_only_looks_at_their_folders,the_search_reports_its_depth_limit,configuration_changes_in_skipped_folders_are_ignored,the_user_configuration_directories_are_not_nested_configurations.nested_configurations_do_not_merge_the_user_configurationnow uses a repo below the home directory instead of the home directory itself.configuration_changes_are_coalesced(five events → one refresh; a change innode_modules→ none). Two existing tests now wait for the debounced reload.check_only_loads_the_configuration_files_of_its_paths.Not covered
.gitignoreeven withvcs.enabled: false, as before.Locks in
pgls_lspThe new session state (the root files settings per folder here, and the watched files and real folder paths later in the stack) uses
parking_lotlocks instead ofstd::syncones, so a panicking handler can't poison them, in line with #943'sunwrap_used/expect_usedlints forpgls_lsp. The locks that come from #881 (projects,workspace_folders) are stillstdwith.unwrap(), and this PR readsprojectsonce more inis_configuration_change. Whichever of this stack and #943 lands second has to switch that call too.