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

v0.50.0 throws "[TypeError] no implicit conversion of nil into String" / "[NameError] uninitialized constant" #701

Open
sephraim opened this issue Dec 21, 2023 · 0 comments

Comments

@sephraim
Copy link

sephraim commented Dec 21, 2023

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
cmur2 added a commit to cmur2/dyndnsd that referenced this issue May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant