Skip to content

Commit 7b83f21

Browse files
committed
Document use of init_options to configure LSP inside Neovim
Add example of using `init_options` to enable the Standard add-on for linting and formatting.
1 parent 47f53be commit 7b83f21

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

EDITORS.md

+16
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,22 @@ When you run `eglot` command it will run `ruby-lsp` process for you.
7272
The [nvim-lspconfig](https://github.com/neovim/nvim-lspconfig/blob/master/lua/lspconfig/server_configurations/ruby_lsp.lua)
7373
plugin has support for Ruby LSP.
7474

75+
The Ruby LSP can be configured using the `init_options` key when setting up the LSP.
76+
77+
A great example of this configuration style is enabling the Standard add-on for
78+
the Ruby LSP to enable formatting and pull-style diagnostics. The following snippet
79+
enables `standard` for both formatting and pull-diagnostic linting.
80+
81+
```lua
82+
local lspconfig = require('lspconfig')
83+
lspconfig.ruby_lsp.setup({
84+
init_options = {
85+
formatter = 'standard',
86+
linters = { 'standard' },
87+
},
88+
})
89+
```
90+
7591
### Mason
7692

7793
You can use [mason.nvim](https://github.com/williamboman/mason.nvim),

0 commit comments

Comments
 (0)