Using VS Code

From SysCAD Documentation
(Redirected from VS Code)
Jump to navigation Jump to search

Navigation: User Guide ➔ Editors and Utilities ➔ VS Code

Related Links: PGMs, PGM Introduction


SysCAD provides an extension package that can be used within Microsoft VS Code Editor for syntax highlight and automatic code snippets. Both SysCAD Control Program files - PGM and MP are supported in this extension. This is an alternative to Notepad++. Available from Build 139.32530.


VS Code is a rich and versatile code editor (see offering many features and extensions supporting a large number of code languages, themes, add-ons, git integration, etc. SysCAD PGM files can now be edited and managed directly from VS Code.


  1. The following instructions are valid for VS Code version 1.72.0 or newer
  2. Please download the latest version of VS Code from

SysCAD PGM VS Code Extension Features

VS Code is a feature rich editor, highly customisable and always adding more functionality thanks to its modular extension-based and community driven architecture. It would be impossible to list all the features and benefits of using VS Code as editor for SysCAD PGM language. However, some specific features included in the SysCAD-PGM extension are:

  1. Language grammar syntax highlight: automatic colouring of recognised tokens: variable types, functions, comments, etc.
  2. Code snippets for multiple functions: if, if-else, while statements, etc.
  3. Auto-complete for SysCAD keywords and functions
  4. Selectable colouring theme and overall look and feel, typical Light and Dark themes but many more are available to be added.

For example, the default Dark+ and Light+ Themes are shown below:

Syntax Highlighting and Themes

pgm highlighting Dark+ Theme

pgm highlighting Light+ Theme

Code Snippets

Code Snippet Sample If Statement Dark+ theme

Code Snippet Sample While Statement Light+ theme

Installing SysCAD PGM VSCode Extension

Step 1: Install MS Visual Studio Code

If you have not installed VSCode already, please download and install from:

Step 2: Install SysCAD PGM language VS Code Extension

SysCAD PGM language extension is included with SysCAD distribution as a compiled vsix file: syscad-pgm-X.X.X.vsix
The default location of the installation script for the VSCode extension is here: C:\SysCADxxx\Setup\VSCode_PGM_Extension\
This might vary depending on where your local copy of SysCAD was installed, therefore look for the \Setup\VSCode_PGM_Extension\ folder in your local installation.

  1. Double click on the SysCAD PGM extension installation script: syscad-pgm.cmd
  2. Open VSCode and verify that the extension has been installed successfully
SysCAD-PGM VSCode Extension Installed

Alternatively, the extension can be installed manually by:

  1. Opening a windows command prompt (Start / Command)
  2. Navigating to the folder where the extension (vsix file) is saved. For example by typing: cd C:\SysCAD139\Setup\Setup\VSCode_PGM_Extension
  3. Run the following command: code --install-extension syscad-pgm-1.0.0.vsix

Note: This assumes the name of the extension is for version 1.0.0, replace the correct name as needed.

Step 3: Set VSCode as default editor in SysCAD

  • Open SysCAD General Options and set VSCode as the default PGM editor:
Setting up VSCode as default editor for PGM files

Note: VS Code is normally installed in your local user account. Make sure to specify the correct user name.

  • Click on Select, next to the path for PGM or Text editors and select the default (Code) or your preferred editor. SysCAD will attempt to autodetect the correct path for editors that are installed in your system.

Customising SysCAD PGM VSCode Extension

Changing Colouring Theme

Change VS Code theme colouring by selecting: File / Preferences / Theme / Color Theme or type Ctrl+K Ctrl+T and select the Theme of your choice. We recommend use of "Dark+".

Enabling / Disable Code Snippets

To disable/enable code snippets

  1. Open a SysCAD-PGM file
  2. Open the command palette: View / Command Palette or press F1
  3. Type: Insert Snippet and press enter
  4. Select a snippet from the list or start typing the name of the snippet
  5. Click on the eye icon next to the snippet to make it hidden.
SysCAD-PGM extension, hiding snippets


Problems installing SysCAD-PGM Extension

Depending on your environment or previously installed version of VSCode or even previously installed SysCAD-PGM extensions, there might be situations where the extension is not automatically installed.
To view the detailed log and result of the installation script, do the following:

  1. Make sure you have the latest Syscad-PGM extension distribution file
  2. In a Windows File Explorer window, navigate to the folder where the extension and the installation script are saved. For example: 'C:\SysCAD139\Setup\Setup\VSCode_PGM_Extension
  3. Run the verbose installation script by double click on: syscad-pgm-verbose.cmd
SysCAD-PGM VSCode extension installation script

You will see the output of the script, finalising with and Exit code, as shown above.
If the Exit code is different from 0, then the SysCAD-PGM extension was not installed. Here is a list of exit codes and the reason why the installation did not proceeded:

SysCAD-PGM extension install script Exit codes
Exit code Description Solution
0 Installation Successful
1 VS Code is not installed Check if VS Code is installed. if not, please install
2 VS Code version incompatible Minimum VS Code required is 1.72.0, please update
3 VS Code version could not be determined Check minimum VS Code version and update if necessary
4 SysCAD-PGM extension file (.vsix) not found Make sure extension file is saved in the same folder as installation script
5 SysCAD-PGM extension could not be installed by VS Code Try to install extension manually and look at the error messages
-1 An earlier or equal version of SysCAD-PGM extension already installed This is a warning only. If necessary to install an older version of the SysCAD-PGM extension, please install it manually
-2 VS Code is not installed This is a warning only. This exit code is issued when --help option is used and only usage options are displayed

For more options using the installation script, do the following:

  1. Open a Windos Command Line Terminal (Start menu and type cmd) and navigate to the folder where the extension and the installation script are saved. For example: 'cd C:\SysCAD139\Setup\Setup\VSCode_PGM_Extension
  2. Run the installation script with the following option: syscad-pgm.cmd --help
SysCAD-PGM VSCode extension installation script help