This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 249018 - Add support for documentation javascript arguments with properties
Summary: Add support for documentation javascript arguments with properties
Status: NEW
Alias: None
Product: javascript
Classification: Unclassified
Component: Documentation (show other bugs)
Version: 8.0.1
Hardware: All All
: P3 normal with 1 vote (vote)
Assignee: Petr Pisl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-12-01 01:10 UTC by brettryan
Modified: 2014-12-02 14:38 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
IDE reports "Incorrect Documentation" (82.32 KB, image/png)
2014-12-02 13:23 UTC, brettryan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description brettryan 2014-12-01 01:10:02 UTC
Documenting a property argument should allow for documenting of known property values that function may use. Consider the following:

    /**
     * @param   {Object} opts
     *          Object containing properties to create widget for.
     * @param   {String} opts.keyField
     *          Key field for property
     * @param   {String} [opts.label]
     *          Label to add to select widget
     * @param   {(String|function|Array.<String>)} opts.dataSource
     *          Source for option elements, may be: ...
     * ...
     */
    function makeSelectWidget(opts) {
    }

In the above the IDE hints about incorrect documentation for opts.keyField and opts.dataSource while these are correct documentation conventions as per [1]


 [1]: http://usejsdoc.org/tags-type.html
Comment 1 Petr Pisl 2014-12-02 12:45:39 UTC
If I understand correctly, you expect that code completion after opts. should offer keyField, label and dataSource according the documentation. I'm correct? Thanks.
Comment 2 brettryan 2014-12-02 13:23:16 UTC
Created attachment 150840 [details]
IDE reports "Incorrect Documentation"

That would be brilliant, but what I'm primarilly reporting is that the IDE reports this as an error in the documentation when it is not.
Comment 3 brettryan 2014-12-02 14:18:56 UTC
Just thinking about your code completion comment that it could be handled better via a new feature request to add support for @typedef.

I've created this request -> https://netbeans.org/bugzilla/show_bug.cgi?id=249068
Comment 4 Petr Pisl 2014-12-02 14:38:42 UTC
Thanks for the clarification. Now it's clear.