Skip to content

feat(cpp): namespace-qualified names, template-arg calls, UE class recovery, .h detection - #141

Merged
sunerpy merged 1 commit into
mainfrom
feat/upstream-1.4.1-release-d-cpp-namespace-ue
Jul 14, 2026
Merged

sunerpy merged 1 commit into
mainfrom
feat/upstream-1.4.1-release-d-cpp-namespace-ue

Conversation

@sunerpy

@sunerpy sunerpy commented Jul 14, 2026

Copy link
Copy Markdown
Owner

Summary

Upstream-sync Release D — the C++ subset of colby 1.2.0→1.4.1 + a Lua fix. Golden-bump (cpp fixture only).

  • C++ namespace qualified names + ns::fn() resolution (e1a8d88, namespace hunks only): symbols in namespace blocks carry the namespace (ns::compute, C++17 namespace a::b {); namespace-qualified calls resolve. Prefix-only stack — no namespace node emitted.
  • C++ template-arg calls (e1a8d88): fn<int>(args) links to the function it instantiates, reusing the <>-stripping normalization templated bases already had.
  • #1158 UE reflection-macro class recovery: offset-preserving pre-parse blanks line-leading GENERATED_BODY/UPROPERTY/UFUNCTION/UE_DEPRECATED/DECLARE_DELEGATE, member *_API, mid-line UMETA/UPARAM — so heavily-reflected UE classes + their base clause survive. Contains-gated, byte-identical on non-UE C++.
  • #1159/#1133 export-macro-aware .h detection: a .h whose only C++ signal is class ENGINE_API UFoo : public UObject + GENERATED_BODY is reclassified C→C++ by content during extraction; path-only detect_language + callers unchanged.
  • #1124 Lua/Luau self-match gate: capitalized obj:Method() no longer misread as a :Type annotation (code-side gate — regex crate has no lookahead); real local x: Type still resolves.

CUDA / local-fn-ptr slices of e1a8d88 deliberately EXCLUDED.

Verification

  • make ci green (fmt + clippy + test + guardrail + equivalence); cargo test --workspace 2455 passed / 0 failed.
  • 24 new tests (namespace/template/UE-recovery/offset-preserving/.h-reclassify/Lua-gate).
  • Golden audit: cpp fixture deliberately extended (namespaced call, templated call, UE .h class) + regenerated. The ONLY pre-existing-record changes are Tpl→ns::Tpl qualified names and Q : ns::Tpl<int> migrating unresolved→a resolved Extends edge. godot/ruby/mini goldens byte-identical. No removed nodes/edges beyond the intended ref migration.
  • Independent oracle review: APPROVE (all 7 risk areas verified, golden diff byte-audited).

Release D of the chosen 1.2.0→1.4.1 upstream PORT subset (last of the 4).

…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

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.06393% with 26 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
crates/codegraph-extract/src/lang/cpp.rs 94.89% 10 Missing ⚠️
crates/codegraph-extract/src/walker.rs 91.30% 8 Missing ⚠️
crates/codegraph-extract/src/engine.rs 88.13% 7 Missing ⚠️
crates/codegraph-resolve/src/name_matcher.rs 98.90% 1 Missing ⚠️

❌ 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.

Impacted file tree graph

@@            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     
Files with missing lines Coverage Δ
crates/codegraph-resolve/src/name_matcher.rs 97.15% <98.90%> (-0.01%) ⬇️
crates/codegraph-extract/src/engine.rs 95.55% <88.13%> (-0.67%) ⬇️
crates/codegraph-extract/src/walker.rs 92.48% <91.30%> (-0.82%) ⬇️
crates/codegraph-extract/src/lang/cpp.rs 88.06% <94.89%> (-4.72%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@sunerpy
sunerpy merged commit 1dbc1d5 into main Jul 14, 2026
7 checks passed
@sunerpy
sunerpy deleted the feat/upstream-1.4.1-release-d-cpp-namespace-ue branch July 14, 2026 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant