Closed jeronimoamazon closed 3 months ago
Can you screenshot the extension control panel by clicking the { }
mark at the bottom, next to Ruby
? It should look like:
And it looks like there are 2 causes for the issue:
OUTPUT
tab and then select Ruby LSP
, it may show the reasons behind it.@vinistock can you take a look at 2)? I think we may need to replace the first \\s*
with \\s+
?
Yeah, https://github.com/Shopify/ruby-lsp/pull/2270 should fix it.
In addition to the grammar bug, it looks like semantic highlighting is not running. It is turned off by default in VS Code, so you might want to turn it on and review our recommended settings to get the most out of the LSP.
Here are my ruby settings:
"[ruby]": {
"editor.defaultFormatter": "Shopify.ruby-lsp",
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"editor.rulers": [
120
],
"editor.semanticHighlighting.enabled": true
},
And here is the Ruby LSP output tab when reloading the VSCode window:
2024-07-08 11:46:31.160 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 11:46:38.654 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 11:46:40.575 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 11:46:42.346 [info] (***) Checking if asdf is available on the path with command: /bin/zsh -i -c 'asdf --version'
2024-07-08 11:46:44.654 [info] (***) Discovered version manager none
2024-07-08 11:46:44.654 [info] (***) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 11:57:12.458 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 11:57:13.606 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 11:57:14.766 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 11:57:15.952 [info] (***) Checking if asdf is available on the path with command: /bin/zsh -i -c 'asdf --version'
2024-07-08 11:57:17.074 [info] (***) Discovered version manager none
2024-07-08 11:57:17.074 [info] (***) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 11:57:18.374 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 11:57:19.500 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 11:57:20.570 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 11:57:21.644 [info] (***) Checking if asdf is available on the path with command: /bin/zsh -i -c 'asdf --version'
2024-07-08 11:57:22.727 [info] (***) Discovered version manager none
2024-07-08 11:57:22.727 [info] (***) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 11:57:24.953 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 11:57:26.139 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 11:57:27.245 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 11:57:28.311 [info] (***) Checking if asdf is available on the path with command: /bin/zsh -i -c 'asdf --version'
2024-07-08 11:57:29.363 [info] (***) Discovered version manager none
2024-07-08 11:57:29.363 [info] (***) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 11:57:37.638 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 11:57:38.871 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 11:57:39.954 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 11:57:40.976 [info] (***) Checking if asdf is available on the path with command: /bin/zsh -i -c 'asdf --version'
2024-07-08 11:57:42.007 [info] (***) Discovered version manager none
2024-07-08 11:57:42.007 [info] (***) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 13:17:03.330 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 13:17:04.429 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 13:17:05.440 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 13:17:06.468 [info] (***) Checking if asdf is available on the path with command: /bin/zsh -i -c 'asdf --version'
2024-07-08 13:17:07.490 [info] (***) Discovered version manager none
2024-07-08 13:17:07.490 [info] (***) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 13:23:12.551 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 13:23:13.705 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 13:23:14.743 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 13:23:15.754 [info] (***) Checking if asdf is available on the path with command: /bin/zsh -i -c 'asdf --version'
2024-07-08 13:23:16.778 [info] (***) Discovered version manager none
2024-07-08 13:23:16.778 [info] (***) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 13:24:46.406 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 13:24:47.482 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 13:24:48.560 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 13:24:49.590 [info] (***) Checking if asdf is available on the path with command: /bin/zsh -i -c 'asdf --version'
2024-07-08 13:24:50.585 [info] (***) Discovered version manager none
2024-07-08 13:24:50.585 [info] (***) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 13:24:56.047 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 13:24:57.172 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 13:24:58.242 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 13:24:59.441 [info] (***) Checking if asdf is available on the path with command: /bin/zsh -i -c 'asdf --version'
2024-07-08 13:25:00.530 [info] (***) Discovered version manager none
2024-07-08 13:25:00.530 [info] (***) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 13:25:28.802 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 13:25:30.031 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 13:25:31.091 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 13:25:32.807 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 13:25:33.924 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 13:25:35.054 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 13:25:36.159 [info] (***) Checking if asdf is available on the path with command: /bin/zsh -i -c 'asdf --version'
2024-07-08 13:25:37.197 [info] (***) Discovered version manager none
2024-07-08 13:25:37.197 [info] (***) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 13:36:21.061 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 13:36:22.163 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 13:36:23.293 [info] (***) Checking if rvm is available on the path with command: /bin/zsh -i -c 'rvm --version'
2024-07-08 13:36:24.323 [info] (***) Checking if asdf is available on the path with command: /bin/zsh -i -c 'asdf --version'
2024-07-08 13:36:25.391 [info] (***) Discovered version manager none
2024-07-08 13:36:25.391 [info] (***) Running command: `ruby -W0 -rjson -e 'STDERR.print({ env: ENV.to_h, yjit: !!defined?(RubyVM::YJIT), version: RUBY_VERSION }.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 13:48:06.491 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 13:48:07.658 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 13:48:08.660 [info] (***) Discovered version manager rbenv
2024-07-08 13:48:08.660 [info] (***) Running command: `rbenv exec ruby -W0 -rjson -e 'STDERR.print({env: ENV.to_h,yjit:!!defined?(RubyVM::YJIT),version:RUBY_VERSION}.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
2024-07-08 13:48:54.690 [info] (***) Checking if chruby is available on the path with command: /bin/zsh -i -c 'chruby --version'
2024-07-08 13:48:55.929 [info] (***) Checking if rbenv is available on the path with command: /bin/zsh -i -c 'rbenv --version'
2024-07-08 13:48:56.885 [info] (***) Discovered version manager rbenv
2024-07-08 13:48:56.885 [info] (***) Running command: `rbenv exec ruby -W0 -rjson -e 'STDERR.print({env: ENV.to_h,yjit:!!defined?(RubyVM::YJIT),version:RUBY_VERSION}.to_json)'` in /Users/xxx/*** using shell: /bin/zsh
Thanks all for the quick response.
Description
When using the latest version of VSCode and the RubyLSP, words that contain
class
are highlighted like an actualclass
.Reproduction steps
Ruby LSP extension: v0.7.8 VSCode version:
class
are highlighted weirdCode snippet or error message