fix(code-nav): stop excluding source packages named vendor/target/build (#1558) - #1559
Open
backnotprop wants to merge 2 commits into
Open
backnotprop wants to merge 2 commits into
backnotprop wants to merge 2 commits into
Conversation
…ld (#1558) A ripgrep glob with no slash matches a path segment at any depth, so --glob !vendor pruned first-party Java packages such as src/main/java/com/example/vendor/app/ and code navigation reported 'No results'. Split the exclusion list: names that can only be tool output stay excluded at any depth, while the ambiguous names (vendor, target, build, dist, coverage) are now excluded only at the search root via an anchored glob. Nested copies that really are build output are already skipped by ripgrep's default .gitignore handling. Belt and braces: a segment the request's own file lives under is never excluded for that request, so a symbol in a changed file can always find its siblings.
Unit tests for the anchored/unanchored glob split and the origin-file rule, plus real-ripgrep coverage over a temp fixture (skipped cleanly when rg is not on PATH).
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.
Closes #1558.
Code navigation (Cmd/Ctrl+click References and the token hover card) reported "No results" for first-party Java source whose package path contains a directory named
vendor, e.g.src/main/java/com/example/vendor/app/.A ripgrep glob with no slash matches a path segment at any depth, so
--glob !vendorpruned the whole package subtree. The same trap applied totarget(Maven's build dir, but also an ordinary package segment) and tobuild/dist/coverage.Change
CODE_NAV_IGNORED_GLOBSinpackages/shared/code-nav.tsis split in two:node_modules,.git,.next,__pycache__,.turbo,.cache,.venv,.pytest_cache— these can only ever be tool output.--glob !/vendor):vendor,target,build,dist,coverage. Nested copies that really are build output are already skipped by ripgrep's default.gitignorehandling.Belt and braces: a segment the request's own
filePathlives under is never excluded for that request, so a symbol in a changed file can always find its siblings.The module is vendored to Pi by
apps/pi-extension/vendor.sh, so both runtimes get the fix.Behavior change
Nested
vendor//target//build//dist//coverage/directories that are not gitignored are now searched by code navigation. Root-level ones, and gitignored ones anywhere, are still skipped.Verification
bun run typecheck(runsvendor.shfirst) — cleanbun test packages/shared/code-nav*— 129 passbun test packages/server— 841 pass, 1 skipbun test apps/pi-extension— 280 passNew tests cover the #1558 shape (a Java file under
.../vendor/app/is found), a root-levelvendor/still excluded,node_modulesexcluded at any depth, and the origin-file rule. The real-ripgrep tests use a temp-dir fixture and skip cleanly whenrgis not on PATH.No docs changes: neither
apps/marketingnorAGENTS.mddocuments the exclusion list.