Skip to content

Commit f4798f8

Browse files
authored
Updated launch.json recommendation for version 2 of the debugger
Changed the instructions for running the debugger now that version 2 is released. Not 100% sure if it's all correct, thsi could be just "what works for me".
1 parent 6881baa commit f4798f8

File tree

1 file changed

+15
-36
lines changed

1 file changed

+15
-36
lines changed

docs/vscode-debugger/getting-started-with-vscode-debugger.rst

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -57,51 +57,30 @@ In your project directory:
5757
- paste in the following code
5858
::
5959

60-
{
60+
{
6161
"version": "0.2.0",
62-
"configurations": [
63-
{
64-
"type": "extendscript-debug",
65-
"request": "launch",
66-
"name": "Run Current Script",
67-
"program": "${file}",
68-
"stopOnEntry": false,
69-
"excludes": [
70-
"undefined",
71-
"builtin",
72-
// "Function",
73-
"prototype"
74-
],
75-
}
62+
"configurations": [
63+
{
64+
"type": "extendscript-debug",
65+
"request": "attach",
66+
"name": "extendScript-Debug attach",
67+
}
7668
]
77-
}
78-
79-
- this will let you run the debugger on the *currently open file*
80-
- it also keeps functions included in the default object browser during breakpoints, which are otherwise excluded
81-
82-
If you wanted to run a task on a specific file, not necessarily the currently-open one, you'd replace the `program` entry with something like:
83-
84-
- For a specific script::
85-
86-
"${workspaceFolder}/path/to/my/script.jsx"
87-
88-
- To be prompted for the filename / path to a jsx folder::
89-
90-
"${workspaceFolder}/${command:AskForScriptName}"
91-
92-
--------------------------------------------------------------------------------
93-
94-
.. _attaching-the-debugger:
69+
}
9570

71+
This creates a config for VSCode's debugger that attaches to the host app of your choice.
72+
9673
Attaching the debugger
9774
----------------------
9875

9976
Once the extension is installed:
10077

10178
- Open a JS workspace
10279
- Launch your Adobe app of choice
103-
- At the bottom of your VS Code window, at the far right of the status bar, you should see 'Select the target application' glowing yellow
104-
- Click this and pick the application you want to debug for
80+
- Select the run and Debug tab from the sidebar or hit Ctrl+Shift+D, then in the drop-down menu choose "extendScript-Debug attach"
81+
- Choose the host app from the drop-down that appears
82+
83+
The bottom Status bar will turn orange indicating that the debugger is now attached to the host app. You can use the debug console to evaluate commands and query variables, even if a script is not running.
10584

10685
--------------------------------------------------------------------------------
10786

@@ -112,7 +91,7 @@ Running the debugger
11291

11392
Once you've set up your environment and built your script:
11493

115-
- In VS Code, Debug > Start Debugging > 'Run Current Script' (or the task name you specified in :ref:`creating-a-debug-launch-task`
94+
- Click on the status bar button labelled "▷ Eval in `host app name`" to launch the current script, or use the command pallette and choose `ExtendScript - Evaluate Script In Attached Host`.
11695
- If the script throws any errors, you'll be able to view variables & a call stack
11796

11897
.. note::

0 commit comments

Comments
 (0)