You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
codegraph explore "RealtimePlusService" No relevant code found for "RealtimePlusService" #1642
codegraph uninit
⚠ This will permanently delete all CodeGraph data. Continue? (y/N) y
✓ Removed CodeGraph from /Users/cmm/Downloads/idea/panda-es-build
codegraph init
@CmmVoid's root cause holds up — I checked it against current main, and there is a wrinkle worth surfacing for whoever picks this up. Not claiming it.
Confirming the mechanism.build is in DEFAULT_IGNORE_DIRS (src/extraction/index.ts:172, on the "Build output (common across ecosystems)" line), and DEFAULT_IGNORE_PATTERNS expands every entry to ${d}/ (:224). A gitignore pattern with no leading or internal slash matches at any depth, so build/ excludes com/ctrip/panda/es/build/ exactly as it excludes a top-level build/. Resources and pom.xml survive because they don't carry the Java package path — which is precisely the asymmetry in the report.
The wrinkle: this collides with a rule the file already states. The doc comment at :150-160 says generic, first-party-prone names — packages, lib, app, bin, src, deps, env, tmp, storage, Library — are "deliberately NOT listed, to avoid ever hiding real source." In Java, build is that same category: it is a perfectly ordinary package segment. So this isn't only a missing special case, it's an entry that arguably fails the list's own admission test at depth, even though it passes at the root.
Why there's no one-line fix, which is why I'm leaving this as triage rather than sending a patch:
target/ (Maven, Rust), out/, and dist/ are the same shape — all are legal package or directory names below a source root.
Restricting build/ to the project root would break Gradle monorepos, where module/build/ is genuinely build output and the depth-matching is doing real work.
Telling the two apart seems to need source-root awareness (is this path under src/main/java, src/, a module root?), which is a new concept for this list rather than a tweak to it.
Workaround in the meantime, using the escape hatch :150-160 documents — an explicit .gitignore negation in the project:
!**/src/main/java/**
Worth noting the failure is silent: codegraph init reported Indexed 38 files and Done with no warning, and the shortfall only surfaced later as explore finding nothing. Whatever the fix turns out to be, a project where git ls-files '*.java' returns hundreds and the index holds none seems worth a warning on its own.
Thanks for the detailed report, @CmmVoid, and thanks for using CodeGraph! This is fixed on main by #1998, which builds on @danusha2345's #1646 (thank you!): Java, Kotlin and Scala packages named build under a source root (src/main/java/.../build/) are indexed again, while real build-output directories stay excluded. The fix will be in the next release.
Activity
CmmVoid commentedon Aug 28, 2026
我刚定位到具体原因了:CodeGraph 内置默认忽略规则里有 build/,它本意是排除构建产物目录,但你们 Java 包路径
是:
com/ctrip/panda/es/build/...
所以所有 Java 文件路径里都有 /build/ 这个目录段,被 CodeGraph 当成构建产物过滤掉了。资源文件和 pom.xml 没
有这个包路径,所以还能被索引进去。
关键验证结果:
isSourceFile(RealtimePlusService.java) = true
buildScopeIgnore(RealtimePlusService.java) = true
scanDirectory files = 38
java count = 0
git ls-files '*.java' = 246
所以本质是 CodeGraph 的默认 ignore 规则对 Java 包名误伤了,不是 .codegraph 生成文件的问题。你说
的 .db / .db-shm / .db-wal / .log / .pid / .sock 都是正常本地索引/daemon 运行产物;当前这个仓只有
codegraph.db 也正常,不代表少了 Java 索引能力。
处理方式我建议两档:
短期本仓可用:在根 .gitignore 加 negation,让 CodeGraph 的内置 build/ 被覆盖:
!/src/main/java/
!/src/test/java/
然后重新执行:
codegraph index
codegraph explore "RealtimePlusService"
但注意:这会改 .gitignore。如果你不想进仓库,就别提交这个改动。
长期正确处理:给 CodeGraph 提 issue。这个是它的默认规则设计问题,build/ 不应该误伤 Java package path,至少
应该对 src/main/java/、src/test/java/** 做例外,或者默认 ignore 只针对项目级/构建输出上下文。**
一句话结论:你另一个工程能用,是因为它的 Java package 路径里大概率没有 /build/ 这个目录段;panda-es-build
这里刚好包名和默认忽略规则撞上了。
maxmilian commentedon Aug 29, 2026
@CmmVoid's root cause holds up — I checked it against current
main, and there is a wrinkle worth surfacing for whoever picks this up. Not claiming it.Confirming the mechanism.
buildis inDEFAULT_IGNORE_DIRS(src/extraction/index.ts:172, on the "Build output (common across ecosystems)" line), andDEFAULT_IGNORE_PATTERNSexpands every entry to${d}/(:224). A gitignore pattern with no leading or internal slash matches at any depth, sobuild/excludescom/ctrip/panda/es/build/exactly as it excludes a top-levelbuild/. Resources andpom.xmlsurvive because they don't carry the Java package path — which is precisely the asymmetry in the report.The wrinkle: this collides with a rule the file already states. The doc comment at
:150-160says generic, first-party-prone names —packages,lib,app,bin,src,deps,env,tmp,storage,Library— are "deliberately NOT listed, to avoid ever hiding real source." In Java,buildis that same category: it is a perfectly ordinary package segment. So this isn't only a missing special case, it's an entry that arguably fails the list's own admission test at depth, even though it passes at the root.Why there's no one-line fix, which is why I'm leaving this as triage rather than sending a patch:
target/(Maven, Rust),out/, anddist/are the same shape — all are legal package or directory names below a source root.build/to the project root would break Gradle monorepos, wheremodule/build/is genuinely build output and the depth-matching is doing real work.src/main/java,src/, a module root?), which is a new concept for this list rather than a tweak to it.Workaround in the meantime, using the escape hatch
:150-160documents — an explicit.gitignorenegation in the project:Worth noting the failure is silent:
codegraph initreportedIndexed 38 filesandDonewith no warning, and the shortfall only surfaced later asexplorefinding nothing. Whatever the fix turns out to be, a project wheregit ls-files '*.java'returns hundreds and the index holds none seems worth a warning on its own.fix: index Java packages named build (colbymchenry#1642)
fix(extraction): preserve Java packages named build (#1642) (#1998)
colbymchenry commentedon Sep 27, 2026
Thanks for the detailed report, @CmmVoid, and thanks for using CodeGraph! This is fixed on
mainby #1998, which builds on @danusha2345's #1646 (thank you!): Java, Kotlin and Scala packages namedbuildunder a source root (src/main/java/.../build/) are indexed again, while real build-output directories stay excluded. The fix will be in the next release.fix(extraction): a build folder inside src/ is indexed for its TypeSc…