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

Go to definition does not work: Error while indexing: undefined method `required_positionals' for #<RBS::Types::UntypedFunction #2776

Closed
fabioxgn opened this issue Oct 24, 2024 · 3 comments
Labels
bug Something isn't working vscode This pull request should be included in the VS Code extension's release notes

Comments

@fabioxgn
Copy link

Description

Go to definition always worked on my vscode and it stopped for some time now, I also see the error below in a popup every time a open the project.

Ruby LSP Information

VS Code Version

1.94.2

Ruby LSP Extension Version

0.8.8

Ruby LSP Server Version

0.17.16

Ruby LSP Addons

  • Ruby LSP Rails

Ruby Version

3.2.3

Ruby Version Manager

asdf

Installed Extensions

Click to expand
  • gitlens (15.6.2)
  • EditorConfig (0.16.4)
  • prettier-vscode (11.0.0)
  • copilot (1.242.0)
  • copilot-chat (0.21.2)
  • vscode-edit-csv (0.10.0)
  • haml (1.4.1)
  • vscode-rdbg (0.2.2)
  • rainbow-csv (3.12.0)
  • vscode-duplicate (1.2.1)
  • vscode-kubernetes-tools (1.3.18)
  • black-formatter (2024.4.0)
  • debugpy (2024.12.0)
  • python (2024.16.1)
  • vscode-pylance (2024.10.1)
  • javascript-test-runner (0.2.0)
  • vscode-yaml (1.15.0)
  • ruby-extensions-pack (0.1.12)
  • ruby-lsp (0.8.8)
  • sorbet-vscode-extension (0.3.37)

Ruby LSP Settings

Click to expand
Workspace
{
  "indexing": {
    "excludedPatterns": [
      "**/spec/**/*.rb"
    ]
  }
}
User
{
  "enableExperimentalFeatures": false,
  "enabledFeatures": {
    "codeActions": true,
    "diagnostics": true,
    "documentHighlights": true,
    "documentLink": true,
    "documentSymbols": true,
    "foldingRanges": true,
    "formatting": true,
    "hover": true,
    "inlayHint": true,
    "onTypeFormatting": true,
    "selectionRanges": true,
    "semanticHighlighting": true,
    "completion": true,
    "codeLens": true,
    "definition": true,
    "workspaceSymbol": true,
    "signatureHelp": true,
    "typeHierarchy": true
  },
  "featuresConfiguration": {},
  "addonSettings": {},
  "rubyVersionManager": {
    "identifier": "auto"
  },
  "customRubyCommand": "",
  "formatter": "auto",
  "linters": null,
  "bundleGemfile": "",
  "testTimeout": 30,
  "branch": "",
  "pullDiagnosticsOn": "both",
  "useBundlerCompose": false,
  "bypassTypechecker": false,
  "rubyExecutablePath": "",
  "indexing": {
    "excludedPatterns": [
      "**/spec/**/*.rb"
    ]
  },
  "erbSupport": true
}

Reproduction steps

  1. Start the Ruby LSP using csv
  2. Open a Ruby file
  3. A popup shows the error below
  4. Try to use "Go to definition" to a simple thing like the User model
  5. Go to definition doesn't work "No definition found for 'User"

Code snippet or error message

Error while indexing: undefined method `required_positionals' for #<RBS::Types::UntypedFunction:0x0000000118984e78 @return_type=#<RBS::Types::Bases::Any:0x0000000118984ec8 @location=#<RBS::Location:21340 buffer=/Users/fabiogomes/.asdf/installs/ruby/3.2.3/lib/ruby/gems/3.2.0/gems/rbs-3.6.1/core/method.rbs, start=138:19, pos=4835...4842, children= source="untyped">>>
@fabioxgn fabioxgn added bug Something isn't working vscode This pull request should be included in the VS Code extension's release notes labels Oct 24, 2024
@andyw8
Copy link
Contributor

andyw8 commented Oct 24, 2024

This is a duplicate of #2630. You're using an outdated version of the Ruby LSP server (gem).

@andyw8
Copy link
Contributor

andyw8 commented Oct 24, 2024

(some other dependency in your project may be constraining the Ruby LSP version, which would be why you've only started seeing this).

@vinistock
Copy link
Member

Thank you for the report! As Andy mentioned this problem has already been fixed in v0.18.4, so it's likely that the ruby-lsp gem is failing to update for some reason.

There are some instructions and more context here.

Please let us know if you hit any issues while upgrading it.

@vinistock vinistock closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working vscode This pull request should be included in the VS Code extension's release notes
Projects
None yet
Development

No branches or pull requests

3 participants