Skip to content

test: add golden coverage for extension parsers#323

Merged
justrach merged 1 commit intorelease/0.2.579from
fix/extension-parser-golden-tests
Apr 26, 2026
Merged

test: add golden coverage for extension parsers#323
justrach merged 1 commit intorelease/0.2.579from
fix/extension-parser-golden-tests

Conversation

@justrach
Copy link
Copy Markdown
Owner

@justrach justrach commented Apr 26, 2026

Summary

Tightens the parser assurance from #322.

This adds per-extension golden outline assertions so the newly covered extensions are validated by their own parsed outline, not only by global findAllSymbols smoke checks.

Coverage added

  • .cc: C++ include, class, member-like function, free function
  • .mm: #import, Objective-C @interface / @implementation, Objective-C method name, C++ class, C-style function
  • .java, .kt
  • .svelte, .vue, .astro
  • .sh
  • .css, .scss
  • .sql, .proto
  • .f90
  • .ll, .mlir, .td

Parser fixes included

  • C/C++ parser now recognizes class declarations.
  • C/C++ parser now handles #import in addition to #include.
  • .mm path now extracts basic Objective-C++ outline symbols: @interface, @implementation, @protocol, and -/+ method names.

Validation

  • zig build test
  • zig build
  • GitHub bench-regression / bench passed

Benchmark notes

The benchmark check passed, but the generated comment is noisy:

  • First run: codedb_edit +13.27% flagged; all other tools were within threshold, including codedb_symbol -9.05%.
  • Rerun: codedb_edit +13.38% and codedb_symbol +14.24% flagged.

This patch does not touch edit code. The symbol-path change is plausibly due to parser code/test growth increasing the indexed corpus and benchmark variance. Parser-adjacent correctness is covered by the new golden outline tests plus zig build test.

@github-actions
Copy link
Copy Markdown

Benchmark Regression Report

Threshold: 10.00%

Tool Base (ns) Head (ns) Delta Status
codedb_bundle 475021 484095 +1.91% OK
codedb_changes 53951 52436 -2.81% OK
codedb_deps 10667 10735 +0.64% OK
codedb_edit 5138 5820 +13.27% FAIL
codedb_find 58814 60868 +3.49% OK
codedb_hot 96653 102842 +6.40% OK
codedb_outline 239357 246020 +2.78% OK
codedb_read 87844 86980 -0.98% OK
codedb_search 177627 180392 +1.56% OK
codedb_snapshot 2717323 2689603 -1.02% OK
codedb_status 215484 204468 -5.11% OK
codedb_symbol 63940 58154 -9.05% OK
codedb_tree 74383 68223 -8.28% OK
codedb_word 70639 66829 -5.39% OK

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3ca698bebb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/explore.zig
}

fn extractObjCMethodName(line: []const u8) ?[]const u8 {
if (!startsWith(line, "- (") and !startsWith(line, "+ (")) return null;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Parse ObjC methods without fixed "- (" spacing

Objective-C allows optional whitespace between the -/+ token and the return-type parentheses, but this check only accepts the exact - ( or + ( prefix. Files that use valid forms like -(void)loadPage (or multiple spaces) will now miss method symbols entirely, which undercuts the new .mm outline coverage introduced here. Parse the leading -/+ first, then trim whitespace before checking for ( so all valid declarations are handled.

Useful? React with 👍 / 👎.

@github-actions
Copy link
Copy Markdown

Benchmark Regression Report

Threshold: 10.00%

Tool Base (ns) Head (ns) Delta Status
codedb_bundle 482517 486440 +0.81% OK
codedb_changes 57283 53540 -6.53% OK
codedb_deps 9430 8893 -5.69% OK
codedb_edit 5148 5837 +13.38% FAIL
codedb_find 59068 59473 +0.69% OK
codedb_hot 98300 100006 +1.74% OK
codedb_outline 246846 246700 -0.06% OK
codedb_read 85177 90137 +5.82% OK
codedb_search 175250 180353 +2.91% OK
codedb_snapshot 2730379 2769239 +1.42% OK
codedb_status 209720 206172 -1.69% OK
codedb_symbol 56787 64871 +14.24% FAIL
codedb_tree 69482 69782 +0.43% OK
codedb_word 67343 70676 +4.95% OK

@justrach justrach merged commit c83533b into release/0.2.579 Apr 26, 2026
2 checks passed
@justrach justrach deleted the fix/extension-parser-golden-tests branch April 27, 2026 09:23
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