Skip to content

Per-workspace .cdidxignore not loaded from .codeindex config directory #2023

Description

@Widthdom

Summary

Currently, .cdidxignore patterns are only recognized in the indexed project root and inherited down to child directories (FileIndexer line 67, IgnoreFileNames = [".gitignore", ".cdidxignore"]). Monorepo and multi-workspace setups have no way to define workspace-local ignore rules in a central .codeindex/config/ directory without modifying the root .cdidxignore or .gitignore. This blocks scenarios like: "Index /workspace/repo1 AND /workspace/repo2 from a shared .codeindex/workspaces/ config manifest."

Where

  • src/CodeIndex/Indexer/Scanning/FileIndexer.cs:67 (IgnoreFileNames hardcoded, no config-dir variant)
  • src/CodeIndex/Indexer/Scanning/FileIndexer.cs:1526 (LoadIgnoreRulesForDirectory iterates IgnoreFileNames; no config-dir lookup)
  • src/CodeIndex/Cli/IndexCommandRunner.cs:95 (no per-workspace config loading before FileIndexer construction)

Suggested approach

  1. Add support for a .codeindex/.cdidxignore file (workspace-scoped) separate from project-root .cdidxignore
  2. Modify LoadIgnoreRulesForDirectory to check for this workspace-root file once at initialization
  3. Create a new IgnoreRulesForWorkspace class that merges workspace-root, ancestor, and directory-level rules in the correct precedence
  4. Pass the workspace ignore root to FileIndexer via constructor (already supports ignoreRuleRoot parameter)
  5. Document the new .codeindex/.cdidxignore in USER_GUIDE with examples for multi-workspace setups
  6. Store the resolved workspace ignore ruleset in indexing metadata for future audits

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions