Domanda

I cannot seem to annotate a class so that its methods are know to the WebStorm editor.

Here is the example:

/**
 * @class my class
 * @constructor
 */
function MyClass() {
    this.aPublicField = "foo"
    var aPrivateField = "bar"

    this.aPublicMethod = function() {}
    var aPrivateMethod = function() {}
}

/**
 * @param {MyClass} aClass
 */
function doSomething(aClass) {
    aClass.aPublicMethod() <----- "Unresolved function or method"
}

The Java-like syntax should be correct.. I guess. Am I doing something wrong in the annotations?

È stato utile?

Soluzione

Documentation seems to be correct and code highlights fine for me in WebStorm 6.0.2a and the latest 7 EAP. I think your problem can be related to issue WEB-7548. We considered the word following @class tag to be the class name and properties were attached to the wrong class, so as a workaround now you could move class description somewhere from @class tag, or as a better alternative download latest WebStorm 7 EAP.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top