JavaScript code completion for overloaded constructors and methods

Hi all,

I'm trying to add basic support for JavaScript Typed Arrays and WebGL to WebStorm. Basically, I would like to have WebStorm provide code completion and not produce spurious warning about undeclared types, properties and methods for Typed Arrays and WebGL related code. This requires making WebStorm recognize a couple of additional built-in and host objects and understand their properties and methods.

I'm now at a point where I can parse interface definitions from the specs and produce files in whatever format required by WebStorm. I experimented with generating JavaScript stubs and placing them in a JavaScript Library. However, the specs make heavy use of overloaded constructors and methods, and I haven't been able to make WebStorm pick up multiple definitions for a single constructor or method. This is probably because overloading is not supported by JavaScript at the language level (though a constructor or a function can inspect it's arguments at run-time, making de-facto overloading possible).

Any ideas where I should go from here? Basically, I would like to do the minimum work required to get code completion for overloaded constructors and methods of a pre-defined set of objects in JavaScript. Does WebStorm support JSDoc
@name tags and the ^n convention? I wasn't able to get them to work...


there is no quick answer to your question. I think we need to research this issue first. I'd recomment to submit a feature request at for WebGL support as the first step. Because of dynamic JavaScript nature, in some cases it takes more than just defining the right stubs.


Okay, thanks for your reply. I searched the issue database and found that requests had already been filed for both Typed Arrays and WebGL. If I'm reading the Typed Array one correctly, the support is already implemented and should be coming in the next major release. WebGL support seems to be currently unimplemented. I also found a bonus enhancement request about GLSL ES.


Please sign in to leave a comment.