Repository navigation
Conversation
extract_calls_in_function scanned the whole tree with every definition pattern for each function it was asked about, and the graph builder asks about every function of a file in a row: the cost grew with functions x file size. A vendored 200 KB minified bundle (chart.umd.js) took ~20 s to index, enough to make the MCP client's connection time out. _definitions_by_name() builds the name -> definition-node map once per parsed tree (memoized per thread and bounded, like CachedParser), keeping the old precedence: patterns in order, first match in document order. JavaScript (and TypeScript/TSX, which inherit it) and Python use it. Cold index, unchanged graph (identical edges and symbols): - repo with a 200 KB minified JS file: 23.1 s -> 1.3 s - 460-file Python/JSX repo: 15.6 s -> 5.4 s
Ports the --exclude option of ThinkyMiner#6 onto git-based discovery and background indexing. A repeatable --exclude names a directory or file relative to the root (or absolute, below it); discovery drops it whether git tracks it or not, so committed vendored bundles stay out of the index. A value that can never match (outside the root, empty, or with '..') is rejected: the CLI exits with a usage error and create_server() raises ValueError before any indexing thread starts.
3 tasks done
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.
Summary
Supersedes #6, rebased onto git-based discovery (#4) and background indexing (#5).
Git discovery already keeps ignored files and nested worktrees out, but a tracked vendored or generated file is still indexed. A repo committing a 200 KB minified bundle (
chart.umd.js) took ~20 s to index it, enough to make the MCP client's connection time out. Two commits:extract_calls_in_functionscanned the whole tree with every definition pattern for each function, so the cost grew with functions x file size._definitions_by_name()builds the name -> definition-node map once per parsed tree (memoized per thread and bounded, likeCachedParser), keeping the old precedence. Cold index, identical graph: 23.1 s -> 1.3 s on the repo with the minified file, 15.6 s -> 5.4 s on a 460-file Python/JSX repo.--exclude PATH, repeatable, leaves a directory or file out of the index, tracked or not.Changes
--exclude PATH, repeatable, relative to the root (or absolute, below it); discovery drops it whether git tracks it or not..) is rejected: usage error from the CLI,ValueErrorfromcreate_server()before any indexing thread starts_definitions_by_name()inbase.py, used by the JavaScript (and TypeScript/TSX) and Python plugins--excludescopes the index,git_historystill reports every tracked fileTest plan
pytest— 1222 passed;test_non_utf8_file_names_are_indexed_in_git_modefails on macOS, onmainas well (APFS rejects the non-UTF-8 file name)Related issues
Supersedes #6.