Skip to content

Add CFML support (.cfc/.cfm/.cfs)#1

Open
ghedwards wants to merge 2 commits into
mainfrom
cfml-language-support
Open

Add CFML support (.cfc/.cfm/.cfs)#1
ghedwards wants to merge 2 commits into
mainfrom
cfml-language-support

Conversation

@ghedwards

Copy link
Copy Markdown
Collaborator

Summary

  • Add a dedicated CfmlExtractor for CFML, dialect-switching between the tag-based cfml grammar (<cfcomponent>/<cffunction>) and the bare-script cfscript grammar (component { ... }), covering both .cfc/.cfm and standalone .cfs files
  • Extracts classes/methods, extends/implements, embedded <cfscript> block delegation with correct call-edge attribution, and filename-derived component naming (CFML never declares a component name in source)
  • Wire CFML into LANGUAGES, the extension map, and the default include globs; vendor the tree-sitter-cfml/tree-sitter-cfscript wasm grammars
  • Update README (language list + Supported Languages table) and CHANGELOG

Test plan

  • npx vitest run __tests__/extraction.test.ts — new CFML Extraction block (13 tests) covering language detection, bare-script and tag-based .cfc, standalone .cfs, top-level cffunction in .cfm, and <cfscript> delegation/call-attribution — all passing
  • Full extraction.test.ts suite green (400/400), no regressions in the broader vitest suite
  • Real-world CFML repo extraction + agent A/B benchmarking (steps 7-8 of the language-onboarding checklist) — blocked in this environment by a network restriction preventing cloning repos outside this session's authorized scope; not yet run

🤖 Generated with Claude Code

https://claude.ai/code/session_01T5ke54pcod9W3F33H7KeG8


Generated by Claude Code

claude added 2 commits June 30, 2026 05:30
Adds CodeGraph extraction for ColdFusion Markup Language using
tree-sitter-cfml's cfml and cfscript grammars. Handles both the legacy
tag-based style (<cfcomponent>/<cffunction>) and modern bare-script
style (component { ... }), delegating embedded <cfscript> tag bodies
to the cfscript grammar. .cfs files are routed through the same
extractor so anonymous component names fall back to the filename
consistently across both extensions, since CFML never declares a
component's name in source.

Includes extraction tests covering both dialects, extends/implements,
visibility, and regression coverage for the implicit-end-tag walk and
file-node containment.
… cfquery SQL bodies

A <cfscript> block nested inside control-flow tags (<cfif>/<cfloop>/<cftry>)
inside a <cffunction> or at top-level component scope was silently skipped:
the implicit-end-tag walk only checked direct children/siblings for
cf_script_tag, missing it when wrapped a level deeper. A new recursive
delegateNestedTags helper finds <cfscript>/<cfquery> at any depth without
descending into nested <cffunction> scopes.

<cfquery> SQL bodies were also entirely unhandled - the cf_query_content
node's text was opaque raw SQL, so any #hash# expression inside it (e.g. a
call like #getCurrentUser().getId()# in a WHERE clause) was dropped. Wires
the tree-sitter-cfml cfquery grammar in as a new minimal Language/extractor
(call expressions only - the grammar models no other CodeGraph symbols) and
delegates <cfquery> bodies to it the same way <cfscript> bodies are
delegated to the cfscript grammar.
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.

2 participants