Okay, so this time I really read your question (sorry, I was in the middle of something before).
Problem
Visual Studio does not recognize the JSDoc syntax that you use to determine the type of element in your array - at least not with regard to intellisense.
Decision
XML is the solution here. You may be aware of this, but you can use JSDoc tags in conjunction with XML comments to circumvent their individual limitations. I'm not sure what tags and attributes you used when you ran your tests before, but here is the correct implementation of your code:
/** * @typedef {Object} JSON_Response * @property {Number} id * @property {String} name * @property {JSON_Response_Tag} tag */ /** * @typedef {Object} JSON_Response_Tag * @property {Number} id * @property {String} color */ /** * @param {JSON_Response[]} response */ function process_response(response) { /// <param name='response' type='Array' elementType='JSON_Response'></param> response[0]. // intellisense works here }
DOCUMENTATION OF MALFUNCTIONS OF PARAMETERS FOR INTELLIGENCE
As for your comment and the changes you made to your question, you can specify the properties of the attached properties using the value attribute of the param XML comment. The term "value" is a bit misleading, because according to the MSDN documentation , it is not used to actually indicate the value, but rather the type of value. See below:
/** * @typedef {Object} JSON_Response * @property {Number} id * @property {String} name * @property {JSON_Response_Tag[]} tag */ /** * @typedef {Object} JSON_Response_Tag * @property {Number} id * @property {String} color */ /// <summary name='JSON_Response_Tag' type='Object'>my test summary</summary> /// <field name='id' type='Number'>testid</field> /// <field name='color' type='String'>testcolor</field> /** * @param {JSON_Response} response */ function process_response(response) { /// <param name='response' type='JSON_Response' value='{id:0,name:"",tag:[{id:0,color:""}]}'></param> response.tag[0]. // intellisense works here }
Regarding Companynerd225 Alternative
I'm not quite sure that categorizing JSON objects as classes instead of types is the most accurate method here. Also, although I may not know the correct terms for this, I am sure that the function that returns {id:0} is not the same as the function that returns this . See below:

Not to mention that you will finish filling out the JSDoc Classes section with types. By default, this will look in your navigation:

source share