-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add support for type hierarchy requests #2103
Conversation
401c668
to
9566119
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a rebase, but this looks good to me.
We should also add the typeHierarchy
configuration and its respective default here so that it's enabled.
7c602b8
to
8adf61e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. For whatever reason, switching between sub and super types multiple times on certain namespaces causes an error in the extension side Cannot read properties of undefined (reading 'map')
.
You can reproduce it in the core_ext/uri
file. It succeeds initially, but switching back and forth eventually fails.
I'm not sure if this isn't because of the lack of sub types implementation, so maybe we can move forward and debug that after sub types?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the 2 gifs are exactly the same?
Good find, I can investigate 👍 |
They are, the The issue is that we test for each request to have a gif and for the gif to be the same name than the request. I guess I could use a symlink though? |
63e8856
to
ea82137
Compare
I updated the PR to changes two behaviors:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚀
parent = context.parent | ||
return unless node && parent | ||
|
||
target = determine_target(node, parent, @position) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not related to this PR, but I think we can make determine_target
simply take a NodeContext
because all of its usages take node and parent from the same context.
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
Signed-off-by: Alexandre Terrasa <alexandre.terrasa@shopify.com>
c9ac6e4
to
188fed0
Compare
Closes #1046.
Implement support for:
textDocument/prepareTypeHierarchy
: https://microsoft.github.io/language-server-protocol/specification#textDocument_prepareTypeHierarchytypeHierarchy/supertypes
: https://microsoft.github.io/language-server-protocol/specification#typeHierarchy_supertypestypeHierarchy/subtypes
as we do not have the necessary logic in the index yetDemo: