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

Crash on git gem in Gemfile #2809

Closed
thedanbob opened this issue Oct 31, 2024 · 2 comments · Fixed by #2810
Closed

Crash on git gem in Gemfile #2809

thedanbob opened this issue Oct 31, 2024 · 2 comments · Fixed by #2810
Assignees
Labels
bug Something isn't working vscode This pull request should be included in the VS Code extension's release notes

Comments

@thedanbob
Copy link

thedanbob commented Oct 31, 2024

Description

ruby-lsp 0.21.0 crashes if you have a git gem in your Gemfile with the following format:

gem "gem_name", git: "git@git.example.com:username/repo.git", branch: "master"

This bug appears to have been introduced here: eadd431#diff-f6924adc23e6f34611ac67f8365789f93c0a71d7ccf25c626582755d85204eafR304

Ruby LSP Information

VS Code Version

1.94.2

Ruby LSP Extension Version

0.8.12

Ruby LSP Server Version

Unknown

Ruby LSP Addons

Ruby Version

3.3.5

Ruby Version Manager

custom

Installed Extensions

Click to expand
  • amx-netlinx (0.6.1)
  • better-toml (0.3.2)
  • copy-text (0.4.9)
  • cpptools (1.22.10)
  • csharp (2.50.27)
  • elixir-ls (0.24.2)
  • gitlens (15.6.2)
  • go (0.42.1)
  • haml (1.4.1)
  • isort (2023.10.1)
  • material-icon-theme (5.12.0)
  • platformio-ide (3.3.3)
  • postcss (2.0.0)
  • python (2024.16.1)
  • ruby-lsp (0.8.12)
  • rust-analyzer (0.3.2162)
  • vscode-dotnet-runtime (2.2.2)
  • vscode-eslint (3.0.10)
  • vscode-npm-script (0.3.29)
  • vscode-projects-plus (1.24.0)
  • vscode-zipfs (3.0.0)

Ruby LSP Settings

Click to expand
Workspace
{}
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": "custom"
  },
  "customRubyCommand": "rbenv init - fish | source",
  "formatter": "auto",
  "linters": null,
  "bundleGemfile": "",
  "testTimeout": 30,
  "branch": "",
  "pullDiagnosticsOn": "both",
  "useBundlerCompose": false,
  "bypassTypechecker": false,
  "rubyExecutablePath": "",
  "indexing": {},
  "erbSupport": true,
  "useLauncher": false
}

Code snippet or error message (anonymized)

2024-10-31 08:48:03.930 [info] (project) /home/dan/.rbenv/versions/3.3.5/lib/ruby/3.3.0/uri/rfc3986_parser.rb:130:in `split': bad URI(is not URI?): "git@git.example.com:username/repo.git" (URI::InvalidURIError)
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/3.3.0/uri/rfc3986_parser.rb:135:in `parse'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/3.3.0/uri/common.rb:187:in `parse'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/3.3.0/uri/common.rb:848:in `URI'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/ruby-lsp-0.21.0/lib/ruby_lsp/setup_bundler.rb:357:in `block in correct_relative_remote_paths'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/ruby-lsp-0.21.0/lib/ruby_lsp/setup_bundler.rb:352:in `gsub!'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/ruby-lsp-0.21.0/lib/ruby_lsp/setup_bundler.rb:352:in `correct_relative_remote_paths'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/call_validation.rb:270:in `bind_call'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/call_validation.rb:270:in `validate_call'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/ruby-lsp-0.21.0/lib/ruby_lsp/setup_bundler.rb:105:in `setup!'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/call_validation.rb:270:in `bind_call'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/call_validation.rb:270:in `validate_call'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/sorbet-runtime-0.5.11577/lib/types/private/methods/_methods.rb:277:in `block in _on_method_added'
	from /home/dan/.rbenv/versions/3.3.5/lib/ruby/gems/3.3.0/gems/ruby-lsp-0.21.0/exe/ruby-lsp:75:in `<top (required)>'
	from /home/dan/.rbenv/versions/3.3/bin/ruby-lsp:25:in `load'
	from /home/dan/.rbenv/versions/3.3/bin/ruby-lsp:25:in `<main>'
@thedanbob thedanbob added bug Something isn't working vscode This pull request should be included in the VS Code extension's release notes labels Oct 31, 2024
@vinistock vinistock self-assigned this Oct 31, 2024
@thedanbob thedanbob changed the title Crash on git gem in gemfile Crash on git gem in Gemfile Oct 31, 2024
@vinistock
Copy link
Member

Thank you for the report! Looking into it.

@vinistock
Copy link
Member

Just cut v0.21.1 with the fix. Please update the global installation of the gem so that you're using the version with the fix gem update ruby-lsp.

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

Successfully merging a pull request may close this issue.

2 participants