Bug 196879 - Functions can not be folded when defined as a variable
Functions can not be folded when defined as a variable
Status: RESOLVED FIXED
Product: javascript
Classification: Unclassified
Component: Editor
7.0.1
PC Windows XP
: P3 with 4 votes (vote)
: 7.3
Assigned To: Martin Fousek
issues@javascript
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-03-19 20:35 UTC by robyter
Modified: 2012-09-14 14:07 UTC (History)
0 users

See Also:
Issue Type: DEFECT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description robyter 2011-03-19 20:35:22 UTC
Code Example:
function test(){
    var notFolding = function(){
        return 0;
    }
    
    function folding(){
        return 1;
    }
    
    return {
        init: function(a){
            if(a)
                notFolding();
            else
                folding();
        }
    }
}

The Function notFolding can not be folded. This is valid JS code and any function should be foldable no matter how it is defined.
Comment 1 damirsecki 2011-08-01 07:34:16 UTC
I am confused why netbeans in version 7 still doesn't support jQuery... specially for code folding...

I have code snippets like this...

$('#something').click(function(e)){
   ....
});
and of course I'd like my code to be folded, so it would be more readable...

I also tried with cosum fold tags like

`//<editor-fold  defaultstate="collapsed" desc="el click">
   .... 
//</editor-fold>`
that strangly doesn't work in javascript (only in java I suppose)...

same thing goes for JS singletons...

Please advise, how can I fold some snippets in JS with netbeans

just to be clear, I already activated all options in NB settings for code folding
Comment 2 Martin Fousek 2012-09-14 14:07:16 UTC
Both folding troubles look to be working well in the new javascript editor. Checked in NetBeans IDE Dev (Build 20120914-ac1d452b1bf9). Feel free to test new javascript editor in the latest development builds:
http://bits.netbeans.org/download/trunk/nightly/latest/


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo