Repository navigation
Usage
Blake edited this page Apr 11, 2026
·
3 revisions
The core language server trainz-language-server is required for the plugins to function.
- Navigate to the GitHub Releases page for the current version.
- Download the appropriate
trainz-language-serverbinary for your operating system. - Make the file executable (on macOS/Linux:
chmod +x trainz-language-server). - On macOS, remove the quarantine attribute to allow the server to run:
xattr -d com.apple.quarantine "trainz-language-server". - Move the file to a directory in your system's PATH, or note the absolute path to configure in your IDE plugin.
The VSCode extension for the Trainz Game Script (GS) and Soup languages provides Language Server Protocol (LSP) support.
- Download the VSCode extension from GitHub Releases.
- Open VSCode.
- Open the Extensions view by clicking the Extensions icon in the Activity Bar on the side of VSCode.
- Click the
...menu in the Extensions view and select "Install from VSIX...". - Select the downloaded
.vsixfile.
The extension can be configured via VSCode settings:
-
trainz-language-server.server-bin: Path to thetrainz-language-serverexecutable. -
trainz-language-server.validation-path: Path to the Trainz Validation files. (E.g./Users/<username>/Library/Application Support/Steam/steamapps/common/Trainz Railroad Simulator 2022/TRS22.app/Contents/Resources/validation) -
trainz-language-server.search-paths: Path to additional Trainz GS include files. (E.g./Users/<username>/Library/Application Support/Steam/steamapps/common/Trainz Railroad Simulator 2022/TRS22.app/Contents/Resources/scripts)
- Requires the
trainz-language-serverexecutable to be available on your system.
To use the Trainz plugin in IntelliJ-based IDEs:
- Download the IntelliJ plugin from GitHub Releases.
- Open your JetBrains IDE.
- Go to
Settings(orPreferenceson macOS) ->Plugins. - Click the settings icon (gear) in the
Pluginsmenu and select "Install Plugin from Disk...". - Select the downloaded plugin file.
- Click Install and restart the IDE if prompted.
Note
The plugin automatically installs the required trainz-language-server executable, so manual installation is not required.
The development server is tested using the LSP4IJ plugin.
- Download the LSP4IJ plugin from GitHub Releases.
- Import the configuration files into your IDE (Select the folder) by going to
File > Settings > Languages & Frameworks > Language Servers > Add Language Server. - Configure the environment variables to match your install
TRAINZ_LANGUAGE_SERVER_SCRIPT_SEARCH_PATHS=/Users/<username>/Library/Application Support/Steam/steamapps/common/Trainz Railroad Simulator 2022/TRS22.app/Contents/Resources/scriptsTRAINZ_LANGUAGE_SERVER_SOUP_VALIDATION_PATH=/Users/<username>/Library/Application Support/Steam/steamapps/common/Trainz Railroad Simulator 2022/TRS22.app/Contents/Resources/validation
- Open a
.gsor.txtfile and the server will start automatically.