Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
515 views
in Technique[技术] by (71.8m points)

folding - PhpStorm - can you "collapse to level" without recursion?

One feature that I miss from Visual Studio (and which I've never seen anywhere else) is "collapse methods" or something like that. In essence, you collapse method (function) bodies and ONLY function bodies. That is, if there is an if statement inside that function, it DOESN'T get collapsed. So that when you expand the function body, it ALL gets expanded.

In PhpStorm you can collapse starting at level X (which would work), but it then also recursively collapses everything below that level, which isn't what I want at all. I just want to collapse all methods at their top level so that I can see a class with its method names, and then when I click a particular method to expand, I want it all to get expanded and see the full source.

Is this possible somehow?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Not currently possible ?? . Maybe some custom plugin... but I'm not aware of such.

Watch these and related tickets (star/vote/comment) to get notified on any progress:

P.S. IDE has Settings/Preferences | Editor | General | Code Folding --> Fold by default but at the same time it does not provide an action to re-apply that folding on request (separate action that can be invoked at any time). It's https://youtrack.jetbrains.com/issue/IDEA-80100


The best you can do here is:

  1. Use "Collapse All"
  2. Click on [+] for each method when needed with Alt key pressed (this will recursively expand/collapse all sub levels). Or use a keyboard shortcut (Code | Folding | Expand Recursively).

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...