-
Notifications
You must be signed in to change notification settings - Fork 12
Fix hover hint for complex expressions #686
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
092d614
to
2f5819f
Compare
a1cca21
to
6628510
Compare
6628510
to
4a52dd8
Compare
rascal-lsp/src/main/java/org/rascalmpl/vscode/lsp/util/locations/impl/TreeMapLookup.java
Show resolved
Hide resolved
I started out with such a structure, and I think I remember I ran into the problem of overlapping ranges and how to store them in such a tree in a way that you don't need to always go "left" and "right" in the tree. And primarily, I didn't want to keep around a complex data structure if we could get it to fit into a regular map. An alternative strategy that @jurgenvinju has proposed in the past is to use the parse tree, and use code similar to the focus list building/semantic token highlighter. But that has the downside that we would be iterating over the tree towards the leaf, and then depth first doing a map lookup in the list of hovers/definitions/... for every parent of the leaf untill we find a match. So not taking the shape of three into account during lookup. |
|
This fixes #268, by changing the lookup of ranges such that type hints/definitions will be shown for the smallest possible tree.
TreeMapLookup
.Range
containment.Building on this, I have been working a revised data structure that relies on containment instead of ordering. Since that requires more testing and checking guarantees/invariants, it now lives on a separate branch: https://github.com/usethesource/rascal-language-servers/tree/fix/range-lookup.