Repository navigation
fix(cfml): a <cfquery> or <cfscript> block that fails to parse no longer flags the file - #2843
Merged
Merged
Conversation
…ger flags the file Both delegates in cfml-extractor.ts read a block with its own grammar through a fresh TreeSitterExtractor and copied its errors onto the file. That extractor warns "parse produced no symbols (tree has errors) - the file is indexed but contributes nothing to the graph" when its tree has errors and it found no symbols: true of the block, not of the file, and a `<cfquery>` body never declares a symbol. So `codegraph init` printed the warning and `codegraph status` counted the file among those whose symbols are missing, though its component, methods and calls were indexed. extractTagExpressions already drops the warning for the same reason. Fix: the delegates record that warning as one naming the block and its line, with code partial_parse, so `codegraph files --json` shows which block failed while init and status, which key on parse_error, no longer report the file. Other errors pass through unchanged. The issue's own example SQL parses cleanly with the bundled cfquery grammar, so the reporter's trigger was not reproduced; any query body the grammar can't read (here `EQV` in a <cfif> condition) and any statement-only <cfscript> block with a syntax error showed the same warning. Validation: - New cfml-embedded-parse-warning.test.ts: the repro DAO keeps its class, both methods and the call inside the failing query, and records one partial_parse warning naming <cfquery> at line 6; a failing <cfscript> block likewise; getIndexHealth lists neither file. All 3 fail on main's extractor and pass. status-index-health.test.ts passes. - On the repro, main prints the whole-file warning during init and status says 1 file could not be parsed so its symbols are missing; with the fix neither does. - A/B vs main f406fe0: FW/1, BlogCFC, ColdBox, ContentBox, Preside and CFWheels unchanged; in Wheels' vendor/wheels core (indexed as its own project) one file changed, tests/html.cfm, whose <cfscript> block at line 8 fails: its warning now names that block. Nodes, edges and references are identical in every repo. express and flask controls byte-identical. - Index time, median of 4 interleaved runs, CPU with workers, main vs fix: Preside 57.1 / 54.5 s, Wheels core 33.2 / 32.8 s. Within noise. Fixes #2654 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
colbymchenry
force-pushed
the
claude/issue-2654-cfml-embedded-parse-warning
branch
from
October 23, 2026 12:21
35e6edc to
9fc2bc6
Compare
colbymchenry
deleted the
claude/issue-2654-cfml-embedded-parse-warning
branch
October 23, 2026 12:32
danusha2345
pushed a commit
to danusha2345/codegraph
that referenced
this pull request
Oct 23, 2026
…mchenry#2843; superseded colbymchenry#2483 yields to main's colbymchenry#2837) CFML includes/createObject/parse-failure handling and the `export type *` preParse from main; our colbymchenry#2483 (the same blanking, by a narrower rule) and its test are dropped in favour of colbymchenry#2837, status-index-health takes main's merge-conflict fixture, resolution/index.ts keeps both sides' imports. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
In a tag-based CFML file, a
<cfquery>or<cfscript>block the parser can't read put this warning on the whole file: "parse produced no symbols (tree has errors) — the file is indexed but contributes nothing to the graph".codegraph initprinted it andcodegraph statuscounted the file among those "could not be parsed, so their symbols are missing", though the file's component, methods and calls were all in the graph. The reporter saw it on 66 DAO and gateway files.The issue's own example SQL (
SELECT <cfif arguments.fields IS "count">COUNT(*)<cfelse>p.*</cfif> FROM pages p) parses cleanly with the bundled query grammar, as do about 110 other query shapes tried, so the reporter's actual trigger was not reproduced. The fix doesn't depend on it: any<cfquery>body the query grammar can't read produced the warning (the repro usesEQVin a<cfif>condition, one shape it can't read), and so did a statement-only<cfscript>block with a syntax error.Root cause
Both delegates in
cfml-extractor.tsparse the block with its own grammar through a freshTreeSitterExtractorand copied its errors onto the file. That extractor warns when its tree has errors and it produced no symbols, which describes the block, not the file, and a<cfquery>body never declares a symbol.extractTagExpressionsalready drops that warning for the same reason; the two delegates didn't.Fix
The delegates record the block's warning as what it is: one naming the block and its line (
<cfquery> at line 6 has a syntax error — the rest of the file is indexed, but calls inside that block may be missing from the graph), withlineset and its own code,partial_parse. Socodegraph files --jsonshows which block failed, whileinitno longer prints a whole-file warning andstatusno longer counts the file as one whose symbols are missing (both key onparse_error). Other errors pass through as before. A file whose whole source fails to parse still gets the old warning.Validation
__tests__/cfml-embedded-parse-warning.test.ts: the repro's DAO (class, both methods and the#getSiteId()#call inside the failing query are kept; onepartial_parsewarning names<cfquery> at line 6), a failing<cfscript>block, andgetIndexHealth()no longer listing either file. All 3 fail on main's extractor and pass with the fix.status-index-health.test.tspasses.▲ appsettingsdao.cfc: parse produced no symbols …duringinitandstatusreports "1 file could not be parsed, so its symbols are missing"; with the fix, neither.vendor/wheelscore indexed as its own project (the default ignore skipsvendor/), one file changed:tests/html.cfm, a template whose<cfscript>block at line 8 fails to parse, now records<cfscript> at line 8 has a syntax error …instead of the whole-file warning. Nodes, edges and references are identical in every repo.Fixes #2654
Left out
Making the bundled query grammar read more SQL is upstream work in tree-sitter-cfml, and without one of the reporter's files the shape that fails for them is unknown.
🤖 Generated with Claude Code