Skip to main content
erinferinferinf
Community Manager
Community Manager
June 10, 2022
Question

ExtendScript VSCode Debugger 2.0.2 Live in the VSCode Marketplace 🎉🎉

  • June 10, 2022
  • 1 reply
  • 3741 views

Version 2.0.2 of the ExtendScript Debugger plugin for Visual Studio Code is now available in the Visual Studio Marketplace! Thanks for waiting for this massive rewrite of the 1.0 Debugger, with huge improvements to host app connectivity, flexibility, speed, and best of all, the elimination of Error #15.

Our proudest accomplishments:

  • Run a script without debugger involvement.
  • Debug multiple hosts simultaneously.
  • Debug with different VS Code windows simultaneously (not the same host app, of course).
  • Run compound debug configurations (useful especially for CEP workflows).

Known issues: M1 Mac users will need to launch Visual Studio Code in Rosetta mode to see the update. Currently the Debugger is not supported on Windows ARM devices.

 

Thank you to everyone in the prerelease community who helped test this!

 

This topic has been closed for replies.

1 reply

rcraighead
Legend
June 15, 2022

Thank you for the update.
I am still new to programming and especially VSCode and do not know how to reconfigure my launch.json to gain functionality I had in v1.1.2. I've read the "Details" section most of which is still over my head. I realize all of this is elementary to a true programmer, but I (and I am guessing others in this forum) are illustrators turned scripters and it can be daunting, intimidating and descouraging at time.

Can someone show how this launch.json should be changed to function in v2.0 as it did in v1.1.2? I was able to get v2 to run a script in Illustrator but it does not stop at a set breakpoint now.

 

 

{
    "version": "0.2.0",
    "configurations": [

        {
            "type": "extendscript-debug",
            "request": "launch",
            "name": "Illustrator",
            "dontBreakOnErrors": true,
            "program": "${file}",
            // "targetSpecifier": "illustrator-24.064",
            "targetSpecifier": "illustrator-26.064",
            "stopOnEntry": false
        },
    ]
}

 

 

 

sberic
Legend
June 15, 2022

The new version's documentation has a section on migrating from V1 versions. In short, your launch configuration should look like this:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "extendscript-debug",
            "request": "launch",
            "name": "Launch in Illustrator",
            // "hostAppSpecifier": "illustrator-24.064",
            "hostAppSpecifier": "illustrator-26.064",
        },
    ]
}

You will note that I took out the "program" field. That has been renamed to "script" in V2. Regardless, I removed it because the setting "${file}" is the default functionality (it sends whatever file is focused in VS Code to the host for evaluation).

 

I also renamed the configuration to "Launch in Illustrator" to disambiguate what it's doing (the new version supports attaching as well as launching).

 

That should be it. You should be able to click the "Start Debugging" play button in the Run and Debug View and have VS Code connect to your host application and run the script you have focused. Breakpoints in the focused script should be triggered and cause the beak UI to show.

sberic
Legend
June 15, 2022

Yes the alert works. I can run a script. The debugger just doesn't engage. I also see this error message after running a script in the new configuration:

 

UPDATE:
I restarted Illustrator and the debugger started working! Thanks for your help,  @sberic .

 


Ahh, right! That can happen if the application had ever had contact with either the original ESTK or the V1 extension without getting restarted. Those two debuggers register with host applications in such a manner as to make them the exclusive debugger applications until the host application is restarted. This does not happen with V2.

 

There is a note about this issue in the General Notes:

 

  • If the ExtendScript Toolkit (ESTK) connects to a host application, then the ExtendScript Debugger extension will no longer be able to function correctly as a debugger. Restarting the host application is enough to fix this issue.

 

Hopefully your discovery and this explanation may help others who encounter a similar issue!

 

Regardless of the details, I'm glad you were able to get it working!