Please use the Apache issue tracking system for new NetBeans issues ( !!
Bug 196879 - Functions can not be folded when defined as a variable
Functions can not be folded when defined as a variable
Product: javascript
Classification: Unclassified
Component: Editor
PC Windows XP
: P3 with 4 votes (vote)
: 7.3
Assigned To: Martin Fousek
Depends on:
  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


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){

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...

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">
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:

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