Re:A Missing IDE Feature
by mrweasel on Monday November 04, 2024 @08:55AM
(#42041539)
That's probably a secondary issue. The suggestion is to change how code folding is done. Most IDEs can do some type of code folding, but in this case the author is asking for it to work in a certain way.
I don't think the example is all that good, because it's not the same code in both screenshots. The suggestion, as I read it, is that folding the "impl Body" shouldn't collapse the entire thing to impl Body { ... }, but instead collapse all the functions inside it, because that's actually more useful. So you'd get
It this was Python and you collapsed a class, then rather than getting
class User(AbstractUser): ...
you'd get:
class User(AbstractUser):
def is_manager(self): ...
def get_username(self): ...
It would perhaps even be a little neat if you could have a class collapsed and you'd be shown only public methods, if the language has the concept of public and private methods.
To build on the "hiding awful code", I think this could help show awful API/interface design. If you have a class with a few hundred lines of code and a number of methods, then you rarely get to see all your methods listed, their signature just drowns in a sea of code. The also add doc strings, then you now have a documentation view of your own code in the IDE.
I don't think the example is all that good, because it's not the same code in both screenshots. The suggestion, as I read it, is that folding the "impl Body" shouldn't collapse the entire thing to impl Body { ... }, but instead collapse all the functions inside it, because that's actually more useful. So you'd get
It this was Python and you collapsed a class, then rather than getting you'd get: It would perhaps even be a little neat if you could have a class collapsed and you'd be shown only public methods, if the language has the concept of public and private methods.To build on the "hiding awful code", I think this could help show awful API/interface design. If you have a class with a few hundred lines of code and a number of methods, then you rarely get to see all your methods listed, their signature just drowns in a sea of code. The also add doc strings, then you now have a documentation view of your own code in the IDE.