Skip to content

Commit 3565a97

Browse files
Add information on enabling the Ruby LSP using builtin vim.lsp instea… (#3696)
* Add information on enabling the Ruby LSP using builtin vim.lsp instead of nvim-lspconfig * Update jekyll/editors.markdown Co-authored-by: Vinicius Stock <[email protected]> --------- Co-authored-by: Vinicius Stock <[email protected]>
1 parent f385852 commit 3565a97

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

jekyll/editors.markdown

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,43 @@ folder is used.
192192

193193
See [this issue][mason-abi] for further information.
194194

195+
### Built-In vim.lsp
196+
197+
{ .note }
198+
Ensure that you are using NeoVim 0.11 or newer.
199+
200+
You can also configure the Ruby LSP without the nvim-lspconfig plugin.
201+
Create an `lsp` directory inside your config directory and create a file `ruby-lsp.lua` inside it
202+
with the following content:
203+
204+
```lua
205+
-- on Linux and macOS the default location is ~/.config/nvim/lsp/ruby-lsp.lua
206+
return {
207+
208+
filetypes = { "ruby" },
209+
210+
cmd = { "ruby-lsp" } -- or { "bundle", "exec", "ruby-lsp" },
211+
212+
root_markers = { "Gemfile", ".git" },
213+
214+
init_options = {
215+
formatter = 'standard',
216+
linters = { 'standard' },
217+
addonSettings = {
218+
["Ruby LSP Rails"] = {
219+
enablePendingMigrationsPrompt = false,
220+
},
221+
},
222+
},
223+
}
224+
```
225+
226+
Then you need to enable it, e.g., inside `init.lua`:
227+
228+
```lua
229+
vim.lsp.enable("ruby-lsp")
230+
```
231+
195232
### Additional setup (optional)
196233

197234
`rubyLsp/workspace/dependencies` is a custom method currently supported only in the VS Code plugin.

0 commit comments

Comments
 (0)