Shopify / ruby-lsp

An opinionated language server for Ruby
https://shopify.github.io/ruby-lsp/
MIT License
1.33k stars 118 forks source link

Support go to definition for unknown receiver calls #1961

Closed st0012 closed 3 weeks ago

st0012 commented 3 weeks ago

Motivation

Instead of providing no candidates for possible definitions on unknown receiver calls, we now provide 10 candidates (the exact number is subject to change in the future).

This will allow the user to navigate to the definition of more methods without overwhelming them with too many candidates in some cases.

Implementation

When we can't derive the receiver of the target method, instead of return early we get 10 methods of the same name from the index.

Automated Tests

A new test case was added for this new feature.

Manual Tests

vinistock commented 3 weeks ago

Step towards https://github.com/Shopify/ruby-lsp/issues/899.