[#2056] Better signature items support
Compare changes
- #2056] Support getting implementations of sigsHeitor Toledo Lassarote de Paula authored
Problem: Until now, we implemented _go to definition_ without taking signatures and interfaces into consideration. However, we wish to properly deal with signature items in that request, as well as a new _go to implementations_ request. Solution: There are two main parts of the implementation: changes to the definitions pass of scopes, and changes to the go to definition module. In definitions, we keep track of what is a module and what is a signature, and additionally keep track of whatever signatures/interfaces each module/namespace implements. Some creativity was needed here, since the core AST deviates considerably when it comes to the structure of signature definitions and signature expressions. See the relevant comments for more information. In the request for go to definitions, we actually split the logic into two: for definitions and implementations. For definitions, we simply walk the `implements` field of each module, trying to get every relevant definition that matches the current symbol. For implementations, we build a graph with our homemade graph library using signatures as vertices for this graph. This graph is then transposed, so now we can traverse the children of each vertex rather than its parents. We fetch all relevant signatures on the way by cleverly traversing this graph. As a bonus, hovers are now fixed so they can distinguish module types and interfaces from modules and namespaces.