Is there a way in PhpStorm to show the hierarchy of where I am in the code? I'll often be placed on line 800 of some crappy top-down file and have no idea what block of the file I'm in.
For example, if my code looked like:
if (a) {
// ... 200 lines of code ...
if (unrelated) {
// ... 200 lines of code ...
}
if (b) {
// ... 200 lines of code ...
} else {
// ... 200 lines of code ...
if (c) {
switch ($var) {
case 'a':
[MY CURRENT CURSOR LOCATION]
}
} else {
// ... 200 lines of code ...
}
}
}
I'd want to see a summary something like:
if (a) {
if (b) {} else {
if (c) {
switch case 'a':
That is not available for PHP (and I'm not sure if it's present for any other supported "coding" language like JS/Java/Ruby/Python/etc).
For PHP it shows max 3 levels: Namespace, Class and Method. It does not include control/logic flow directives (if/else/for/switch)
For hierarchical/markup languages like HTML/XML/JSON/YAML/CSS (mainly pre-processors that allow nesting) and alike it will show more nodes due to their nature.
The best I can suggest right now that will help a bit (excluding refactoring such code as it's out of the scope and may not always be possible):
Partially related existing tickets:
Feel free to submit your own Feature Request ticket at PhpStorm's Issue Tracker.
The possible issue with implementing this might be the expected complexity of the "if" conditions (most obvious case) -- quite often it will consist of 2+ conditions that might be quite lengthy (e.g. occupies 2+ lines). Problem arise with "how to display it in that small breadcrumbs area that is available".