Skip to content
Discussion options

You must be logged in to vote

This is currently expected behavior, not an Eglot misconfiguration.

Ruby LSP can complete calls when it can resolve the receiver directly, but it does not carry a full inferred type through local-variable assignments. The maintainers described the same case in issue #3407: direct calls such as SomeClass.new.some_method can be resolved, while carrying the type through x = SomeClass.new; x.some_method would require type-flow analysis and at least part of a type system. Their exploration in #2421 concluded that the accuracy gain without annotations would be too small, so they did not implement it.

Your string example crosses that same boundary:

"hello".upcase       # direct literal receiver:…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ParsaJR
Comment options

Answer selected by ParsaJR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants