sorbet icon indicating copy to clipboard operation
sorbet copied to clipboard

[LSP]Sorbet's language server requires a single input directory

Open SolaWing opened this issue 4 years ago • 18 comments

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

SolaWing avatar Jan 16 '20 04:01 SolaWing

Assuming you mean that gems with an rbi/ directory cause the LSP to break, I think this is fixed by #2730?

connorshea avatar Feb 29 '20 23:02 connorshea

I'm seeing this too.

dogweather avatar Jan 09 '21 10:01 dogweather

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.

feliperaul avatar Jan 11 '21 10:01 feliperaul

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

RB-Lab avatar Mar 01 '21 11:03 RB-Lab

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.

choubacha avatar Sep 23 '21 18:09 choubacha

Bump. Seeing the same error while trying to get it working with Vim + ale.

Prajjwal avatar Sep 29 '21 14:09 Prajjwal

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?

Fire-Dragon-DoL avatar Jan 05 '22 01:01 Fire-Dragon-DoL

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.

arubis avatar Jan 20 '22 21:01 arubis

You can add mine as a 9th as well :)

mcraeklaura avatar Jan 31 '22 19:01 mcraeklaura

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: []"}}%

crokobit avatar Jun 04 '22 12:06 crokobit

11th here :). Please can you help here.

Sorbet's language server requires a single input directory. However, 0 are configured: []

arpitsr avatar Jun 17 '22 16:06 arpitsr

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: []"}}

styrmis avatar Jun 21 '22 10:06 styrmis

@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 avatar Jun 22 '22 15:06 paracycle

@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 avatar Jun 22 '22 15:06 styrmis

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

paracycle avatar Jun 22 '22 16:06 paracycle

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

styrmis avatar Jun 23 '22 08:06 styrmis

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?

dylanirlbeck avatar Jan 11 '23 23:01 dylanirlbeck