Skip to content

fix(extraction): warn when parse errors leave no symbols (#1522) - #1799

Merged
colbymchenry merged 1 commit into
mainfrom
forge/fix-1522-cpp-raw-string-haserror
Sep 8, 2026
Merged

colbymchenry merged 1 commit into
mainfrom
forge/fix-1522-cpp-raw-string-haserror

Conversation

@colbymchenry

Copy link
Copy Markdown
Owner

C++ raw strings with a 16-character delimiter can collapse the whole-file parse and silently leave only a file node. Emit a parse_error warning only when the tree has errors and extraction yields zero non-file symbols, and display that warning in the CLI while keeping indexing successful.

Related to #1522 (Half A). Grammar recovery remains a follow-up: the vendored grammar is unchanged, so the 16-character fixture still has no function symbols. Healthy empty/include-only files and partial parses with surviving symbols stay quiet.

Validation on Linux with Node 22.23.2:

  • Confirmed the new extraction and CLI regression tests fail before the fix because the warning is missing.
  • npx vitest run __tests__/cpp-raw-string-delimiter-haserror.test.ts — 7 passed.
  • npm run build — passed, including viewer and grammar asset checks.
  • Ran the focused suite, cli-parse-warning.test.ts, extraction.test.ts, and cli-index-explicit-path.test.ts together — 650 passed.
  • Re-initialized both supplied repro directories with the built CLI and queried after_the_raw_string:
Fixture Index result Query result
/tmp/cg-1522-repro/d16 1 node, 0 edges; collapse warning visible; exit 0 Function still absent; grammar recovery is deferred
/tmp/cg-1522-repro/d15 2 nodes, 1 edge; no collapse warning; exit 0 Function found

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