Open Super-Xray opened 2 weeks ago
I have signed the CLA!
I have signed the CLA!
connected another email with the CLA
I have signed the CLA!
There is one typecheck failure, it may indicate a missing nil check.
There is one typecheck failure, it may indicate a missing nil check. @andyw8 Did you mean this error? I have fixed it.
Motivation
There are an issue calling for complete this function (https://github.com/Shopify/ruby-lsp/issues/1893).
Implementation
autoload
argument is aPrism::CallNode
which has name:autoload
. I createhandle_autoload_definition
method and add it toon_call_node_enter
method in 'lib/ruby_lsp/listeners/definition.rb'. Then inhandle_autoload_definition
method, we can use the name of the constant in thePrism::SymbolNode
under thePrism::CallNode
and pass the name tofind_in_index
, which can create the response of jumping.Automated Tests
Completed automated tests in
test/requests/definition_expectations_test.rb
, includingtest_jumping_to_autoload_definition_when_declaration_exists
,test_jumping_to_autoload_definition_with_two_definition
andtest_does_nothing_when_autoload_declaration_does_not_exist
Manual Tests
.rb
file which hasautoload
arguments.autoload
arguments, press ctrl & click it