CFML: misleading "parse produced no symbols" warning when only an embedded <cfquery> block fails to parse
Summary
Files whose <cfquery> contains SQL split across <cfif> get this warning in files.errors:
parse produced no symbols (tree has errors) — the file is indexed but contributes nothing to the graph
But these files do contribute symbols. Only the sub-parse of the query block fails.
Example
<cfquery name="q" datasource="#dsn#">
SELECT <cfif arguments.fields IS "count">COUNT(*)<cfelse>p.*</cfif>
FROM pages p
</cfquery>
contens/model/appsettings/appsettingsdao.cfc has 1 class and 16 methods in the graph, yet it carries the warning above. Our project has 66 DAO/gateway files like this.
Expected
- The warning names the failing embedded block (
<cfquery>at line N) instead of saying that the file contributes nothing. - If possible,
#…#expressions inside a<cfquery>that fails to parse are still extracted.
(The SQL-fragment parsing itself belongs to tree-sitter-cfml.)
Thanks for the report!
#2843 is merged to main. A <cfquery> or <cfscript> block that fails to parse no longer flags the whole file:
codegraph initno longer prints the "contributes nothing" warning for it.codegraph statusno longer counts it among files whose symbols are missing.- The file's recorded errors now name the block and its line instead.
#…# expressions inside a failing query were already extracted where the parser recovers.
We couldn't reproduce the parse failure with the SQL in your example. It parses cleanly with the bundled grammar, as did about 110 other query shapes we tried. If you can share one of the affected queries, we'd like to look at the grammar side too; feel free to reopen with it. The fix ships in the next release.
Thanks, I will re-check with the next release and send you queries if I still find something.