Skip to content

Conversation

@dangreb
Copy link
Contributor

@dangreb dangreb commented Sep 8, 2025

While tending to an issue regarding Type Renderers on PyCharm, I thought it would be nice if we had an option to apply certain customized renderers to subclasses of the indiccated Target Type. It's been ages since i dabbled with Java like code so i went ahead and did it!

image

I also did some cosmetics for the customizing GUI. The new checkbox labeled "Apply to subclasses" makes so that instances of any subclasses of the indicated Target Type will receive the very same treatment from the IDE, in regards to that singular renderer of course.

I need to test it further still, so i'll open this draft for now, also so we can ponder over its relevance and viability of course!

cheers!

@BartvHelvert BartvHelvert added the PyCharm Pull requests for PyCharm label Sep 8, 2025
@dangreb
Copy link
Contributor Author

dangreb commented Sep 11, 2025

After several tests, adjustments and improvements, it seems reasonable to promote this for reviewing. Please feel free to do so at your convenience!

Some important facts:

  • A rule was included to ignore subclass matching when builtin types are set as the Target Type, even when the option is selected. This should grant safety and discard an arguably unecessary scenario.
  • Target Type resolving will take place during construction of UserTypeRenderer instances, for better architecture and availability, as well as potentialy less repetition

Also:

  • Fixed validation mechanics for the Target Type input field.
  • Added context helper tooltip for further clarity

cheers!

image

@dangreb dangreb marked this pull request as ready for review September 11, 2025 06:09
@avokin2 avokin2 assigned EliseevEgor and unassigned avokin2 Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PyCharm Pull requests for PyCharm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants