Edit With Visual Studio Code
Simulation script can be debugged through the Visual Studio Code editor. In order to make this as easy as possible, Sym3 allows you to quickly open your project’s simulation scripts in Visual Studio Code. When you edit the scripts in Visual Studio Code the changes will automatically be reflected in Sym3. Likewise, when you edit the script from Sym3 while it is open in Visual Studio Code the changes will automatically be reflected in Sym3.
To open a project in Visual Studio Code, first ensure that the project is saved. Then open the Developer ribbon and select “Edit with Visual Studio Code”. To see the settings for the Visual Studio Code integration, click the “Settings” button.
In order to edit with Visual Studio Code, Visual Studio Code must be installed. See the official website for instructions on how to download and install it.
Workspace
When Visual Studio Code opens, it will open in a folder that mirrors your projects script files.
The files ending in .js
are the simulation scripts. The extension is added so that Visual Studio Code knows they are JavaScript files. When you make changes to these files, they will update in Sym3.
The launch.json
file contains the launch settings for connecting to Sym3 when you press F5. By default it will try to connect to port 34009 on 127.0.0.1. See the settings documentation for details on how to change it – the values in the launch.json
file must match the settings in the Sym3 project.
Settings
Next to the “Edit with Visual Studio Code” button is the settings button. This allows you to edit how the Visual Studio Code integration operates. These settings are shared across all projects for the current Windows user.
Setting | Description |
---|---|
Location of the settings and scripts | Press “Open Folder” to open the directory where the workspaces and settings are stored. |
Enable Git (Version Control) | When enabled, a new git repository will be initialised when projects are opened. |
Add predefined code snippets | When enabled, a code snippet file will be added to the workspace. See the Visual Studio Code documentation for details on the format used. |
Save project automatically | When enabled, saving code changes in Visual Studio Code will cause Sym3 to save the project. |
Close Visual Studio Code | When enabled, closing Sym3 will cause Visual Studio Code to close. |
Change Visual Studio Code color | When enabled, the workspaces will cause Visual Studio Code to use a green color, to distinguish them from other Visual Studio Code windows. Your standard Visual Studio Code windows will not be affected, only ones opened from Sym3. |