Skip to content

Feature request: follow directory symlinks (or allow extra index paths) to include external dependencies #1302

Description

@wandaren

Problem

CodeGraph does not follow directory symlinks during init / index. When a project depends on an external local codebase and a symlink is used to bring that dependency into the project tree, CodeGraph ignores the symlink entirely — the external code never appears in the index.

Use case

Project A depends on Project B's source code (for example, from project_b.utils import ...). Project B lives elsewhere on disk and is not installed as a package — it is referenced directly.

A natural way to let CodeGraph index both together is:

ln -s /path/to/project-b /path/to/project-a/project-b
codegraph index /path/to/project-a

Expected: CodeGraph recurses into the symlinked directory and indexes its files alongside Project A's own files.

Actual: codegraph status reports only Project A's own file count, and codegraph files shows no files from Project B.

Workaround (not ideal)

A Git submodule works — CodeGraph indexes submodule files. However:

  • It pollutes the Git history with submodule commits.
  • It requires the dependency to be a Git repository and the relationship to be formally tracked.
  • It is heavy for lightweight "I just want cross-project jump-to-definition" workflows.

Proposed solutions

  1. Follow directory symlinks by default, with an opt-out flag. Most tools (ripgrep, tree, fd) follow symlinks or provide a -L / --follow option.
  2. Add a configuration option, such as extraPaths or an include entry in codegraph.json:
{
  "include": [
    "/path/to/project-b",
    "/path/to/shared-lib"
  ]
}

This would let users explicitly list external directories to merge into the index without modifying the filesystem or using submodules.

Environment

  • CodeGraph version: 1.4.1
  • OS: macOS (but likely cross-platform)

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