Skip to content

feat: add sorbet Ruby LSP server option#9

Closed
notchairmk wants to merge 1 commit intozed-extensions:mainfrom
notchairmk:notchairmk/add-sorbet
Closed

feat: add sorbet Ruby LSP server option#9
notchairmk wants to merge 1 commit intozed-extensions:mainfrom
notchairmk:notchairmk/add-sorbet

Conversation

@notchairmk
Copy link
Contributor

Adds Sorbet's LSP as an additional Ruby language server option.

These are the listed server capabilities

{
  "textDocumentSync": 1,
  "hoverProvider": true,
  "completionProvider": {
    "triggerCharacters": [
      ".",
      ":",
      "@",
      "#"
    ]
  },
  "definitionProvider": true,
  "typeDefinitionProvider": true,
  "implementationProvider": true,
  "referencesProvider": true,
  "documentHighlightProvider": true,
  "documentSymbolProvider": true,
  "workspaceSymbolProvider": true,
  "codeActionProvider": {
    "codeActionKinds": [
      "quickfix",
      "source.fixAll.sorbet",
      "refactor.extract",
      "refactor.rewrite"
    ],
    "resolveProvider": true
  },
  "documentFormattingProvider": false,
  "renameProvider": {
    "prepareProvider": true
  }
}
image

@cla-bot
Copy link

cla-bot bot commented Nov 1, 2024

We require contributors to sign our Contributor License Agreement, and we don't have @notchairmk on file. You can sign our CLA at https://zed.dev/cla. Once you've signed, post a comment here that says '@cla-bot check'.

@notchairmk
Copy link
Contributor Author

@cla-bot check

@cla-bot cla-bot bot added the cla-signed label Nov 1, 2024
@cla-bot
Copy link

cla-bot bot commented Nov 1, 2024

The cla-bot has been summoned, and re-checked this pull request!

@vitallium
Copy link
Collaborator

@notchairmk Thanks for the pull request! I think for specific things like sorbet, it would make sense to have it as a separate extension since they have specific uses. I can help you with creating a separate extension for the sorbet LSP if you want. For instance, we did the same thing with the extension for the HAML template language.

@notchairmk
Copy link
Contributor Author

Thanks for the info @vitallium. Broke it out into a separate extension and opened up zed-industries/extensions#1657

@notchairmk
Copy link
Contributor Author

Closing since the Sorbet extension's been merged

@notchairmk notchairmk closed this Nov 13, 2024
@vitallium
Copy link
Collaborator

@notchairmk thanks! I will be using it! ❤️

@andyw8
Copy link
Contributor

andyw8 commented Jun 2, 2025

Should this decision be reconsidered since Steep is being added in #102 ?

@vitallium
Copy link
Collaborator

Should this decision be reconsidered since Steep is being added in #102 ?

Sure, I think it’s really up to @notchairmk. At first, I was a bit skeptical about adding sorbet or steep, but I was kinda wrong. Now, I actually think it’d be awesome to have both language servers available to give a solid Ruby experience, especially with the nice improvements we've made around detecting the right startup configurations for language servers.

@notchairmk
Copy link
Contributor Author

I'd be happy to revive this. I do want to note though that issues like notchairmk/zed-sorbet#6 will still keep showing up.

vitallium added a commit that referenced this pull request Jun 8, 2025
Redo for #9 (unable to reopen after force-pushing to the branch for the
original PR).

This adds Sorbet's LSP as an additional Ruby language server option and
would take precedent over https://github.com/notchairmk/zed-sorbet.

In it's current state issues like notchairmk/zed-sorbet#6 will still be
present. In addition, without `get_executable_args` being worktree-aware
(and the extension being able to supply default args) the sorbet binary
for a repo missing config at `sorbet/config` will fail to initiate. The
workaround in zed-sorbet was to just supply empty config if that file is
missing and allow for file-local errors.

These are the listed server capabilities
```json
{
  "textDocumentSync": 1,
  "hoverProvider": true,
  "completionProvider": {
    "triggerCharacters": [
      ".",
      ":",
      "@",
      "#"
    ]
  },
  "definitionProvider": true,
  "typeDefinitionProvider": true,
  "implementationProvider": true,
  "referencesProvider": true,
  "documentHighlightProvider": true,
  "documentSymbolProvider": true,
  "workspaceSymbolProvider": true,
  "codeActionProvider": {
    "codeActionKinds": [
      "quickfix",
      "source.fixAll.sorbet",
      "refactor.extract",
      "refactor.rewrite"
    ],
    "resolveProvider": true
  },
  "documentFormattingProvider": false,
  "renameProvider": {
    "prepareProvider": true
  }
}
```

<img width="802" alt="image"
src="https://github.com/user-attachments/assets/b13e2cb0-b0f1-4d85-a51b-136435004263">

---------

Co-authored-by: Vitaly Slobodin <vitaliy.slobodin@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants