Repository navigation
fix(parsers): six #1538 audit findings — Rust/C#/Python/Dart imports and bases, Scala/Ruby missing declarations - #1654
Merged
Conversation
… and Ruby (#1538) Wrong values written to the graph: - rust: braced use lists kept only the LAST name; full_import_name was raw source ('use std::ops::Add;') no path consumer could match. Imports are now walked structurally: every braced name, aliases, wildcards, and super/crate/self prefixes, with clean '::' paths. - csharp: base lists split on every comma, shredding multi-arg generics (': Dictionary<string, int>' -> two nonexistent INHERITS targets). Split now respects bracket depth. - python: 'from . import x' produced '..x' — one package level too high. - dart: 'import ... as alias' lost the alias (the grammar has no 'prefix' node); the identifier after 'as' is now read directly. Missing declarations: - scala: the functions query made parameters mandatory, dropping every parameterless def. 12 previously-invisible functions on the fixture alone. - ruby: 'def self.x' singleton methods were never captured, in the parser or the cross-file pre-scan. One regression test per finding; rust/dart/scala goldens regenerated with the recovered content (+11 Rust IMPORTS, +12 Scala Functions, Dart aliases).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
Hi! 👋 Join our CodeGraphContext Discord channel to collaborate: https://discord.gg/dR4QY32uYQ |
Contributor
🔍 PR Code Graph Analysisfix(parsers): six #1538 audit findings — Rust/C#/Python/Dart imports and bases, Scala/Ruby missing declarations (#1654) 📊 Interactive VisualizationView the blast radius graph: PR Reviewer Dashboard 📦 ArtifactsThe graph JSON has been uploaded as a build artifact: Generated by CodeGraphContext using FalkorDB Lite |
This was referenced Aug 19, 2026
Merged
Merged
This branch was successfully deployed
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.
Second batch from the #1538 parser audit (the C++ section landed in #1628). Each finding reproduced on current main before fixing; one regression test per finding; unit suite 1390 passed / 7 skipped; rust/dart/scala goldens regenerated with the recovered content and all six affected-language goldens green.
Wrong values written to the graph
use a::{X, Y as Z, W};kept onlyW, andfull_import_namewas the raw source ('use std::ops::Add;') — written verbatim as the Module name wherereplace('.', '/') in pathcould never match. Imports are now walked structurally: every braced name, aliases, nested lists, wildcards, andsuper/crate/selfprefixes, all with clean::paths. Fixture recovers +7 Modules / +11 IMPORTS and one heuristic call upgrades.: Dictionary<string, int>became INHERITS edges toDictionary<stringandint>. Now split on top-level commas only.from . import x→..x, one package level too high; bare-dot relatives now join without the extra separator (.x,..x,.pkg.yall correct).import 'dart:math' as math;lost the alias — the grammar has noprefixnode, so the old lookup was always empty andmath.max(...)could never map to its import.Missing declarations
parametersmandatory, dropping every parameterlessdef(getters, abstract members). +12 Functions on the fixture alone.def self.xsingleton methods (node typesingleton_method) were invisible to both the parser and the cross-file pre-scan — now captured in both, with args and class context.Addresses the 'wrong values' and 'missing declarations' sections of #1538; the context-attribution section (call-site class_context in Java/C#/Swift/PHP, nested-function CONTAINS outside Python) remains and is scoped for a follow-up.