Skip to content
| Marketplace
Sign in
Visual Studio Code>Formatters>CFML AI FormatterNew to Visual Studio Code? Get it now.
CFML AI Formatter

CFML AI Formatter

Akhil Teotia

|
1 install
| (0) | Free
An AI-powered, Prettier-like code formatter for CFML (ColdFusion Markup Language) using the Gemini API.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

CFML AI Formatter

An AI-powered, Prettier-like code formatter for CFML (ColdFusion Markup Language) that runs directly in Visual Studio Code. This extension uses the Google Gemini API to understand and reformat your messy CFML, HTML, and SQL mixed code, producing a clean, consistently formatted version.

Features

  • AI-Powered Formatting: Leverages the power of generative AI to understand the structure of your CFML code, including tags, attributes, and sibling relationships (<cfif>, <cfelse>).
  • Seamless Integration: Integrates with VS Code's native formatting capabilities.
  • Format on Save: Automatically format your CFML files every time you save.
  • Context-Aware: Preserves the raw content inside special blocks like <cfquery> and <cfscript>.
  • Easy Configuration: Just add your Gemini API key and you're ready to go.

Requirements

You must have a valid Google Gemini API key to use this extension. You can obtain a key for free from Google AI Studio.

Extension Settings

This extension contributes the following settings:

  • cfml-ai-formatter.apiKey: Your Google Gemini API Key. This is required.

How to Add Your API Key

  1. Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
  2. Type Preferences: Open User Settings (JSON) and select it.
  3. Add the following line to your settings.json file:
    "cfml-ai-formatter.apiKey": "YOUR_GEMINI_API_KEY_HERE"
    
  4. Save the file.

Alternatively, the extension will prompt you to open the settings UI the first time you try to format a file without a key.

Usage

Once the extension is installed and your API key is configured, you can format your CFML code (.cfm, .cfc files) in several ways:

  1. Format Document Command:
    • Open a CFML file.
    • Open the Command Palette (Ctrl+Shift+P or Cmd+Shift+P).
    • Run the "Format Document" command.
  2. Right-Click Context Menu:
    • Right-click inside a CFML file.
    • Select "Format Document".
  3. Format on Save:
    • To enable format on save, add the following to your settings.json:
    "[coldfusion]": {
        "editor.defaultFormatter": "your-publisher-name.cfml-ai-formatter",
        "editor.formatOnSave": true
    }
    
    • Replace your-publisher-name with the actual publisher ID you use when publishing.

Disclaimer

This is a proof-of-concept using a powerful AI model. While it aims for Prettier-like idempotency and accuracy, the formatting is non-deterministic by nature. Always review the formatted code.


Enjoy consistently formatted CFML!

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft