sorbet
sorbet copied to clipboard
[LSP]Sorbet's language server requires a single input directory
Input
srb tc --lsp
root directory contains a rbi folder
Observed output
error msg: Sorbet's language server requires a single input directory.
use srb tc --lsp --no-config --verbose
, seems rbi folder are implicit add to input directory
Expected behavior
can launch lsp
Assuming you mean that gems with an rbi/
directory cause the LSP to break, I think this is fixed by #2730?
I'm seeing this too.
Here as well. Had it first on a previous version (can't remember), and then today when upgraded to 0.5.6205. Reverting back to 0.5.6101 fixed it, for now.
I'm trying to use it with this extension for VSCode danhuynhdev/sorbet-lsp, and still see this error. Sobet version in bundle is sorbet (0.5.6307)
.
I'm seeing this issue as well, both in the gem that has the rbi/
directory and a gem that pulls it in as a dependency.
Bump. Seeing the same error while trying to get it working with Vim + ale
.
I'm seeing this problem too. I have a gem with rbi
directory (needed to make typings work), but with --lsp, it fails.
I must point out that being able to add multiple directories to the configuration is very important, I think the --lsp
option should keep supporting multiple directories. Is this possible?
Does --ignore
support wildcards?
With 7 confirmations (and add mine as 8th), I think it'd be appropriate to remove the Unconfirmed
tag so this can get some love.
You can add mine as a 9th as well :)
10th here :)'
[T1370776][2022-06-04T20:43:54.870956] Debug logging enabled
[T1370776][2022-06-04T20:43:54.871546] Running sorbet version 0.5.10072 git acd0957d9c1489a987a616cb9f191b27d8f4aa7e debug_symbols=true clean=1 with arguments: /Users/ivan/.asdf/installs/ruby/2.7.4/lib/ruby/gems/2.7.0/gems/sorbet-static-0.5.10072-universal-darwin-21/libexec/sorbet --lsp --no-config --verbose @/Users/ivan/.cache/sorbet/gem-rbis/ffe89af5cf4d755db2851d0822a738dd
[T1370776][2022-06-04T20:43:54.886741] Starting sorbet version 0.5.10072 git acd0957d9c1489a987a616cb9f191b27d8f4aa7e debug_symbols=true clean=1 in LSP server mode. Talk ‘\r\n’-separated JSON-RPC to me. More details at https://microsoft.github.io/language-server-protocol/specification.If you're developing an LSP extension to some editor, make sure to run sorbet with `-v` flag,it will enable outputing the LSP session to stderr(`Write: ` and `Read: ` log lines)
[T1370776][2022-06-04T20:43:54.886763] Sorbet's language server requires a single input directory. However, 0 are configured: []
[T1370776][2022-06-04T20:43:54.886822] Write: {"jsonrpc":"2.0","method":"window/showMessage","params":{"type":1,"message":"Sorbet's language server requires a single input directory. However, 0 are configured: []"}}
Content-Length: 169
{"jsonrpc":"2.0","method":"window/showMessage","params":{"type":1,"message":"Sorbet's language server requires a single input directory. However, 0 are configured: []"}}%
11th here :). Please can you help here.
Sorbet's language server requires a single input directory. However, 0 are configured: []
Experiencing the same issue—this was working last week but reverting to an earlier version of Sorbet does not resolve the issue.
[T1266592][2022-06-21T09:59:09.801717] Debug logging enabled
[T1266592][2022-06-21T09:59:09.801778] Running sorbet version 0.5.10037 git 5395cb663a1fc8bf4ba7a129f4138e3596530d54 debug_symbols=true clean=0 with arguments: sorbet --lsp --no-config --verbose
[T1266592][2022-06-21T09:59:09.822809] Starting sorbet version 0.5.10037 git 5395cb663a1fc8bf4ba7a129f4138e3596530d54 debug_symbols=true clean=0 in LSP server mode. Talk ‘\r\n’-separated JSON-RPC to me. More details at https://microsoft.github.io/language-server-protocol/specification.If you're developing an LSP extension to some editor, make sure to run sorbet with `-v` flag,it will enable outputing the LSP session to stderr(`Write: ` and `Read: ` log lines)
[T1266592][2022-06-21T09:59:09.822842] Sorbet's language server requires a single input directory. However, 0 are configured: []
[T1266592][2022-06-21T09:59:09.822869] Write: {"jsonrpc":"2.0","method":"window/showMessage","params":{"type":1,"message":"Sorbet's language server requires a single input directory. However, 0 are configured: []"}}
Content-Length: 169
{"jsonrpc":"2.0","method":"window/showMessage","params":{"type":1,"message":"Sorbet's language server requires a single input directory. However, 0 are configured: []"}}
@crokobit @arpitsr @styrmis Your reports are not related to this issue at all. On the surface, the errors look similar to the original reported issue, but your problem is completely different.
Notice that the error you are getting says that 0 folders are configured, which means that there is a Sorbet configuration related issue. The original issue is about having more than 1 folder configured, and is a different and known limitation of Sorbet LSP mode.
@froydnj You should consider (and maybe move) the last 3 reports as a different issue.
@paracycle You're right—my issue was resolved by a configuration change on my side (for the Neovim LSP) to correctly determine the root directory when working within a Rails engine.
Happy to delete my earlier comment (and this one!) to clean up the issue if you would prefer, as my issue is not a Sorbet one but one (potentially) for nvim-lspconfig.
@styrmis I also noticed that your Sorbet LSP invocation has a --no-config
flag which is probably the real reason for your original problem. You can't expect Sorbet to work properly if you completely ignore the Sorbet configuration using that flag. I suspect that, if you removed that flag, you wouldn't even need to change your NeoVim config.
@styrmis I suspect that, if you removed that flag, you wouldn't even need to change your NeoVim config.
Unfortunately this does not appear to be the case—the change as described is necessary (though there may be other ways to resolve the same issue).
The command run above was just following the form of the previous reports, which was misleading. The command being run by nvim-lspconfig
was in fact just srb tc --lsp
.
Apologies again for derailing this issue, I have confirmed that no gems with rbi directories have been added to this particular project, so my (resolved) issue is indeed completely unrelated.
Is there a way to configure Sorbet to accept more than one input directory? If not, how easy would it be to add support for multiple directories?