pylance-release icon indicating copy to clipboard operation
pylance-release copied to clipboard

show class hierarchy or method override like pycharm

Open yiciu opened this issue 3 years ago • 21 comments

For now, we can't see at a glance which methods in the class override the methods of the parent class. Whether this function can be added in subsequent versions, as in pycharm, you can jump to the method in the overriding parent class through the icon to see. image image

yiciu avatar Feb 19 '22 08:02 yiciu

Waiting for upvotes on this feature request

judej avatar Feb 22 '22 18:02 judej

Thanks for the feature request! We are going to give the community 60 days from when this issue was created to provide 7 👍 upvotes on the opening comment to gauge general interest in this idea. If there's enough upvotes then we will consider this feature request in our future planning. If there's unfortunately not enough upvotes then we will close this issue.

luabud avatar Feb 22 '22 18:02 luabud

Thank you to everyone who upvoted this issue! Since the community showed interest in this feature request we will leave this issue open as something to consider implementing at some point in the future.

We do encourage people to continue 👍 the first/opening comment as it helps us prioritize our work based on what the community seems to want the most.

brettcannon avatar Apr 21 '22 21:04 brettcannon

The title of this issue mentions a "Class Hierarchy" feature, however the text mostly discusses method overrides. I'm not sure if this issue will look into the Hierarchy portion as well, however here are some docs on the PyCharm Hierarchy features if so

https://www.jetbrains.com/help/pycharm/viewing-structure-and-hierarchy-of-the-source-code.html#ws_build_hierarchy

andrewellis55 avatar Jun 29 '22 22:06 andrewellis55

Looking forward to this feature "View hierarchies conveniently".

This is a big reason why I am still using PyCharm as the main editor, since it's very convenient to analyze code structure while developing complex projects which usually contain complex class hierarchies.

I think this feature should contain:

  1. Prompt for class, method implementations by icons near line number. As @yiciu mentioned.
  2. Show the class hierarchy in a separate place. As @andrewellis55 mentioned.

ArkiZh avatar Sep 21 '22 06:09 ArkiZh

Just do it

msouff avatar Oct 07 '22 23:10 msouff

Very much interested in this feature. 👍 If an open poll is created, many would vote for it, I suppose. Though I've been waiting for this feature for long, it's only today that I found this issue, or bothered to find if this issue already exists or not.

parijathakumar avatar Feb 08 '23 01:02 parijathakumar

If an open poll is created

The poll is 👍 reactions on the first comment/OP.

brettcannon avatar Feb 08 '23 20:02 brettcannon

How is it going now?

ArkiZh avatar Feb 22 '23 02:02 ArkiZh

How is it going now?

As the "needs proposal" label indicates, at this point someone needs to come forward with a proposal on how to make this feature work, both from a UX and code perspective. As of right now this is the 11th most upvoted issue, so it's not at the top. You can also always check our iteration plan to see if something is scheduled to be worked on in the next month (this specific issue is not).

brettcannon avatar Feb 27 '23 23:02 brettcannon

eagerly waiting for this feature

mahes1287 avatar Aug 13 '23 21:08 mahes1287

This is really helpful if added. Saves time in repos with a deep class hierarchy (regardless of it being a bad practice)

pbasimfa avatar Sep 06 '23 15:09 pbasimfa

Please add this feature!

MilanHofmann avatar Oct 13 '23 11:10 MilanHofmann

created an enhancement issue for showing class hierarchy feature discussed above.

Appreciate and value all the feedback!

judej avatar Oct 18 '23 21:10 judej

Thanks for all the responses and feedback. This feature request has been added to our backlog. issue.

Jude

judej avatar Oct 23 '23 16:10 judej

Closing issue. this has been implemented. Thanks again for your help. https://github.com/microsoft/pylance-release/issues/4978

judej avatar Jan 17 '24 01:01 judej

As far as I'm concerned, the issue should not be closed. What OP suggested is a way to fast check if a given method is overridden or inherited. The implemented solution only gives a possibility to show the hierarchy of methods, but not in such user friendly way as in pycharm UI. Please take a look at the arrows on OP's screenshots, you have a precise information about the hierarchy of methods without using any context menu as your implementation.

elskito avatar Apr 18 '24 21:04 elskito

@elskito, I agree. Despite Jude's comment that he was closing the issue, it appears it was never closed. I'm going to hide our three comments to avoid future confusion. I appreciate you pointing this out.

debonte avatar Apr 19 '24 18:04 debonte

@elskito, I agree. Despite Jude's comment that he was closing the issue, it appears it was never closed. I'm going to hide our three comments to avoid future confusion. I appreciate you pointing this out.

Could you please tag this as well? It's been a while since the OP made a suggestion, and after checking other issues, this request has the most thumbs up. Any information about implementing this feature in future releases would also be wonderful :)

elskito avatar Apr 19 '24 20:04 elskito

Eagerly waiting for this feature

rbli-john avatar Jul 30 '24 20:07 rbli-john

whether current method override a method or not is cheap, but finding out whether other classes overriding this method is expensive. that's why we are hesitant. but once we do full mode (https://github.com/microsoft/pylance-release/issues/5434), we might put this feature under full mode since they opt-in to richer features at the expense of performance.

heejaechang avatar Jul 30 '24 22:07 heejaechang