Skip to main content

Configuration

Restart SA Engine

To restart the SA Engine instance you open the Command Pallette (Ctrl+Shift+P) and select "SA Engine: Restart current SA Engine".

Restart SA Engine with "SA Engine: Restart current SA Engine" in the Command Pallette.

SA Engine does not restart?

Sometimes after having made changes to configuration files, SA Engine restart might not work. If you feel that you have provided correct settings but your changes do not take effect after restarting SA Engine, then restarting Visual Studio Code should fix the problem.

Extension settings

To access the SA VSCode settings:

  1. Go to the Extensions tab (Ctrl+Shift+X) on the Activity Bar
  2. Scroll down to the sa-vscode extension
  3. Click on the cogwheel and choose "Extension settings"

SA VSCode settings.

By clicking "Edit in settings.json" you get to the settings.json where you can specify various settings.

Set SA Engine binary

To specify which SA Engine binary the VSCode extension should run:

  1. Click "Edit in settings.json" under "Sa Engine: Load_dir" in the extension settings
  2. Write the path to the SA Engine bin folder in "saEngine.load_dir": "" (you need to escape "\" in Windows paths)

SA Engine startup settings

You can specify some startup settings for SA Engine that will take effect whenever you restart the SA Engine instance. The settings need to be specified in a JSON file .sa_startup.json, and the file needs to be in the root folder for your current Visual Studio Code workspace.

SA Engine startup settings file in the workspace root folder.

Some of the settings available are described in the following table:

SA Engine Startup SettingDescription
custom_flagsList of input parameters to SA Engine
load_filesList of files to load when SA Engine starts
SA_HOMESet custom SA_HOME folder

Pass input parameters to SA Engine

You can use the setting custom_flags to pass input parameters to SA Engine.

For example, the following runs OSQL code that creates a function foo() at startup:

{
"custom_flags": ["-o", "create function foo() -> charstring as 'Hello';"]
}

In the figure below we see that the function foo() was created at startup by setting custom flags in .sa_startup.json.

Set custom flags for SA Engine by setting "custom_flags" in .sa_startup.json.

Load OSQL files on startup

You can use the setting load_files to load OSQL files when SA Engine starts.

For example, the following loads the file start.osql at startup:

{
"load_files": ["start.osql"]
}

In the figure below we see that the file start.osql was loaded at startup by setting load_files in .sa_startup.json.

Load OSQL files on startup setting "load_files" in .sa_startup.json.

Set custom SA_HOME folder

You can use the setting SA_HOME to specify which folder you want to use as your SA_HOME.

For example, the following sets the SA_HOME folder to the SA/ folder in the workspace directory:

{
"SA_HOME": "SA"
}