JSDocs Issue.

Just noticed this after starting to use EAP10 in the last few weeks but no idea if that is the cause or its something else:

We define out js classes like this.

function(){
     var self=this;

    function myFunc(){

    }

    self.myFunc = myFunc;
    return self;
}

To avoid getting 'multiple implementation' bubbles in the intellisense etc, we jsdoc these classes as follows (following advise we had a year or so back on here )

 
/**
*
* @returns {mfc}
* @constructor
 
 */

var mfc = function(){
     var self=this;

 
  
 
  /**
   * some description
   * @param aparam
 
   * @memberof mfc#

     */    
    function myFunc(aparam){

    }

    /**@ignore */
    self.myFunc = myFunc;
    return self;
}

This worked fine until recently but now wherever we are using this class we get warnings when we call 'myFunc' saying can't access a private member.


If the above no longer works what is the correct way to JSDoc this stle of  class

Many thanks
Rob

15 comments
Comment actions Permalink

Did you try using @public maybe? Normally, everything is public by default, but stating it explicitely may help.

0
Comment actions Permalink

Please can you specify how you use this class/function? As I can't recreate the issue in WebStorm 10 EAP (140.2543)

0
Comment actions Permalink
 
there are hudreds of different classes in the app all have this issue - here is an example of one
  
/** @type DataSource */
var files;


files = new DataSource();

files.refresh(true);



'refresh' is highlighted and on mouseover shows a bubble 'Private member is not accessible'



 
In another file
function($){

 
"use strict";
 
/*
 
* @returns {DataSource}
* @constructor
*/
 
var DataSource = function(){
     var self = this; 
 
    
 
    /* 
 
    * @memberof DataSource#
    */
     function refresh(){ do-something;}       /** @ignore */      self.refresh = refresh;          return self;
 
};
 
/** @alias DataSource */
window.DataSource = DataSource;
})(jQuery);
0
Comment actions Permalink

can't recreate even when using your code - see attached screenshot
Can you recreate this issue in a new project?



Attachment(s):
private.png
0
Comment actions Permalink

If I create a files test.js with this content:

(function($){
    "use strict";

    /*
     * @returns {DataSource}
     * @constructor
     */
    var DataSource
= function(){
        var self = this;


        /*

         * @memberof DataSource#
         */

        function refresh
(){ 1+1;}
        /** @ignore */
        self
.refresh = refresh;
        return self;
    };
    /** @alias DataSource */
    window
.DataSource = DataSource;
})(jQuery);


/** @type DataSource */
var files
;

files = new DataSource();

files.refresh(true);


If in a new project with just that file then I don't get the issue.

If I create the file in  my existing project I do get the problem.

In my current project but I use a new classname i.e. ADataSourceA I don't get the problem, but I do get the problem for any pre-existing class.

0
Comment actions Permalink

Please try invalidating caches (File/Invalidate caches, Restart) - does the problem persist?


0
Comment actions Permalink

Problem still persists

0
Comment actions Permalink

Must be something specific to your project code. Can you attach a project that shows up the issue?

0
Comment actions Permalink

I have been able to create the issue using one of our exisitng files and copying that into a new project...

SInce its a commercial app I cant upload the file to this forum, can you give me an email address that I can send it to..

Thanks
Rob

0
Comment actions Permalink

I'd prefer not to publish my email on this forum... Please can you create a new support ticket via https://intellij-support.jetbrains.com/anonymous_requests/new, choosing 'WebStorm' as a 'Product', and attach the project to it?

0
Comment actions Permalink

Done.

Request #54067

Thanks
Rob

0
Comment actions Permalink

I noticed WS is now in RC phase and this issue is still not fixed.

https://youtrack.jetbrains.com/issue/WEB-15455

Do you know if this is going to be fixed before release or do you suggest we code things differently in future?  

0
Comment actions Permalink

Please ask the responsible developer for update directly in the ticket


0
Comment actions Permalink

Well  WebStorm 10 is now offically released and still intellisense is broken!

Really, really, really dissapointed in JetBrains.

We report the issue, we see the RC and again report the issue and still it gets released and for us Intellisense is just totally FUBAR.

Its not like we are asking for much, just what worked in 9 should work in 10 - or if its a WontFix then tell us how we should recode our entire app to make JetBrains happy.




Rob

0
Comment actions Permalink

We are giving up on 10 and reverting back to 9,  we will wait until later in the year and the 11 EAP starts and see if things are any better then.

0

Please sign in to leave a comment.