Repository navigation
Development
Cethric edited this page Apr 11, 2026
·
1 revision
This document provides guidance on building the trainz-language-server from source and configuring it for local development and testing with the LSP4IJ plugin.
The trainz-language-server is written in Rust. Ensure you have the Rust toolchain installed.
- Navigate to the root of the
trainz-language-serverrepository. - Build the project in release mode to generate the binary:
cargo build --releaseThe compiled binary will be located at target/release/trainz-language-server.
To test the language server locally within IntelliJ IDEA using the LSP4IJ plugin:
- Install the LSP4IJ Plugin: Ensure the LSP4IJ plugin is installed in your IntelliJ IDEA instance.
-
Configure the Server:
- Go to
File > Settings > Languages & Frameworks > Language Servers. - Add a new language server configuration.
- Set the Command to the absolute path of your locally built
trainz-language-serverbinary (e.g.,/path/to/your/trainz-language-server/target/release/trainz-language-server). - Ensure the Extension is set to
gsortxt(as appropriate for Trainz files).
- Go to
-
Run and Test:
- Open a Trainz project containing
.gsor.txtfiles in IntelliJ. - The LSP4IJ plugin should detect the server configuration and start the language server.
- You can verify the connection in the IDE logs (usually found in
Help > Show Log in Files).
- Open a Trainz project containing
For general development tasks within the trainz-language-server repository:
-
Build:
cargo build -
Test:
cargo test -
Check:
cargo check -
Format:
cargo fmt -
Lint:
cargo clippy