-
Notifications
You must be signed in to change notification settings - Fork 215
Closed
Labels
enhancementNew feature or requestNew feature or requestpinnedThis issue or pull request is pinned and won't be marked as staleThis issue or pull request is pinned and won't be marked as staleserverThis pull request should be included in the server gem's release notesThis pull request should be included in the server gem's release notes
Description
By analyzing the flow of types in a program, we may be able to improve the accuracy for definition, hover, completion and signature help.
For example, understanding the type stored in a variable
something = Foo.new
something #=> something is an instance of Foo here
However, the Ruby LSP doesn't require a type system to provide features. We may discover that investing in type flow analysis without a type system actually doesn't provide much benefit (because most things would end up being untyped anyway).
Explore implementing simple type flow analysis:
- Estimate the percentage of types we could understand better without a type system. This is limited to types discoverable without annotations:
- Literals
- Object instantiations (Object.new) only when
self.new
orself.allocate
are not overridden
- Investigate the phases to flow types in the analysis. Do we need to implement a CFG? Are there other options? Trade offs?
The output of this task is either the implemented flow analysis algorithm or an explanation of why it's not worth it without a type system.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requestpinnedThis issue or pull request is pinned and won't be marked as staleThis issue or pull request is pinned and won't be marked as staleserverThis pull request should be included in the server gem's release notesThis pull request should be included in the server gem's release notes