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.
Product Version = NetBeans IDE 8.2 (Build 201609300101) Operating System = Linux version 4.7.5-200.fc24.x86_64 running on amd64 Java; VM; Vendor = 1.8.0_101 Runtime = Java HotSpot(TM) 64-Bit Server VM 25.101-b13 Reproducibility: Happens every time Reproducibility: Happens every time STEPS: * I have the following indentation settings for all the languages: Expand Tabs to Spaces: yes Number of Spaces per indent: 2 Tab Size: 2 inherited by all the languages (PHP and Javascript included) * I'm in a PHP class writing some code (please consider also the number of spaces included): public static function HTMLencode($s) { return htmlentities($s, ENT_QUOTES |ENT_IGNORE | ENT_HTML5, "UTF-8"); } * The code doesn't complain with a PHP coding standards because the opening curly bracket position. So, I position the cursor just before the opening curly bracket and I push it down a line. * The result is unexpected: public static function HTMLencode($s) { return htmlentities($s, ENT_QUOTES |ENT_IGNORE | ENT_HTML5, "UTF-8"); } * the indentation of the curly bracket get broken instead to align correctly under the visibility keyword. ACTUAL: the indentation of the existing code get broken EXPECTED: the indentation of the code should be adequate correctly
Created attachment 162578 [details] IDE log
Created attachment 162579 [details] after
Created attachment 162580 [details] before
Thanks for reporting.
Fixed. http://hg.netbeans.org/web-main/rev/3d716a8ca6a2 Tomas, PHPFormatter.reindent was invoked twice(It means that an indentation may be broken. Actually, my fix was broken). So, I also checked Context.mimePath(). One MimePath of Context has text/javascript as a mimeType when I debug it. Thanks!
(In reply to junichi11 from comment #5) > Tomas, PHPFormatter.reindent was invoked twice(It means that an indentation > may be broken. Actually, my fix was broken). So, I also checked > Context.mimePath(). One MimePath of Context has text/javascript as a > mimeType when I debug it. So, should we report a bug against JavaScript? Or..? Anyway, thanks for the fix, Junichi!
(In reply to Tomas Mysik from comment #6) > So, should we report a bug against JavaScript? Or..? Probably, I think that it's no problem because we can avoid that. I just wanted to let you know the reason for my change :) Just information: It seems that Html and CSS use the specific class(CssIndentTask, HtmlIndentTask). Other than that(JS, PHP) use GsfIndentTask. > Anyway, thanks for the fix, Junichi! You are welcome :)
(In reply to junichi11 from comment #7) > Probably, I think that it's no problem because we can avoid that. I just > wanted to let you know the reason for my change :) So, if you have a reproducible use case, feel free to report it, please. Thanks!
(In reply to Tomas Mysik from comment #8) > So, if you have a reproducible use case, feel free to report it, please. I see. Thanks!
Integrated into 'main-silver', will be available in build *201611090620* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-silver/rev/3d716a8ca6a2 User: Junichi Yamamoto <junichi11@netbeans.org> Log: #268621 - code indentation broken when I push down the opening curly bracket of a method