Skip to content

Add ignore_all_dot_files config option; fix Pyright dot-directory indexing#1101

Open
EarthmanWeb wants to merge 1 commit intooraios:mainfrom
EarthmanWeb:fix/pyright-dotfolders
Open

Add ignore_all_dot_files config option; fix Pyright dot-directory indexing#1101
EarthmanWeb wants to merge 1 commit intooraios:mainfrom
EarthmanWeb:fix/pyright-dotfolders

Conversation

@EarthmanWeb
Copy link

Problem

Serena unconditionally ignores all dot-prefixed directories (e.g.
.github, .config, .devcontainer) via is_ignored_dirname().
This is the right default for most cases, but breaks legitimate
workflows:

  • .github/ workflows: teams that store YAML, scripts or
    documentation in .github/ cannot get symbol support for those files
  • .config/ or .devcontainer/: project config files in
    dot-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 initializationOptions
excluded **/.venv etc., and its own defaults excluded **/.*.
Pyright also sends workspace/configuration requests to fetch
python.analysis settings — these were previously unhandled, causing
silent misconfiguration.

Fix

New config option: ignore_all_dot_files (default: true)

Added to ProjectConfig, LanguageServerConfig, and
project.template.yml. When set to false:

  • SolidLanguageServer.is_ignored_dirname() only ignores .git
    unconditionally; all other dot-directories are traversed
  • PyrightServer._get_initialize_params() becomes an instance method
    and builds exclude/include lists based on ignore_all_dot_files:
    • false: adds include: ["."] to override Pyright's internal
      dot-directory exclusion
    • true: keeps existing behaviour (excludes .venv, .env, .pixi)
  • PyrightServer now handles workspace/configuration requests,
    returning appropriate python.analysis include/exclude settings

Example

# .serena/project.yml
ignore_all_dot_files: false  # enable symbol retrieval in .github/, etc.
# Before: .github/workflows/ci.yml invisible to Serena
get_symbols_overview(".github/workflows/ci.yml")
# → FileNotFoundError or empty (directory ignored)

# After:
get_symbols_overview(".github/workflows/ci.yml")
# → {"on": {}, "jobs": {...}}

…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant