Commit graph

5 commits

Author SHA1 Message Date
trvon
9f9fc560b7
fix(scan): decode non-UTF-8 source lossily instead of dropping the file
A single invalid byte, such as a Latin-1 `é` in a comment, made
`read_to_string` fail and the whole file and its symbols were skipped.

Files are now read as bytes: a NUL byte still marks a binary file,
which is skipped with a diagnostic; otherwise invalid UTF-8 is decoded
lossily (U+FFFD) and a warning diagnostic records it, so the file keeps
its symbols and calls.

Test: languages::a_non_utf8_byte_does_not_drop_the_whole_file fails
before this change (latin1.rs has no symbols).
2026-09-24 20:13:01 -06:00
trvon
a03c36969e
feat(dart): resolve calls through imported libraries and own package: URIs
A Dart import exposes a library's public top-level names without a
per-name binding, so the binding-based lookup never matched and no
cross-file Dart call resolved, even when the import itself did (pipe's
VerifyCommand::run lost loadProject, analyzeProject, verifyAnalysis and
decodeBaselineEntries).

After the lexical-owner walk and binding lookup fail, a Dart call now
resolves to the one public (not `_`-prefixed) top-level declaration of
that name in the libraries the file imports; several such declarations
make it `ambiguous`, none leaves it external. `package:<name>/x.dart`
imports resolve to `lib/x.dart` when `<name>` is the root pubspec's
package; other packages stay external. `show`/`hide` combinators are not
modelled (noted as a follow-up).

Test: languages::dart_calls_resolve_through_imported_libraries fails
before this change (helper stays not-visible); an unimported file and a
library-private name stay unresolved.
2026-09-24 20:09:01 -06:00
trvon
4bdae55923
fix(python,swift): keep calls in their function and resolve only visible names
Three lexical-preview bugs, reproduced on one probe:

- A blank or comment-only line in a Python function fell through to the
  brace-depth scope rule, which popped every open scope, so every call
  after the first blank line in a body was attributed to the file.
  Blank/comment lines now leave Python scopes unchanged.
- `class Child(Base):` matched the call pattern and produced a call edge
  from the file to Child. The declared class name is no longer a call
  on its own header line.
- Calls resolved to the only function with that name anywhere in the
  repository, imported or not (a NameError at runtime became an edge).
  Resolution now prefers the caller's file; Python then considers only
  files the caller imports (resolved import edges, cached per file);
  otherwise the call stays external. Swift keeps the module-wide unique
  name after the same-file check, because files of one Swift module see
  each other without imports. Imported bases resolve the same way, so
  `from pkg.b import Base` disambiguates `class Child(Base)`.

Test: languages::python_calls_keep_their_function_and_resolve_only_what_is_visible
fails before this change (go() had no call edges at all).
2026-09-24 20:07:34 -06:00
trvon
46bd3f50f1
fix(dart,cpp): generic type arguments are not base classes
The base walker descended into type-argument lists, so
`class MyBloc extends Bloc<Ev, St>` emitted inherits edges to Bloc, Ev
and St; on pipe, 39 of 145 Dart inherits edges (27%) pointed at type
arguments (e.g. `Command<int>` -> `int`). C++ `: public Base<Arg>`
shared the walker through `template_argument_list`.

The walker stops at `type_arguments` / `template_argument_list` /
`type_parameters`, and handles tree-sitter-dart's shape, where the
arguments are sibling `type` fields of `superclass` (only the first
names the base) and nested `type` children of a `type`.

Test: languages::generic_type_arguments_are_not_base_classes fails
before this change (["Bloc", "Ev", "St"]).
2026-09-24 20:00:46 -06:00
trvon
3fec92f10c
feat: make source graphs accurate across C++ JS TS Dart and Rust
Some checks failed
build / build-linux (push) Successful in 1m3s
build / build-macos (push) Has been cancelled
build / release (push) Has been cancelled
Use pinned grammar frontends and scoped heuristic resolution to recover declarations and prevent false dependencies. Constrain filesystem traversal and normalize Fold root aliases.

Add exact multilingual fixtures, seventeen regression tests, and a three-repeat benchmark to the quality gate.
2026-09-04 23:05:06 -06:00