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

Conversation

erik-brueggemann
Copy link
Contributor

Motivation

I think it would be great to expand the existing documentation to include ruby-lsp configuration for Sublime Text. This would make it easier for Sublime Text users to enjoy the benefits of ruby-lsp.

Implementation

The documented Sublime Text LSP configiguration is based on the official documentation for configuring solargraph

Automated Tests

Not applicable because this is a change affecting documentation only.

Manual Tests

(1) shows the LSP configuration
(2) shows that ruby-lsp is picked up correctly
(3) shows a rubocop offense

CleanShot 2023-08-31 at 21 21 32@2x

@erik-brueggemann
Copy link
Contributor Author

I have signed the CLA!

EDITORS.md Outdated

## 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.

Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution!

EDITORS.md Outdated
"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.

EDITORS.md Outdated
],
"selector": "source.ruby | text.html.ruby | text.html.erb | text.html.rails",
"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
}

@erik-brueggemann
Copy link
Contributor Author

Thank you for the feedback @andyw8 and @vinistock. I addressed your comments in the latest commit 964ada9.

Copy link
Member

@vinistock vinistock left a comment

Choose a reason for hiding this comment

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

One last comment, but this looks great. Thank you for putting it together!

EDITORS.md Outdated Show resolved Hide resolved
Co-authored-by: Vinicius Stock <vinistock@users.noreply.github.com>
@vinistock vinistock enabled auto-merge (squash) September 1, 2023 18:28
@vinistock vinistock merged commit 7400dfd into Shopify:main Sep 1, 2023
15 checks passed
andyw8 pushed a commit that referenced this pull request Sep 5, 2023
* Add instructions for Sublime Text LSP

* Update Sublime Text LSP instructions

* Update EDITORS.md

Co-authored-by: Vinicius Stock <vinistock@users.noreply.github.com>

---------

Co-authored-by: Vinicius Stock <vinistock@users.noreply.github.com>
@Nakilon
Copy link

Nakilon commented May 20, 2024

How do I get the list of features? How do I disable them? For example, to disable rubocop.

@andyw8
Copy link
Contributor

andyw8 commented May 21, 2024

You can see the full list here:

document_symbol_provider = Requests::DocumentSymbol.provider if enabled_features["documentSymbols"]
document_link_provider = Requests::DocumentLink.provider if enabled_features["documentLink"]
code_lens_provider = Requests::CodeLens.provider if enabled_features["codeLens"]
hover_provider = Requests::Hover.provider if enabled_features["hover"]
folding_ranges_provider = Requests::FoldingRanges.provider if enabled_features["foldingRanges"]
semantic_tokens_provider = Requests::SemanticHighlighting.provider if enabled_features["semanticHighlighting"]
diagnostics_provider = Requests::Diagnostics.provider if enabled_features["diagnostics"]
on_type_formatting_provider = Requests::OnTypeFormatting.provider if enabled_features["onTypeFormatting"]
code_action_provider = Requests::CodeActions.provider if enabled_features["codeActions"]
inlay_hint_provider = Requests::InlayHints.provider if enabled_features["inlayHint"]
completion_provider = Requests::Completion.provider if enabled_features["completion"]
signature_help_provider = Requests::SignatureHelp.provider if enabled_features["signatureHelp"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants