Shopify / ruby-lsp

An opinionated language server for Ruby

Home Page:https://shopify.github.io/ruby-lsp/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add go to definition for methods

vinistock opened this issue · comments

Depends on #898

Use the index to provide go to definition for methods.

Might depend on exploring using a control flow graph (CFG) to implement reaching definitions. While we do not provide typechecking, using reaching definitions might allow us to be more precise.

For example

a = "something"
# We know that `a` is a string because it's a literal, so we know 100% sure this has to be
# String#upcase. If we have an implementation of reaching definitions, we can make this work
a.upcase

Checklist

  • Attributes. The LSP protocol has special types for them, so we should create a separate index entry
  • Taking new invocations to initialize. For completion, it's actually the opposite, we need to use the signature for initialize, but complete to new
  • Method aliases through alias_method and alias

This issue is being marked as stale because there was no activity in the last 2 months

Just bumping this since it's not stale and I don't want it marked as closed without being formally acknowledged! 😅

It's not usable yet, but a first step towards this was merged today: #1043