Hiding privates from Javascript Intellisense

Is it possible to hide certain functions / fields from being displayed in javascript intellisense dropdown in Visual Studio 2008? Or a javascript XML document, naming the rank and file, in a specific way?

I have seen <private />

in the jquery vsdoc file that implies exactly this behavior but does not meet my expectations

{
    __hiddenField: 0,
    /// <private />
    increment: function(){
        /// <summary>Increments a private variable</summary>
        __hiddenField++;
    }
}

      

But since fields cannot contain documentation (because they don't have a body), they must be documented at the top. But it still doesn't work:

{
    /// <field name="__hiddenField" type="Number" private="true">PRIVATE USE</field>
    __hiddenField: 0,
    increment: function(){
        /// <summary>Increments a private variable</summary>
        __hiddenField++;
    }
}

      

Impossible is a perfectly possible answer and will be accepted if you have the knowledge that it is truly impossible.

+2


source to share


2 answers


I'm not sure how to hide this from intellisense, but you can always use closure to hide the variable completely:

(function(){
    var hiddenField = 0;

    // not sure how you're defining your object; 
    // I'll just assume a global variable
    window.something = {
        increment: function(){
            /// <summary>Increments a private variable</summary>
            hiddenField++;
        }
    }
})();

      



This creates an anonymous function around your definition, so window.something.increment () will work and the "hiddenField" is really hidden.

+1


source


I think that to create a function / field, you need to add a hyphen in front of its name.



_increment: function(){
    /// <summary>Increments a private variable</summary>
    __hiddenField++;
}

      

0


source







All Articles