Add ignore_all_dot_files config option; fix Pyright dot-directory indexing#1101
Open
EarthmanWeb wants to merge 1 commit intooraios:mainfrom
Open
Add ignore_all_dot_files config option; fix Pyright dot-directory indexing#1101EarthmanWeb wants to merge 1 commit intooraios:mainfrom
EarthmanWeb wants to merge 1 commit intooraios:mainfrom
Conversation
…port Adds a new project.yml option `ignore_all_dot_files` (default: true) that controls whether directories starting with "." are automatically excluded from symbol indexing. Previously, ALL dot-prefixed directories were silently ignored (including .github, .husky, etc.). Setting `ignore_all_dot_files: false` now allows Serena to index symbols within those directories. Changes: - ls_config.py: add ignore_all_dot_files field to LanguageServerConfig - ls.py: is_ignored_dirname() respects ignore_all_dot_files; .git always ignored - serena_config.py: add ignore_all_dot_files to ProjectConfig - ls_manager.py: pass ignore_all_dot_files through LanguageServerFactory - project.py: propagate ignore_all_dot_files to LanguageServerFactory - project.template.yml: document the new option - pyright_server.py: make _get_initialize_params an instance method; build exclude/include lists based on ignore_all_dot_files; handle workspace/configuration requests to reinforce include paths with Pyright
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.
Problem
Serena unconditionally ignores all dot-prefixed directories (e.g.
.github,.config,.devcontainer) viais_ignored_dirname().This is the right default for most cases, but breaks legitimate
workflows:
.github/workflows: teams that store YAML, scripts ordocumentation in
.github/cannot get symbol support for those files.config/or.devcontainer/: project config files indot-directories are invisible to Serena
Additionally, Pyright has its own internal dot-directory exclusion that
is separate from Serena's. Even when Serena's exclusion was adjusted,
Pyright would still skip dot-directories because its
initializationOptionsexcluded
**/.venvetc., and its own defaults excluded**/.*.Pyright also sends
workspace/configurationrequests to fetchpython.analysissettings — these were previously unhandled, causingsilent misconfiguration.
Fix
New config option:
ignore_all_dot_files(default:true)Added to
ProjectConfig,LanguageServerConfig, andproject.template.yml. When set tofalse:SolidLanguageServer.is_ignored_dirname()only ignores.gitunconditionally; all other dot-directories are traversed
PyrightServer._get_initialize_params()becomes an instance methodand builds exclude/include lists based on
ignore_all_dot_files:false: addsinclude: ["."]to override Pyright's internaldot-directory exclusion
true: keeps existing behaviour (excludes.venv,.env,.pixi)PyrightServernow handlesworkspace/configurationrequests,returning appropriate
python.analysisinclude/exclude settingsExample