Skip to content

RubyLSP recieves requests for "fake" sorbet rbi files #2384

Closed as not planned

Description

Description

Reproduction steps

  • Create a new typed: true ruby file in a project that uses sorbet.
  • Have the vscode sorbet extension installed
  • Type TRUE and press F12 to move to its definition
  • Open the extension output terminal and observe the error
024-07-30 12:24:35.677 [info] (ruby-lsp) [Error - 12:24:35 PM] Request textDocument/semanticTokens/range failed.
2024-07-30 12:24:35.677 [info] (ruby-lsp)   Message: /home/user/code/ruby-lsp/lib/ruby_lsp/store.rb:44:in `get': sorbet:https%3A//github.com/sorbet/sorbet/tree/090ed6096a83dd7a5fe52bd3f9338c1eca5178eb/rbi/core/constants.rbi (RubyLsp::Store::NonExistingDocumentError)
	from /home/user/code/ruby-lsp/lib/ruby_lsp/server.rb:393:in `text_document_semantic_tokens_range'
	from /home/user/code/ruby-lsp/lib/ruby_lsp/server.rb:46:in `process_message'
	from /home/user/code/ruby-lsp/lib/ruby_lsp/base_server.rb:128:in `block in new_worker'

  Code: -32602

Notice the uri: sorbet:https%3A//github.com/sorbet/sorbet/tree/090ed6096a83dd7a5fe52bd3f9338c1eca5178eb/rbi/core/constants.rbi

The location doesn't actually exist and is probably provided on-demand by the sorbet extension yet ruby-lsp still tries to look it up in its index.

I don't notice anything else wrong except for the error happening. Don't think there is user impact but something unexpected is happening.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

StalebugSomething isn't workinghelp-wantedExtra attention is needed

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions