Skip to content
Blake edited this page Apr 11, 2026 · 3 revisions

Trainz Language Server

The core language server trainz-language-server is required for the plugins to function.

Installation

  1. Navigate to the GitHub Releases page for the current version.
  2. Download the appropriate trainz-language-server binary for your operating system.
  3. Make the file executable (on macOS/Linux: chmod +x trainz-language-server).
  4. On macOS, remove the quarantine attribute to allow the server to run: xattr -d com.apple.quarantine "trainz-language-server".
  5. Move the file to a directory in your system's PATH, or note the absolute path to configure in your IDE plugin.

VSCode

The VSCode extension for the Trainz Game Script (GS) and Soup languages provides Language Server Protocol (LSP) support.

Installation

  1. Download the VSCode extension from GitHub Releases.
  2. Open VSCode.
  3. Open the Extensions view by clicking the Extensions icon in the Activity Bar on the side of VSCode.
  4. Click the ... menu in the Extensions view and select "Install from VSIX...".
  5. Select the downloaded .vsix file.

Configuration

The extension can be configured via VSCode settings:

  • trainz-language-server.server-bin: Path to the trainz-language-server executable.
  • 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)

Requirements

  • Requires the trainz-language-server executable to be available on your system.

IntelliJ Idea

To use the Trainz plugin in IntelliJ-based IDEs:

Installation

  1. Download the IntelliJ plugin from GitHub Releases.
  2. Open your JetBrains IDE.
  3. Go to Settings (or Preferences on macOS) -> Plugins.
  4. Click the settings icon (gear) in the Plugins menu and select "Install Plugin from Disk...".
  5. Select the downloaded plugin file.
  6. 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.

LSP 4 IntelliJ

The development server is tested using the LSP4IJ plugin.

Setup

  1. Download the LSP4IJ plugin from GitHub Releases.
  2. Import the configuration files into your IDE (Select the folder) by going to File > Settings > Languages & Frameworks > Language Servers > Add Language Server.
  3. 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/scripts
  • TRAINZ_LANGUAGE_SERVER_SOUP_VALIDATION_PATH=/Users/<username>/Library/Application Support/Steam/steamapps/common/Trainz Railroad Simulator 2022/TRS22.app/Contents/Resources/validation
  1. Open a .gs or .txt file and the server will start automatically.

Clone this wiki locally