Show Type Hierarchy doesn't work on type instances #7075
Replies: 5 comments
-
@luabud, any thoughts on this? I believe Java was the first language to add support for "Show Type Hierarchy" and they also don't support it on object instances. Assuming we want to be consistent with other languages, this is by design, although maybe we should show "No Type Hierarchy found" in the code file like Java does rather than showing "No results" in the results pane. |
Beta Was this translation helpful? Give feedback.
-
Intuitively it seems like it should work on instances too since it does work when you do "Show Type Hierarchy" for instance methods (e.g. when you click on But either way, if it's not supported, would be great to have a more descriptive info message like "Showing type hierarchy is not supported on instances", when you see "No results" or "No type hierarchy found" user is left guessing whether it's intentionally not supported or it's a bug. class Level1:
def __init__(self):
print("Level 1 initialized")
class Level2(Level1):
def __init__(self):
super().__init__()
print("Level 2 initialized")
class Level3(Level2):
def __init__(self):
super().__init__()
print("Level 3 initialized")
instance = Level2()
instance.__init__() |
Beta Was this translation helpful? Give feedback.
-
it is not about whether we can do or not, we didn't simply make it work on instance since type hierarchy is usually invoked on type not instance. but surely, we could support if people want it. |
Beta Was this translation helpful? Give feedback.
-
I agree. I think we can either try to do what the Java team is doing (to show no results when the command is invoked on an instance) or edit the message on the view to include "Show Type Hierarchy on instances is not supported". If you'd like to file a request for that to be supported, I'd suggest creating a discussion post so we can get upvotes to gauge interest from other folks too! |
Beta Was this translation helpful? Give feedback.
-
Moving this issue to discussions as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
-
Environment data
Code Snippet
Repro Steps
instance
-> "Show Type Hierarchy"Expected behavior
To see the the type hierarchy for the instance's type.
Actual behavior
"No results. Try running a previous search again:"
Beta Was this translation helpful? Give feedback.
All reactions