This extension for the Zed editor adds support for running Standard Ruby as a language server.
- Install the Rust toolchain via
rustup
- Clone the repo via
git clone https://github.com/himynameisjonas/zed-standardrb.git
- Launch Zed and to go to Extensions
- Click the "Install Dev Extension" button (top right)
- Select the directory you cloned the repo into
- Wait a moment while Zed compiles the extension
First, install the standard
gem, either via gem install standard
or by adding it to your Gemfile:
gem "standard", require: false, group: :development
Next, launch Zed, press Command + , to open Settings, and change the language server for Ruby:
{
"languages": {
"Ruby": {
"language_servers": ["standardrb"]
}
}
}
Here's a slightly more elaborate Zed config that uses Shopify's Ruby LSP as the primary language server, with auto-formatting and diagnostics handled by Standard Ruby.
{
"languages": {
"Ruby": {
"language_servers": ["ruby-lsp", "standardrb", "!rubocop", "!solargraph"],
"formatter": "language_server",
"format_on_save": "on"
}
},
"lsp": {
"ruby-lsp": {
"initialization_options": {
"enabledFeatures": {
"diagnostics": false, // Zed currently doesn't support Ruby LSP's pull-based diagnostics
"formatting": true
},
"formatter": "standard"
}
},
"standardrb": {
"initialization_options": {
"enabledFeatures": {
"diagnostics": true,
"formatting": false // Because we use Standard Ruby's formatting via Ruby LSP
}
}
}
}
}