Skip to content
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

Merged
merged 3 commits into from
Sep 1, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions EDITORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Copy link
Contributor

@andyw8 andyw8 Aug 31, 2023

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?

Copy link
Contributor Author

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.


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",
Copy link
Member

Choose a reason for hiding this comment

The 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 erb support.

So I think we can limit the selector to .rb Ruby files only for now.

"initializationOptions": {
"diagnostics": false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"diagnostics": false
{
"enabledFeatures": {
"diagnostics": false
},
"experimentalFeaturesEnabled": true
}

}
}
}
```

Restart LSP or Sublime Text and `ruby-lsp` will automatically activate when opening `.rb` or `.erb` files.