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

Unable to initialise Ruby LSP vscode plugin on Windows/Powershell due to changes in #2552 #2592

Closed
mattys101 opened this issue Sep 22, 2024 · 3 comments · Fixed by #2597
Closed
Assignees
Labels
bug Something isn't working vscode This pull request should be included in the VS Code extension's release notes

Comments

@mattys101
Copy link

Description

There appears to be a regression introduced by fixes from pull request #2552 on Windows with Powershell command execution.
The newly modified command with the "separator" text:

ruby -W0 -rjson -e 'STDERR.print("RUBY_LSP_ACTIVATION_SEPARATOR" + { env: ENV.to_h, yjit: !!defined?(RubyVM:: YJIT), version: RUBY_VERSION }.to_json + "RUBY_LSP_ACTIVATION_SEPARATOR")'

appears to be having the double quotes stripped out at some point resulting in a 'constant RUBY_LSP_ACTIVATION_SEPARATOR not initialized' error.

Alternative quotings such as:

ruby -W0 -rjson -e 'STDERR.print(''RUBY_LSP_ACTIVATION_SEPARATOR'' + { env: ENV.to_h, yjit: !!defined?(RubyVM:: YJIT), version: RUBY_VERSION }.to_json + ''RUBY_LSP_ACTIVATION_SEPARATOR'')'

and:

ruby -W0 -rjson -e "STDERR.print('RUBY_LSP_ACTIVATION_SEPARATOR' + { env: ENV.to_h, yjit: !!defined?(RubyVM:: YJIT), version: RUBY_VERSION }.to_json + 'RUBY_LSP_ACTIVATION_SEPARATOR')"

Appear to work correctly in manual testing.

Ruby LSP Information

Version 0.8.0

Version Manager: none

Reproduction steps

  1. Start the Ruby LSP using VSCode
  2. Open a Ruby file
  3. Error notification that Ruby LSP activation failed

Code snippet or error message

Automatic Ruby environment activation with none failed: Command failed: ruby -W0 -rjson -e 'STDERR.print("RUBY_LSP_ACTIVATION_SEPARATOR" + { env: ENV.to_h, yjit: !!defined?(RubyVM:: YJIT), version: RUBY_VERSION }.to_json + "RUBY_LSP_ACTIVATION_SEPARATOR")' -e:1:in `<main>': uninitialized constant RUBY_LSP_ACTIVATION_SEPARATOR (NameError)
@mattys101 mattys101 added bug Something isn't working vscode This pull request should be included in the VS Code extension's release notes labels Sep 22, 2024
@vinistock
Copy link
Member

Thank you for the bug report! This broke due to that PR indeed. The attached PR should fix it.

@vinistock
Copy link
Member

We just released v0.8.1. Please report back if you find any issues!

@mattys101
Copy link
Author

Fantastic. Thanks. Running into #2604 now, but otherwise all good.

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