DVT IDE for VS Code VHDL User Guide
Rev. 22.1.36, 22 November 2022

27.2 Environment Variables

The preference DVT.environment.variables allows you to create or overwrite environment variables. The resulting environment variables are computed according to DVT.environment.precedence preference and will be used during the extension's runtime, for running Language Servers and tasks or as environment for terminals.

Define Variables

To define a new environment variable, simply add a new entry in the DVT.environment.variables preference.

How is the Environment Computed

The environment is computed based on the value of DVT.environment.precedence preference:

  • Settings environment variables: the variables defined in DVT.environment.variables will overwrite any variables found in the native environment.

  • Native environment variables: new variables will be added only if they are not found in the native environment.

For tasks and terminals, the VS Code's native environment is defined by: terminal.integrated.env.{linux,windows,osx} preference applied over VS Code process environment, while for the rest is defined by only the process environment.

Example:

 DVT.environment.precedence = "Native environment variables"

 Native Environment:
   DVT_PROJECT_ROOT = /home/dvt/projects

 DVT.environment.variables
   DVT_PROJECT_ROOT = /home/dvt/other_projects

The value of DVT_PROJECT_ROOT will be "/home/dvt/projects".

Note: When DVT.environment.precedence is set to "Settings environment variables", the DVT.license.source preference has precedence over the value of DVT_LICENSE_FILE set in DVT.environment.variables.

Use Case

The VS Code Remote - SSH extension allows you to open a folder located on any machine that has a running SSH server. The typical use case is running the VSCode UI on a Windows machine and connecting to a Linux server machine. The environment variables on the remote machine are not inherited from the machine where you started VS Code. To maintain the consistency of the environment, you can use the DVT.environment.variables preference to predefine variables of interest.