Reindenting code |
Site Admin
|
php tags (<?, <?php, ?>) are indented according to their level. Not sure what you think is wrong with the results
|
||||||||||||
_________________ The PHP IDE team |
|
Hi,
i dont say that the result is "wrong", but i want the reindented code to be as the "original" in this case. I think the php-tags and div-tags in this case should be indented relative to the containing function. |
||||||||||||
|
Guru master
|
Others might not agree, but I find breaking out of PHP into HTML halfway through a function very messy. This is possibly even the first time I've seen that done; it certainly doesn't get done in any of the web apps and frameworks that I deal with.
This is easier to read (despite lacking HTML syntax highlighting) and re-indents better as well:
For anything but the most simple function I would probably be inclined to use a simple template mechanism so that the function does not have any HTML in it. |
||||||||||||||
|
|
I see your point, but in some projects i have to use that syntax and combine php and html.
Its actually not a big deal, but i just wanted to know if there are some settings i could edit in PhpEd to change the way it do the indenting - or if the rules are hardcoded into the program. |
||||||||||||
|
individual settings would be nice |
|
I agree with Sveinla that it would be nice to modify the way PhpED reindents the code. It doesn't matter how someone writes code - the editor should follow the habit of the user not vice versa.
I'm also using Visual C# for windows- and .aspx-projects and this editor gives me the complete freedom how it formats code (while writing!). This is exactly how things should work and PhpEd doesn't reach this level by far - so far. Btw: imho mixing php and html in one function is not usual - but it may happen, especially in small or quick-and-dirty-projects and in this cases the way Sveinla formats code is much more clearer. |
||||||||||||
|
|
I would like to add my voice to the concept of indenting being user configurable. I am not a new programmer and have evolved a certain style over the years and it should be possible for me to tailor something as simple as indentation to my own preference.
I tried to buy polystyle but it seems they are simply accepting money and not delivering product keys now. RegNow or PayPal will fix it, so no big deal. It does raise the question of whether NuSphere should continue to include a trial of the indenter when it only leads to the end user having troubles. I would clearly like to get polystyle or have the ability to configure indentation in phpEd. It has been a lot of learning to move from Netbeans, but I am now getting pretty comfortable with it. Still only scratched the surface but the speed is surely nice to have and what I have managed to learn is nearly enough to work very productively. Still waiting for a rainy day to try out remote debugging, which was one of the key reasons to consider the move. So, the key point here is --> have a close look at how Netbeans allows the end user to change all aspects of indentation and use it during editing. It means I only have to reformat someone else's code and never my own because it already meets my spec. |
||||||||||||
|
Site Admin
|
I'm sorry to hear that you encountered problems with their product. We'll try to reach the author and in case of failure, we'll definitely remove the package. As of phped's own re-indent feature -- it's already there, available since ~ v5.6 It is not a re-formatting function like what polystyle does (did), phped only re-indents the code. |
||||||||||||||
_________________ The PHP IDE team |
|
Hi dmitri. Yes I am aware of the re-indent and that is why I tried to buy Polystyle. The re-indentation that phpEd does is maybe fine for you guys who write phpEd since it is your style but it is not the way I indent, and apparently I am not the only one with a style of their own.
It seems that it is too difficult to make the indentation tweakable by the user, so I will be looking at some other reformatters. I know it is a small matter but after many years of a certain style it breaks my stride to look at other code. The first thing I do with "alien" code is reformat it and right now it means I open it up with Netbeans, reformat and save. Then phpEd comes back onto the scene. It gets the job done, just like my mis-using Todo lists for Bookmarks. |
||||||||||||
|
Veteran
|
re-indent did what i expected it to do. I deleted all the tabs from some code, selected it, then re-indent'ed it. It looks just right.
What coding standards are you guys using? Nothing in the manual referring to what "re-indent" actually does, so guessing it just formats the selection? |
||||||||||||
|
|
Although this thread is several months old, I want to cast a vote for having configuration options regarding PhpEd's indentation rules.
For example, PhpEd indents all the lines between opening and closing PHP-Tags. This clashes with the coding style used in all the projects I'm working on (I'm the only one using PhpEd in my team). So whenever I use the auto-indent feature and commit my code to the repository, every line is marked as "changed". This renders this otherwise helpful feature pretty useless. Thanks! |
||||||||||||
|
Reindenting code |
|
||
Content © NuSphere Corp., PHP IDE team
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by
Powered by phpBB © phpBB Group, Design by phpBBStyles.com | Styles Database.
Powered by