v0.50.0 throws "[TypeError] no implicit conversion of nil into String" / "[NameError] uninitialized constant"
sephraim opened this issue · 0 comments
sephraim commented
Problem
Solargraph gem v0.49.0 seems to work fine for me. However with v0.50.0, whenever I open a .rb file in VS Code, I repeatedly get the following errors no matter where I click in the file:
[Error - 12:36:41 AM] Request textDocument/hover failed.
Message: [TypeError] no implicit conversion of nil into String
Code: -32603
[Error - 12:36:41 AM] Request textDocument/documentHighlight failed.
Message: [TypeError] no implicit conversion of nil into String
Code: -32603
I saw the following error pop up as well at one point, but I'm not sure how to reproduce it:
[Error - 12:36:41 AM] Request textDocument/formatting failed.
Message: [NameError] uninitialized constant Solargraph::LanguageServer::Message::TextDocument::Formatting::RuboCop
I do not get these errors when using gem v0.49.0.
My setup
Versions
- Solargraph gem v0.50.0
- Ruby Solargarph VS code extension v0.24.1
- Ruby v3.2.2 (via
ruby:3.2.2
Docker image) - VS Code v1.85.1
- Rubocop gem v1.59.0
- Docker Desktop v4.25.2 running on MacOS 13.4 / M1 MacBook Pro
- Dev Containers VS Code extension v0.327.0
Solargraph config
I have env var SOLARGRAPH_GLOBAL_CONFIG=~/.config/solargraph/config.yml
. Here is my ~/.config/solargraph/config.yml file:
---
include:
- "**/*.rb"
exclude:
- spec/**/*
- test/**/*
- vendor/**/*
- ".bundle/**/*"
require: []
domains: []
reporters:
- rubocop
- require_not_found
formatter:
rubocop:
cops: safe
except: []
only: []
extra_args: []
require_paths: []
plugins: []
max_files: 5000
VS Code config
Here are my Ruby / Solargraph settings inside my settings.json file:
"[ruby]": {
"editor.defaultFormatter": "castwide.solargraph",
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.semanticHighlighting.enabled": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"editor.rulers": [
120
]
},
"solargraph.formatting": true,
"solargraph.diagnostics": true
Rubocop config
Here is my .rubocop.yml file:
AllCops:
TargetRubyVersion: 3.2
Layout/LineLength:
Max: 120