← All Workshops

MudEngine Part 6: Multiplayer

Step 4 / 18

IDE support for server code

Your editor's LSP (rust-analyzer) compiles with default features — which is default = ["web"] from Cargo.toml. That means the #[cfg(feature = "server")] blocks we are about to write will be greyed out and lack code completion.

To see all code during development, add this to your Cargo.toml:

This tells rust-analyzer to enable both features regardless of which editor you use — VS Code, Zed, Neovim, Helix, or any other editor with LSP support. It has no effect on the actual build; dx serve still compiles the right targets.

mud-engine/Cargo.toml
[package.metadata.rust-analyzer]
cargo.features = ["server", "web"]
Step 4 / 18