Search code examples
visual-studio-codecoldfusionvscode-debuggercoldfusion-2016

How to setup Visual Studio Code for running and debugging ColdFusion code?


Is it possible to configure Visual Studio Code (installed on my Windows 10 client machine) to run and debug ColdFusion code, that is located server side in the path C:\inetpub\wwwroot\dir\dev?

I'm using ColdFusion 2016 (64 bit) together with IIS 6.2 on that Windows Server 2012 R2 Standard machine.

I opened the directory \\my-cold-fusion-server-as-FQDN\c$\inetpub\wwwroot\dir\dev in "Explorer" of Visual Studio Code to display and modify the cfm files.

I also configured the launch.json file in Visual Studio Code ("Run" > "Open Configurations") as follows:

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "type": "pwa-chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://my-cold-fusion-server-as-FQDN/dir/dev",
            "webRoot": "\\\\my-cold-fusion-server-as-FQDN\\c$\\inetpub\\wwwroot\\dir\\dev"
        }
    ]
}

I created a new file "test.cfm" (in the location \\my-cold-fusion-server-as-FQDN\c$\inetpub\wwwroot\dir\dev) and safed it with the following content:

<cfscript>
    var = "World";
    writeOutput("Hello #var#!");
</cfscript>

When I click on "Run" > "Start Debugging" in Visual Studio Code, a new Browser windows opens and displays exactly the same url (http://my-cold-fusion-server-as-FQDN/dir/dev) as specified in launch.json file.

But the file I wanted to be executed and being debugged, is not processed in the url (I expected: http://my-cold-fusion-server-as-FQDN/dir/dev/test.cfm). So additionally I am not able to debug that file using breakpoints in Visual Studio Code.

So I'm currently only able to view, modify, and safe cfm files in Visual Studio, and have to open the corresponding url to view that cfm file in my browser. But I'm not able to debug it using breakpoints in Visual Studio Code


Solution

  • Your step-debugger options right now are

    UPDATE 2022-09-20

    The official Adobe ColdFusion Builder extension for Visual Studio Code was released at the end of July 2022. They have provided a Getting Started walkthrough as well. This includes a step-debugger, but odds are it will only work with the latest and more recent versions of Adobe ColdFusion.