This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | "Alternative syntax for control structures" in PHP are indented incorrectly | ||
---|---|---|---|
Product: | php | Reporter: | ozanhazer <ozanhazer> |
Component: | Formatting & Indentation | Assignee: | Petr Pisl <ppisl> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | bobw |
Priority: | P3 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | All | ||
Issue Type: | DEFECT | Exception Reporter: |
Description
ozanhazer
2010-06-04 09:16:56 UTC
The alternative syntax should definitely be supported, but don't forget that it's not just for HTML files: you can use it in pure PHP files, too. In the latter case, the endxxx token should pretty much be handled like }, and balancing should work between it and the :. Now it should be ok. I have rewrite the part of formatter and now the formatter reflects the alternative syntax. You can check it with a development build. Let me know, whether now it works as you expect. Two things I notice: 1) After typing "switch (condition):" and hitting return, NB auto-inserts the endswitch, but it doesn't automatically indent the line between them as it does with the other control structurs. 2) This may be outside the scope of your change, but it would be very helpful if NT could balance-highlight the colon and endxxx, similar to what it does with { and }. |