castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
424 stars 25 forks source link

Failed to start Solargraph: Error: [NoMethodError] private method 'select' called for nil:NilClass #235

Open jramiresbrito opened 2 years ago

jramiresbrito commented 2 years ago

Environment

OS: Ubuntu 20.04.3 LTS (Focal Fossa) Ruby: ruby 2.7.4p191 Solargraph: solargraph (0.44.1) Rubocop: rubocop (1.23.0)

When I open my project in VsCode, the warning starts:

Failed to start Solargraph: Error: [NoMethodError] private method `select' called for nil:NilClass

Here are my Rubocop and Solargraph .yml files:

.rubocop.yml

Layout/LineLength:
  Max: 120
Layout/EmptyLines:
  Enabled: false
Metrics/ClassLength:
  Max: 150
Metrics/BlockLength:
  Max: 50
Metrics/MethodLength:
  Max: 25
Metrics/AbcSize:
  Enabled: false
Metrics/CyclomaticComplexity:
  Enabled: false
Style/FrozenStringLiteralComment:
  Enabled: false
Style/ConditionalAssignment:
  Enabled: false
Style/StringLiterals:
  Enabled: false
Style/RedundantReturn:
  Enabled: false
Style/SelfAssignment:
  Enabled: false
Style/Documentation:
  Enabled: false
Style/RegexpLiteral:
  Enabled: false
Style/GuardClause:
  Enabled: false
Style/WordArray:
  Enabled: false
Style/SymbolProc:
  Enabled: false
Style/MutableConstant:
  Enabled: false
Style/SignalException:
  Enabled: false
Style/MissingRespondToMissing:
  Enabled: false
Style/HashEachMethods:
  Enabled: false
Style/HashTransformKeys:
  Enabled: false
Style/HashTransformValues:
  Enabled: false
Style/ClassAndModuleChildren:
  EnforcedStyle: compact
Style/ClassAndModuleChildren:
  Enabled: false
Lint/MissingSuper:
  Enabled: false
Lint/UnusedMethodArgument:
  Enabled: false
Security/Open:
  Enabled: false
Bundler/OrderedGems:
  Enabled: false
Lint/RaiseException:
  Enabled: false
Lint/StructNewOverride:
  Enabled: false

AllCops:
  NewCops: enable
  TargetRubyVersion: 2.7.4
  Exclude:

.solargraph.yml

---
include:
- 'app/**/*.rb'
exclude:
reporters:
- rubocop
max_files: 5000
castwide commented 2 years ago

The exclude setting in .solargraph.yml should either contain a list of values or be deleted altogether. An empty array is acceptable:

exclude: []

I'll look into a more graceful way of handling errors in config files.