Shopify / ruby-lsp

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

Properly handle methods for definition, completion and hover #899

Open vinistock opened 10 months ago

vinistock commented 10 months ago

Depends on #898 and #1333

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

github-actions[bot] commented 8 months ago

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

Kyrluckechuck commented 8 months ago

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

andyw8 commented 8 months ago

It's not usable yet, but a first step towards this was merged today: https://github.com/Shopify/ruby-lsp/pull/1043

Drowze commented 3 months ago

Method completion and jump-to-method-definition is the only thing currently holding me to other alternatives. I am anxiously looking towards this feature to jump on ruby-lsp boat! 🛥️ 🛥️

Thank you very much for your hard work on this project!

andyw8 commented 1 month ago

It could be helpful to add a checklist to the PR description here indicating what's remaining.