Javascript /// <field type =?> For instances of custom objects

Trying to get used to the javascript XML comment syntax of Visual Studio XML. I have a question specifically about type. Say I have a custom type like ...

namespace.types.User = function(_id, _name) {
    /// <field name="id" type="Number">ID of the user</field>
    /// <field name="name" type="String">Name of the user</field>
    this.id = _id;
    this.name = _name;
};

If I want to reference this type in <field>later, I would do something like ...

namespace.session = function() {
    /// <field name="CurrentUser" type="namespace.types.User">The current User of the session</field>
    this.CurrentUser = new namespace.types.User('foo', 'bar');
};

However, when I do this, Intellisense will show me a description of what it .CurrentUsermeans , but it will not show any offers either for .idor for .name. In other words, it acts like a simple object without data of another type.

How can I get VS information for a richer description of custom objects?

+3
1

xml .

namespace.types.User = function(_id, _name) {
   /// <param name="_id" type="Number" /></param>
   /// <param name="_name" type="String" /></param>
}

/// <field> </field> intellisense , intellisense . , , , .

, /// <field> </field> intellisense . - IDE , intellisense . VS 2010 .

, , , .

- javascript. ( , mozilla, ).

+1

Source: https://habr.com/ru/post/1794176/


All Articles