Running Scripts
The extension allows you run javascript scripts from the IDE Extension against the Project in which the script resides. This allows for testing and debug of scripts through your IDE.
While a script is running you will see an indicator in red in the bottom left hand corner of the IDE window.
Run a Script Without Input#
To run a script:
- Right click the script in the extension tree and select "Run Script"
- Select the name of the script in the scriptModule you want to run from the dropdown.
Run a Script with Input#
To run a script and pass it input:
- Open a new document in your IDE
- In that document create the javascript object or JSON object you want to use as input to the script
- Results from a previous script can also be used
- Highlight the lines containing the input object
- Right click the script in the extension tree and select "Run Script with Input"
- Select the name of the script in the scriptModule you want to run from the dropdown
Debugging Scripts#
You may use console logs in your scripts to help develop and debug. However, the output of console logs in your script do not show up in vs code's Debug Console. To access the console with logs from your script you can do any of the following:
Select 'Toggle Log View" in the extension menu at the top of the extension tree
Press CTRL-SHIFT-P
Type 'Developer Tools'
Select 'Developer: Toggle Developer Tools'
This will open a new window with a console log which will display the outputs from your scripts.