VSCode ExtendScript Debugger
Copy link to clipboard
Copied
Hi all,
I've been trying really hard to use the VSCode ExtendScript Debugger in my day-to-day development workflow.
Since the first version, it's seen some marked improvements.
It is more or less usable, but working with it is still very frustrating.
The areas I see most problems with are:
- Inspecting the variables: for unclear reasons, the variable inspection very often stops working or fails to show variables, or hangs when browsing 'into' an object. Often, a 'little spinner' starts spinning, and never stops, and no variables show.
- Trying to open certain objects by clicking the disclosure triangle does not work. I have a feeling inspecting variables in the 'Global' space is less dependable than variables in the 'Local' space.
- Sometimes the 'Local' and 'Global' variable lists get swapped. My locals suddenly get listed under 'Global' and vice versa.
- The Extension Host crashes at random times and needs to be relaunched.
My debug sessions are often long, and having to start over after stalking a complex bug for 30 minutes is very frustrating.
For me, the old ESTK is currently still more usable than the VSCode.
The problem I have is that it would be hard to file a bug report for this: none of the issues that make it hard to use are repeatable. The issue is just a general 'unstableness'.
Is this currently being tackled, or should I file some sort of bug report?
Copy link to clipboard
Copied
Thanks for the feedback, Kris!
I'm asking around about the best place to track this stuff...
Best,
Erin
Copy link to clipboard
Copied
Hi, Can you try the following:
1. Put up a `"trace": true` in launch configuration file and share the logs that appear in `Debug Console`. It will help in the investigation of issue#1,2,3 that you have mentioned.
2. Regarding crash: in which mode you are using the extension(See: ExtendScript Debugger - Visual Studio Marketplace `extensionMode` configuration)? Default is `active`. If you are using `active` mode, can you try using `passive` and see if it helps with crash?
Copy link to clipboard
Copied
Thanks for that. Next time I am caught in a debugging session, I'll try those things!
Copy link to clipboard
Copied
Hi Arun,
I've tried that, but it makes the VSCode extension unusable for me. It starts spewing a lot of info into the debug console, and ends with
'Get Frame Timeout.'
And then everything locks up.
I can stop my script, but I am unable to run it in the debugger. I think the 'trace' mode is overwhelming for VSCode to handle
{"0":"[1563493462352] prepareSession Target connected. Starting session."}
[1563493462352] prepareSession Target connected. Starting session.
{"0":"<break flags=\"0\" engine=\"com.siliconpublishing.inDesignESDriverSnippets\"><stack><frameinfo>[buildInDesignFiles.jsx]</frameinfo></stack><frame file=\"~/Documents/Controlled/SiliconPublishing/ExportQXP/ExportQXP/tools/buildInDesignFiles.jsx\" line=\"22\" type=\"script\"><source><![CDATA[\n// Run this script in InDesign\n\n//@targetengine com.siliconpublishing.inDesignESDriverSnippets\n\nmain.SCRIPT_NAME = \"buildInDesignFiles\";\nmain.RELATIVE_PATH_TO_FRAMEWORK_ROOT = \"/../\";\nmain.DEBUG = true;\nmain.FORCE_RESET_MODULES = true; // Can set this to false in production code\nmain.LOG_TO_FILE = true;\nmain.LOG_TO_CONSOLE = false;\nmain.LOG_TO_SOCKET = false;\nmain.LOG_TO_WEB_SOCKET = false;\nmain.LOG_LEVEL = 3;\nmain.LOG_ENTRY_EXIT = false;\nmain.HOT_FOLDER_RELATIVE_FROM_HOME = \"Dropbox/Tunnel_VMs/dolly-mojave/exportqxp/\"\nmain.OVERWRITE_EXISTING_INDD
... SNIP ...
else {\n debugger; // TODO\n }\n systemEnvironment.loadScript = app.importScript;\n }\n\n return systemEnvironment;\n}\n\n})();\n\n}\n\n// -- \n\nROOT.main();\n]]></source></frame><profiling/></break>"}
Get Frame Timeout.
Copy link to clipboard
Copied
Hmm... It's flakey. After a few InDesign/VSCode quit/restarts/killall, it suddenly works again. At the moment, I do get trace info.
Copy link to clipboard
Copied
Ok, captured an oddity. The screenshot shows that 'Global' and 'Local' are reversed. But I think the trace info seems to indicate that the data being received is not reversed, so something in the display logic seems to go wrong.
Trace info:
{"0":"<properties object=\"\" engine=\"com.siliconpublishing.inDesignESDriverSnippets\"><value type=\"Object\" name=\"this\" readonly=\"true\"><![CDATA[[object Object]]]></value><property type=\"string\" name=\"in_path\" state=\"new\"><![CDATA[/Users/kris/Dropbox/Tunnel_VMs/dolly-mojave/exportqxp/FV CPMP3 L/FV CPMP3 L_2.jsx]]></property></properties>"}
{"0":"<trace>[1563497466021] sendVariableRequest Successful.</trace>"}
[1563497466021] sendVariableRequest Successful.
{"0":"<properties object=\"$.global\" engine=\"com.siliconpublishing.inDesignESDriverSnippets\"><property type=\"Application\" name=\"app\" state=\"\" readonly=\"true\"><![CDATA[[object Application]]]></property><property type=\"error\" name=\"incopy14\" state=\"\"><![CDATA[No documents are open.]]></property><property type=\"Array\" name=\"apps\" state=\"\"><![CDATA[aftereffects-16.0,ame-13.0,ame-6.0,ame-7.0,bridge-5.064,bridge-9.064,dreamweaver-19.1,estoolkit-3.8,estoolkit-4.0,exman-6.0,illustrator-16.064,illustrator-17.064,illustrator-18.064,illustrator-19.064,illustrator-20.064,illustrator-21.064,illustrator-22.064,illustrator-23.064,incopy-14.064,indesign-10.064,indesign-11.064,indesign-12.064,indesign-13.064,indesign-14.064,indesign-8.0,indesign-9.064,indesignserver-13.0,photoshop-130.064,premierepro-13.0,switchboard-2.0]]></property><property type=\"Object\" name=\"incopy\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"tempPSVersionInfo\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"photoshop\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"photoshop110\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"bridge9\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"bridge\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"aftereffects16\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"aftereffects\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"illustrator\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"indesign11\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"indesign\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"indesign13\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"indesign14\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"indesign10\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"indesign12\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"ROOT_CONVERSION\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"ROOT_MAIN\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"ROOT\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Object\" name=\"JSON\" state=\"\"><![CDATA[[object Object]]]></property><property type=\"Enumeration\" name=\"MeasurementUnits\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"number\" name=\"NaN\" state=\"\"><![CDATA[NaN]]></property><property type=\"number\" name=\"Infinity\" state=\"\"><![CDATA[Infinity]]></property><property type=\"Enumeration\" name=\"SaveOptions\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"RulerOrigin\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"DocumentIntentOptions\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"ColorSpace\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"ColorModel\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"Leading\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"Justification\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"CoordinateSpaces\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"AnchorPoint\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"FitOptions\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"PathType\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"CornerOptions\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property><property type=\"Enumeration\" name=\"Position\" state=\"\" readonly=\"true\"><![CDATA[[object Enumeration]]]></property></properties>"}
{"0":"<trace>[1563497466069] sendVariableRequest Successful.</trace>"}
[1563497466069] sendVariableRequest Successful.
Copy link to clipboard
Copied
Thanks buddy! Now I know where to watch all the variables when debugging.
Copy link to clipboard
Copied
After the two areas reversed, the extension host crashed.
And after that, the variables inspector stopped updating: it keeps on showing invalid data. There is no additional trace info that appears.
I had to quit everything, do a killall "Code Helper".
Then tried some more, and that killed the extension host again. Nothing in the trace data.
I also noticed that simply moving the mouse over the source code automatically tries to evaluate 'stuff' it sees in the source code, and so there is a constant 'chatter' going on in the trace as I move the mouse over the source code during a debug session.
Could that cause some conflicts and stuff that gets mixed up?
Copy link to clipboard
Copied
This ExtendScript code is large, and it seems to be way beyond what VSCode/ES can chew. In ESTK I have no trouble debugging this (except for the 'knows issues' - i.e. inadvertent 'mumble mode').
Copy link to clipboard
Copied
I wanted to add my current perception of where things are at with the VS Code ES debugger.
My situation is that I am often called in to look at complex issues and interactions between scripts, apps, extensions...
My go-to tool for script debugging/analyzing was and still is ESTK.
I've been trying really hard to use VSCode + ES Debugger as a replacement. There is a lot riding on this.
But as it is, it just does not cut it for me. Each time I try VSCode + ES Debugger for my line of work, I come back frustrated - more frustrated than I get when I need to use ESTK on a Mac.
The main issues are: lack of stability, and lack of features. The scripts I work on are large (over 50K lines is very common). VSCode + ES Debugger does not seem to be able to handle that and it hangs, crashes, misbehaves all the time. ESTK on Windows still handles this wonderfully well.
I also use ESTK's profiling a lot for optimization. I might be wrong, but I don't think VSCode + ES has any of that.
My personal opinion is that the VSCode + ES Debugger might be taking the wrong approach. As far as I can tell there are multiple layers of software, and some of these layers have asynchronous coupling with the layers below. That asynchronicity is asking for trouble.
At the moment, my 'goto' tool is to use ESTK on Windows. That still runs quite nicely.
My current message: ESTK is still crucial to the work I do. VSCode + ES Debugger is still far from becoming a replacement. If ESTK goes away, I don't think I can do my job properly any more.
Copy link to clipboard
Copied
Colleagues,
I agree with everything Kris said. VSCode ES support is nowhere near where it needs to be for serious work.
Thanks,
Ole