microsoft / pylance-release

Documentation and issues for Pylance
Creative Commons Attribution 4.0 International
1.71k stars 765 forks source link

show class hierarchy or method override like pycharm #4972

Open yiciu opened 2 years ago

yiciu commented 2 years ago

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

judej commented 2 years ago

Waiting for upvotes on this feature request

luabud commented 2 years ago

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.

brettcannon commented 2 years ago

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.

andrewellis55 commented 2 years ago

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

ArkiZh commented 2 years ago

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.
msouff commented 2 years ago

Just do it

parijathakumar commented 1 year ago

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.

brettcannon commented 1 year ago

If an open poll is created

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

ArkiZh commented 1 year ago

How is it going now?

brettcannon commented 1 year ago

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).

mahes1287 commented 1 year ago

eagerly waiting for this feature

pbasimfa commented 1 year ago

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

MilanHofmann commented 1 year ago

Please add this feature!

judej commented 1 year ago

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

Appreciate and value all the feedback!

judej commented 12 months ago

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

Jude

judej commented 9 months ago

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

elskito commented 6 months ago

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.

debonte commented 6 months ago

@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.

elskito commented 6 months ago

@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 :)

rbli-john commented 2 months ago

Eagerly waiting for this feature

heejaechang commented 2 months ago

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.