Not seeing how to get to closing HTML tag in .php file

I open up a .php code file, I notice this error:

I click "Rename end tag 'div' to 'main'", and the red underline goes away. Somewhere in this profuse mash of PHP/HTML is the actual end tag (not necessarily what PHPStorm thinks it is), but it's difficult to find because of the way it's coded (terribly).

Now, I can search for `</main`, but that shows three results: one which looks like the HTML end tag (within the HTML context), but two others coded within PHP if/else context... so now I'm wondering if that div tag that PHPStorm changed actually refers to another opening tag... I can't tell myself yet because of how terrible the code is done (inconsistent indentation).

I try to figure out the keyboard combination to go from start/end tag... now I'm in a rabbit hole.

I do a Google search: https://www.google.com/search?q=phpstorm+php+file+go+to+closing+html+tag

I go to the first result, an old StackOverflow post: https://stackoverflow.com/questions/25421355/shortcut-key-in-phpstorm-to-move-to-html-end-tag It doesn't seem to answer what I need, due to wrong OS or not enough information.

I find an open bug ticket: https://youtrack.jetbrains.com/issue/WI-20474

There seems to be some ugly workarounds, and then a comment "we decided to postpone the implementation until platform changes". I don't know what that means. I'm going out of my mind.

I don't even know what the proper name for a keyboard shortcut to go from start/end tags and back are even in a normal .html code file with nothing but HTML tag in it. Maybe I'm not seeing it. Maybe this should be easier. Maybe PHPStorm's architecture is difficult to go from start/end HTML tag and back in a .php file, who knows.

1 comment
Comment actions Permalink

As far as I see from WI-20474 details, the ticket is closed as "Fixed", so it might be a different case here.

What is about the original issue, it is hard to say anything for sure without seeing a full code sample first, could you please share it?


Totally friendly advice as a side notice: I would definitely recommend submitting support tickets or/and YouTrack reports instead of forum posts as there are more capabilities to process them -- for instance, you may easily attach files there and YouTrack is monitored by actual developers, not just community and PhpStorm support team.

0

Please sign in to leave a comment.