Changes in smart indentation

I have made some improvements to the smart indentation feature in VS.Php. Smart indentation can be enabled here:

I tried to address a number of issues with the previous version where things didn't align well. In many cases things don't align well if there are syntax errors so it is difficult to do it then.

One of the things I do as I write code is Ctrl+K Ctrl+D, this will auto indent the entire document. You can also do Ctrl+K Ctrl+F if you want to auto indent selected text.

In the new build, <?php blocks are no longer push all the way to the left. They stay where they are and their content will be aligned to their indentation.

This will hopefully work when you have a lot of HTML and PHP mixed together and you use indentation to keep things readable.

VS.Php still does not auto indent HTML content, so it simply use block indenting when outside PHP content.

Give it a try and let me know if you see some odd behavior.

Thanks,

Juan

AttachmentSize
php-smart-indent.PNG37.74 KB

langdon says:

Where can I find the latest build?

juanc says:

langdon says:

First off, it's great to see that Allman and C style indentations are both supported... even within the same file!

That said, I noticed a few things that will still have me using Block indentation. There's still a ways to go before it's 100% perfect in my mind (I'm spoiled by C#'s very mature IntelliSense).

Anyway, I created a few bugs, because I figured they would be more useful than listing them here. TIA!

panic says:

This is great news. I tried the latest trial and ran into a few issues - sometimes VS will crash with CTRL+K+D but it's still a huge improvement over what it was before.

This is the number one feature that has kept me from moving our whole dev environment to VS.PHP, so please please keep up the work on this feature :). I really want to make the move to this, but whenever I use a trial I have major issues with the indenting and CTRL+K+D would cause VS to crash a lot (still does a little bit, but not as much).

Anyway, now that I know this is being worked on, I'll keep a close eye on this product.

Thanks!

juanc says:

Try the latest build (I put a few more fixes):

http://svn.jcxsoftware.com/node/109

I'm certainly very interested in crashes. If you have some repro steps, please share with me.

Also, if you can get a memory dump of the crash, that'd be useful too.

Juan

panic says:

Awesome, tried build 5908 on all my files in one of my projects and not a single crash this time!

I did find two small indenting errors which I reported at:
http://www.jcxsoftware.com/mantis/view.php?id=306 and
http://www.jcxsoftware.com/mantis/view.php?id=307

I only had those issues in two of my files, almost all of the other ones worked out great. I'm really excited, I think this is the main thing VS.PHP really needs to be a top of the line PHP editor.

Thanks

wiiliam123 says:

One of the things I do as I write code is Ctrl+K Ctrl+D, this will auto indent the entire document. You can also do Ctrl+K Ctrl+F if you want to auto indent selected text.
This will hopefully work when you have a lot of HTML and PHP mixed together and you use indentation to keep things readable.
VS.Php still does not auto indent HTML content, so it simply use block indenting when outside PHP content.