Switch-case indentation

PHP Tools [?] extends Visual Studio with set of advanced features to work more efficiently with PHP code.

Switch-case indentation

Postby Maestro » April 28th, 2016, 3:38 pm

Small but annoying bug. Break jumps one tab to right as soon as you press ;

Image

It should act like a closing tag for "default" or "case". But it acts like a part of content inside "default" or "case", adding one extra tab.
User avatar
Maestro
 
Posts: 7
Joined: April 28th, 2016, 3:16 pm

Re: Switch-case indentation

Postby Miloslav Beno » April 29th, 2016, 12:30 pm

Hello,

Thank you for the post.

Actually this is not bug, it's intended behavior, because break is not really a closing tag. It's just another statement in the case/default block.

Please take a look at the samples on php.net, it's always formatted like this.
http://php.net/manual/en/control-structures.switch.php

I could imagine an option to indent/not indent the content of case/default blocks, but not just a break,return, die or another statement which can end the case block. You can even leave the block without any returning statement, so program flow would just continue.

Thank you,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm

Re: Switch-case indentation

Postby Maestro » May 3rd, 2016, 11:24 pm

Thanks, didn't knew that. Guess I'm just used to wrong indents on my previous IDE.
User avatar
Maestro
 
Posts: 7
Joined: April 28th, 2016, 3:16 pm

Re: Switch-case indentation

Postby Miloslav Beno » May 4th, 2016, 1:12 pm

No problem ;-)

Have a good one,
Miloslav Beno │ DEVSENSE s.r.o. │ @miloslavbenomiloslav@devsense.com
User avatar
Miloslav Beno
 
Posts: 1252
Joined: January 7th, 2012, 8:36 pm


Return to PHP Tools

Who is online

Users browsing this forum: No registered users and 112 guests

cron

User Control Panel

Login

Who is online

In total there are 112 users online :: 0 registered, 0 hidden and 112 guests (based on users active over the past 5 minutes)
Most users ever online was 453 on April 27th, 2024, 1:05 am

Users browsing this forum: No registered users and 112 guests