-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add instructions for Sublime Text LSP #962
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -9,6 +9,7 @@ new H2 header in this file containing the instructions. --> | |||||||||||||||
- [Emacs LSP Mode](https://emacs-lsp.github.io/lsp-mode/page/lsp-ruby-lsp/) | ||||||||||||||||
- [Emacs Eglot](#Emacs-Eglot) | ||||||||||||||||
- [Neovim LSP](#Neovim-LSP) | ||||||||||||||||
- [Sublime Text LSP](#sublime-text-lsp) | ||||||||||||||||
|
||||||||||||||||
## Emacs Eglot | ||||||||||||||||
|
||||||||||||||||
|
@@ -78,3 +79,26 @@ require("lspconfig").ruby_ls.setup({ | |||||||||||||||
end, | ||||||||||||||||
}) | ||||||||||||||||
``` | ||||||||||||||||
|
||||||||||||||||
## Sublime Text LSP | ||||||||||||||||
|
||||||||||||||||
[LSP for Sublime Text](https://github.com/sublimelsp/LSP) has built-in support for [Solargraph](https://lsp.sublimetext.io/language_servers/#solargraph) and [Sorbet](https://lsp.sublimetext.io/language_servers/#sorbet) | ||||||||||||||||
|
||||||||||||||||
To add ruby-lsp support, add the following configuration to your LSP client configuration: | ||||||||||||||||
|
||||||||||||||||
```json | ||||||||||||||||
"clients": { | ||||||||||||||||
"ruby-lsp": { | ||||||||||||||||
"enabled": true, | ||||||||||||||||
"command": [ | ||||||||||||||||
"ruby-lsp" | ||||||||||||||||
], | ||||||||||||||||
"selector": "source.ruby | text.html.ruby | text.html.erb | text.html.rails", | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't support any file extensions other than Ruby yet. For example, we haven't worked on adding So I think we can limit the selector to |
||||||||||||||||
"initializationOptions": { | ||||||||||||||||
"diagnostics": false | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
``` | ||||||||||||||||
|
||||||||||||||||
Restart LSP or Sublime Text and `ruby-lsp` will automatically activate when opening `.rb` or `.erb` files. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👋 Would it be feasible to open on a PR
sublimelsp
to add built-in support for Ruby LSP, rather than having people manually configure it?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Love the idea, would make things easier - I think the wording might have been a bit misleading here I admit. The Sublime Text LSP documentation already includes instructions for solargraph & sorbet, but people still need to configure those manually as well.