Repository navigation
feat(cpp): namespace-qualified names, template-arg calls, UE class recovery, .h detection - #141
Merged
Conversation
…covery, .h detection
Ports the C++ subset of upstream colby 1.2.0..1.4.1 plus a Lua fix.
- C++ symbols defined inside `namespace` blocks now carry the namespace in
their qualified name (`ns::compute`, C++17 `namespace a::b {` included), and
namespace-qualified calls (`ns::fn(...)`) resolve to their definitions —
previously such calls never linked, hiding much of the call graph in
namespace-heavy C++. A namespace-prefix stack contributes the prefix only, so
no namespace node is emitted. (e1a8d88, namespace hunks only.)
- C++ calls that spell out template arguments (`fn<int>(args)`) now link to the
function they instantiate, reusing the same `<>`-stripping normalization
templated base classes already had. (e1a8d88.)
- Heavily-reflected Unreal Engine C++ classes are recovered instead of dropped:
an offset-preserving pre-parse blanks line-leading reflection macros
(GENERATED_BODY/UPROPERTY/UFUNCTION/UE_DEPRECATED/DECLARE_DELEGATE), member
`*_API`/`*_EXPORT`/`*_ABI` export macros, and mid-line UMETA/UPARAM, so the
class and its base clause survive tree-sitter. The passes are contains-gated
and byte-identical on non-UE C++. (#1158.)
- A `.h` file whose only C++ signal is an export-macro-annotated class
(`class ENGINE_API UFoo : public UObject` with GENERATED_BODY) is reclassified
from C to C++ during extraction by content, so its class is no longer dropped.
Path-only `detect_language` and its callers are unchanged. (#1159, #1133.)
- Lua/Luau: a capitalized `obj:Method()` (Roblox convention) is no longer
misread as a `:Type` annotation and dropped when two classes share a method
name. The annotation pattern is gated code-side (the regex crate has no
lookahead) so a real `local x: Type` annotation still resolves. (#1124.)
The cpp golden fixture is deliberately extended (namespaced call, templated
call, UE `.h` class) and regenerated: the only pre-existing-record changes are
the `Tpl`->`ns::Tpl` qualified names and the `Q : ns::Tpl<int>` base resolving
from unresolved to a real Extends edge. godot/ruby/mini goldens byte-identical.
Codecov Report❌ Patch coverage is ❌ Your patch check has failed because the patch coverage (94.06%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage. @@ Coverage Diff @@
## main #141 +/- ##
==========================================
- Coverage 95.64% 95.53% -0.11%
==========================================
Files 115 115
Lines 56459 57233 +774
==========================================
+ Hits 54000 54679 +679
- Misses 2459 2554 +95
... and 1 file with indirect coverage changes 🚀 New features to boost your workflow:
|
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.
Summary
Upstream-sync Release D — the C++ subset of colby 1.2.0→1.4.1 + a Lua fix. Golden-bump (cpp fixture only).
ns::fn()resolution (e1a8d88, namespace hunks only): symbols innamespaceblocks carry the namespace (ns::compute, C++17namespace a::b {); namespace-qualified calls resolve. Prefix-only stack — no namespace node emitted.e1a8d88):fn<int>(args)links to the function it instantiates, reusing the<>-stripping normalization templated bases already had.*_API, mid-line UMETA/UPARAM — so heavily-reflected UE classes + their base clause survive. Contains-gated, byte-identical on non-UE C++..hdetection: a.hwhose only C++ signal isclass ENGINE_API UFoo : public UObject+ GENERATED_BODY is reclassified C→C++ by content during extraction; path-onlydetect_language+ callers unchanged.obj:Method()no longer misread as a:Typeannotation (code-side gate — regex crate has no lookahead); reallocal x: Typestill resolves.CUDA / local-fn-ptr slices of
e1a8d88deliberately EXCLUDED.Verification
make cigreen (fmt + clippy + test + guardrail + equivalence);cargo test --workspace2455 passed / 0 failed..h-reclassify/Lua-gate)..hclass) + regenerated. The ONLY pre-existing-record changes areTpl→ns::Tplqualified names andQ : ns::Tpl<int>migrating unresolved→a resolvedExtendsedge. godot/ruby/mini goldens byte-identical. No removed nodes/edges beyond the intended ref migration.Release D of the chosen 1.2.0→1.4.1 upstream PORT subset (last of the 4).