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".
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:
- Go to the Extensions tab (
Ctrl+Shift+X
) on the Activity Bar - Scroll down to the sa-vscode extension
- Click on the cogwheel and choose "Extension 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:
- Click "Edit in settings.json" under "Sa Engine: Load_dir" in the extension settings
- 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.
Some of the settings available are described in the following table:
SA Engine Startup Setting | Description |
---|---|
custom_flags | List of input parameters to SA Engine |
load_files | List of files to load when SA Engine starts |
SA_HOME | Set 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
.
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
.
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"
}