castwide / vscode-solargraph

A Visual Studio Code extension for Solargraph.
Other
425 stars 23 forks source link

[Error] undefined method `children' for nil:NilClassFailed to start Solargraph #171

Closed harssh closed 4 years ago

harssh commented 4 years ago

Server initialization failed. Message: [NoMethodError] undefined method `children' for nil:NilClass Code: -32603

which solargraph location

/Users/account/.rvm/gems/ruby-2.6.3/bin/solargraph

Error in title appears when restarting solargraph server.

Happy to provide more details .

castwide commented 4 years ago

Do you get a backtrace in the developer console (Help -> Toggle Developer Tools)?

harssh commented 4 years ago

[Extension Host] Solargraph is listening PORT=56196 PID=47097 console.ts:137 [Extension Host] (none):87: warning: key :previous_year_working_copy_answer_gender is duplicated and overwritten on line 89 console.ts:137 [Extension Host] (none):77: warning: key :previous_year_working_copy_answer_gender is duplicated and overwritten on line 79 console.ts:137 [Extension Host] (none):47: warning: key :previous_year_working_copy_answer_gender is duplicated and overwritten on line 49 console.ts:137 [Extension Host] [WARN] Error processing request: [NoMethodError] undefined method children' for nil:NilClass console.ts:137 [Extension Host] [WARN] /Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/rubyvm/node_processors/send_node.rb:12:inprocess'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor.rb:38:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:46:inblock in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:in each'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:inprocess_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:36:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor.rb:38:inprocess'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:46:in block in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:ineach'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:36:inprocess'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor.rb:38:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:46:inblock in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:in each'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:inprocess_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:36:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor.rb:38:inprocess'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:46:in block in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:ineach'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:36:inprocess'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor.rb:38:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:46:inblock in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:in each'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:inprocess_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/rubyvm/node_processors/scope_node.rb:9:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor.rb:38:inprocess'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:46:in block in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:ineach'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/rubyvm/node_processors/def_node.rb:58:inprocess'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor.rb:38:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:46:inblock in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:in each'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:inprocess_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:36:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor.rb:38:inprocess'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:46:in block in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:ineach'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/rubyvm/node_processors/scope_node.rb:9:inprocess'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor.rb:38:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:46:inblock in process_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:in each'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor/base.rb:44:inprocess_children'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/rubyvm/node_processors/namespace_node.rb:33:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/node_processor.rb:38:inprocess'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/parser/rubyvm/class_methods.rb:29:in map'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/source_map/mapper.rb:26:inmap'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/source_map/mapper.rb:50:in map'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/source_map.rb:141:inmap'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/api_map.rb:88:in block in catalog'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/api_map.rb:70:ineach'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/api_map.rb:70:in catalog'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/library.rb:23:ininitialize'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/library.rb:363:in new'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/library.rb:363:inload'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/host.rb:278:in prepare'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/host.rb:295:inblock in prepare_folders'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/host.rb:294:in each'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/host.rb:294:inprepare_folders'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/message/initialize.rb:14:in block in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/benchmark-0.1.0/lib/benchmark.rb:293:inmeasure'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/message/initialize.rb:10:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/host.rb:101:in console.ts:137 [Extension Host]receive'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/transport/adapter.rb:44:in process'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/transport/adapter.rb:17:inblock in opening'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/transport/data_reader.rb:59:in parse_message_from_buffer'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/transport/data_reader.rb:35:inblock in receive'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/transport/data_reader.rb:30:in each_char'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/transport/data_reader.rb:30:inreceive'/Users/account/.rvm/gems/ruby-2.6.3/gems/solargraph-0.39.3/lib/solargraph/language_server/transport/adapter.rb:27:in receiving'/Users/account/.rvm/gems/ruby-2.6.3/gems/backport-1.1.2/lib/backport/client.rb:63:intick'/Users/account/.rvm/gems/ruby-2.6.3/gems/backport-1.1.2/lib/backport/server/tcpip.rb:76:in update'/Users/account/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/observer.rb:197:inblock in notify_observers'/Users/account/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/observer.rb:196:in each'/Users/account/.rvm/rubies/ruby-2.6.3/lib/ruby/2.6.0/observer.rb:196:innotify_observers'/Users/account/.rvm/gems/ruby-2.6.3/gems/backport-1.1.2/lib/backport/client.rb:121:in read_input'/Users/account/.rvm/gems/ruby-2.6.3/gems/backport-1.1.2/lib/backport/client.rb:102:inblock in run_input_thread' notificationsAlerts.ts:40 [NoMethodError] undefined method children' for nil:NilClass onDidChangeNotification @ notificationsAlerts.ts:40 (anonymous) @ notificationsAlerts.ts:26 fire @ event.ts:587 addNotification @ notifications.ts:207 notify @ notificationService.ts:106 (anonymous) @ mainThreadMessageService.ts:83 _showMessage @ mainThreadMessageService.ts:44 $showMessage @ mainThreadMessageService.ts:38 _doInvokeHandler @ rpcProtocol.ts:402 _invokeHandler @ rpcProtocol.ts:387 _receiveRequest @ rpcProtocol.ts:303 _receiveOneMessage @ rpcProtocol.ts:230 (anonymous) @ rpcProtocol.ts:105 fire @ event.ts:587 fire @ ipc.net.ts:453 _receiveMessage @ ipc.net.ts:733 (anonymous) @ ipc.net.ts:592 fire @ event.ts:587 acceptChunk @ ipc.net.ts:239 (anonymous) @ ipc.net.ts:200 t @ ipc.net.ts:28 emit @ events.js:203 addChunk @ _stream_readable.js:295 readableAddChunk @ _stream_readable.js:276 Readable.push @ _stream_readable.js:210 onStreamRead @ internal/stream_base_commons.js:166 console.ts:137 [Extension Host] Error starting Solargraph socket provider Error: [NoMethodError] undefined methodchildren' for nil:NilClass at new ResponseError (/Users/account/.vscode/extensions/castwide.solargraph-0.21.1/node_modules/vscode-languageclient/node_modules/vscode-jsonrpc/lib/messages.js:46:28) at handleResponse (/Users/account/.vscode/extensions/castwide.solargraph-0.21.1/node_modules/vscode-languageclient/node_modules/vscode-jsonrpc/lib/main.js:430:48) at processMessageQueue (/Users/account/.vscode/extensions/castwide.solargraph-0.21.1/node_modules/vscode-languageclient/node_modules/vscode-jsonrpc/lib/main.js:258:17) at Immediate. (/Users/account/.vscode/extensions/castwide.solargraph-0.21.1/node_modules/vscode-languageclient/node_modules/vscode-jsonrpc/lib/main.js:242:13) at processImmediate (internal/timers.js:439:21) notificationsAlerts.ts:40 Failed to start Solargraph: Error: [NoMethodError] undefined method `children' for nil:NilClass onDidChangeNotification @ notificationsAlerts.ts:40 (anonymous) @ notificationsAlerts.ts:26 fire @ event.ts:587 addNotification @ notifications.ts:207 notify @ notificationService.ts:106 (anonymous) @ mainThreadMessageService.ts:83 _showMessage @ mainThreadMessageService.ts:44 $showMessage @ mainThreadMessageService.ts:38 _doInvokeHandler @ rpcProtocol.ts:402 _invokeHandler @ rpcProtocol.ts:387 _receiveRequest @ rpcProtocol.ts:303 _receiveOneMessage @ rpcProtocol.ts:230 (anonymous) @ rpcProtocol.ts:105 fire @ event.ts:587 fire @ ipc.net.ts:453 _receiveMessage @ ipc.net.ts:733 (anonymous) @ ipc.net.ts:592 fire @ event.ts:587 acceptChunk @ ipc.net.ts:239 (anonymous) @ ipc.net.ts:200 t @ ipc.net.ts:28 emit @ events.js:203 addChunk @ _stream_readable.js:295 readableAddChunk @ _stream_readable.js:276 Readable.push @ _stream_readable.js:210 onStreamRead @ internal/stream_base_commons.js:166

castwide commented 4 years ago

Thanks. I'm able to reproduce this error by calling a visibility method, e.g., private, with parentheses and no arguments:

class Foo
  private()
end

It works as expected without the parentheses or if the call has arguments:

class Foo
  private # OK
  private(:bar) # OK
end

I'll have a fix for it in the next patch release.

castwide commented 4 years ago

Fixed in gem v0.39.4.

harssh commented 4 years ago

Confirming now working as expected without above error. Thank you for maintaining an amazing gem.