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 7.3 RC2 (Build 201302050851) Operating System = Linux version 3.2.0-37-generic running on amd64 Java; VM; Vendor = 1.7.0_13 Runtime = Java HotSpot(TM) 64-Bit Server VM 23.7-b01 When opening a javascript file all the code contained within curly braces {} is automatically folded. In the Options, the only box that I have checked for automatic folding is Methods.
Created attachment 131407 [details] IDE log
I can't reproduce it, If I have e.g. object literal var controls = { touch: new TouchOperator() }; then it stays expanded as expected. The same goes for for statements, if-else statements, jsdoc etc. Could you please share code that is incorrectly folded? Product Version: NetBeans IDE 7.3 (Build 201302132200) Java: 1.7.0_15; Java HotSpot(TM) Client VM 23.7-b01 Runtime: Java(TM) SE Runtime Environment 1.7.0_15-b02 System: Linux version 3.2.0-35-generic-pae running on i386; UTF-8; en_US (nb)
I still can't reproduce it but even if I don't think this is P1
The code that's reproducing it is every js file on my system. For some reason everything with curly braces is automatically folded, along with the functions, when the page is opened. It makes no difference if the braces are on different lines or the same line. It also does not happen with PHP so it seems to be related only to js. Is there a log or something like that I can send you that will give you more information about what's happening when the error occurs?
Did you import any settings from previous version? Could you try it with clean userdir? Just run the ide from command line via command netbeans.sh --userdir /path/to/new/userdir. Thanks.
I followed the directions and the problem persists. ~/netbeans-7.3rc2/bin$ sh netbeans --userdir /home/nbtest When the IDE started I opened a js file and verified that nothing was collapsed. I then went into options, enabled 'Collapse by Default'->'Methods' and then re-opened the js file. It immediately collapsed all the functions and when I opened the $(document).ready(function() {} at the top of the script there were two instances of code in curly braces and both were collapsed. That was true of the rest of the file and of the other js files that I checked. I tested the six 'Collapse by Default' options and only 'Methods' caused this error to occur.
Thanks for the clarification. I can reproduce it now. I can reproduce it with this code for example: $(document).ready(function() { var test = { getName : function () { } }; function Martin (text) { if (text === 'test') { text = text + " one"; } else { text = text + " two"; } } });
Should be fixed in web-main. http://hg.netbeans.org/web-main/rev/672187f58ec3
Integrated into 'main-golden', will be available in build *201303042300* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/672187f58ec3 User: Petr Pisl <ppisl@netbeans.org> Log: #226142 - Javascript Code Folding Error
Reporter, could you please test it in a dev build. It will be probably part of the dev build tomorrow. You can download it from http://bits.netbeans.org/download/trunk/nightly/latest/ Thank you for your help
I can confirm that this is resolved in 7.3.