mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-11-04 07:27:20 +00:00
* fix(impact): do not seed the owning file for a type the index recorded as not exported The #480 seed adds the file that DEFINES a Class or Interface to the walk, so the file's IMPORTS edges stand in for the type's importers. For a type recorded as isExported = false no importer can name it, and the file's importers came back as its direct dependants: a private interface used by one function in its file reported eight route files at depth 1, direct: 8, MEDIUM (#3602, second reproduction). The DEFINES seed query now also returns n.isExported, matched on the target's own label since not every node table has the column, and a row with false is left out of the frontier. true and NULL keep the seed. Refs #3602 * fix(impact): skip the owning-file seed only where a false export verdict is file-private `isExported = false` is a narrower fact than "no other file can name it" in most languages: Java package-private, C# and Kotlin `internal`, Go lowercase, Python and Dart `_name`, a Rust item seen from a child module, a C/C++ `static` in a header. Skipping the #480 file seed on every `false` turned the over-approximation into a false negative for them. The meaning of a stored verdict is a property of the language, so it lives on the provider: `LanguageProvider.notExportedIsFilePrivate`, set on TypeScript, JavaScript, Vue (an ES module is the file), Swift (false only for `private`/`fileprivate`) and Zig (no `pub`; `export fn` is recorded true). The seed resolves the provider from the file's path only for a `false` row and skips the file only when the flag is set. Two regressions in the same test file: a Java package-private class and a Kotlin `internal` class, both recorded `false`, keep their importers as direct dependants. Refs #3602 * fix(impact): require an ES export in the file before trusting a false verdict The stored verdict is the provider's export checker, which for an ECMAScript file answers "under an `export` statement?" whatever the module kind: a CommonJS class (`module.exports = Foo`) and a top-level declaration of a global script are both recorded `false`, and both can be named from other files. Trusting the provider flag alone skipped the owning-file seed for them. The index does not record the module kind, but it records the checker's `true`, which only ES `export` syntax produces. The skip now also requires a `true` declaration in the same file (Function, Class or Interface: the tables that carry the column and that a File DEFINES). A CommonJS file, a script, or a module whose exports all live in `Const`/`TypeAlias` keeps the seed, as before this fix. The Java and Kotlin cases now declare a public sibling class, so only the provider verdict keeps their seed; two new cases cover a CommonJS module and a global script. Refs #3602 * fix(impact): preserve uncertain type dependencies * fix(impact): retain exported type alias dependencies --------- Co-authored-by: Gergő Magyar <gergomagyar@icloud.com> Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com> |
||
|---|---|---|
| .. | ||
| bench | ||
| spikes | ||
| arm64-prebuild.cjs | ||
| assert-native-parsers.mjs | ||
| assert-publish-fts-coverage.cjs | ||
| assert-publish-grammar-coverage.cjs | ||
| assert-web-assets.mjs | ||
| bench-scope-resolution.ts | ||
| build-tree-sitter-grammars.cjs | ||
| build-web.js | ||
| build.js | ||
| cross-platform-shard.ts | ||
| cross-platform-tests.ts | ||
| ensure-fts.ts | ||
| execution-reporter.ts | ||
| install-duckdb-extension.mjs | ||
| prepare-tree-sitter-bundle.cjs | ||
| rebuild-bundled-grammar-prebuilds.cjs | ||
| run-benchmarks.ts | ||
| run-cross-platform.ts | ||
| shard-arg.ts | ||
| smoke-package-managers.mjs | ||
| sync-plugin-manifests.mjs | ||
| test-completeness.ts | ||