"Unresolved function or method" - why??

I have a node.js project that includes the node-imap module. That module uses code like this to inherit from events.EventEmitter:

After the constructor:

util.inherits(ImapMessageHandler, events.EventEmitter);

and inside the constructor:

    events.EventEmitter.call(this);

When I create an object of that class ".on" is found, which comes from EventEmitter.

I did EXACTLY THE SAME, I declared my own class with the above methods. And yet, when I enter

    myObject.<CTRL-SPACE>

I get nothing!


Unfortunately it seems completely undocumented how WebStorm derives its information?

By the way, on the other hand the completion attempt gives me options like "return", "if", "throw", "typef" - WHAT??? Why does WebStorm think those Javacsript keywords make sense as object property suggestions? EDIT: Okay I get it, that inserts a code template. CTRL-SHIFT-SPACE only shows the properties WebStorm has found. Interestingly (but this is bad because it's unexpected, unexplained, confusing) when I try CTRL-SHIFT-SPACE with the node-imap object I DO NOT get "on" and "once" and other inherited methods, but I do get them with CTRL-SPACE - which means there is no autocompletion method that gives me only object properties (and all of them).

.

PS: I'm really curious, thus far I have never received any reply at all to whatever I ask. There doesn't seem to be much of a community for this product even though in discussions about "which IDE" it is always mentioned first. I don't get it, the functions that make it unique as an IDE are BUGGY as hell and I find myself filing bug report after bug report on https://youtrack.jetbrains.com/

And why doesn't this comment editor not let me easily declare something "code"? Do I have to scroll through the long font list to select monospaced? There is an "Insert video" button though, I'm sure that's important. After all, compared to inserting video links, how many people would want to post code in these forums?  /s

9 comments
Comment actions Permalink

Have you tried File | Invalidate caches and restart?

2
Comment actions Permalink

I don't know what I did about that specific problem, but I quickly find new ones. I've filed a few tickets by now (5 about bugs I found the last few days).

Right now I get a warning about "filter()" being undefined - on an Array, in ES6 mode, and several "magic number" warnings even though I assigned them to constants (ES6 "const" - already filed as bug). And I had to redefine 3 of 5 instance properties as "/** @private */" even though I had already done so in the constructor - it works for 2 of the 5!

Also, the autocompletion suggestion contain TONS of completely made-up stuff - where on earth does WebStorm unearth that???

For example, for a node.js module instance of mone it suggests (among a thousand other completely unbelievable completions) .dirname() as completion. Just out of curiosity if I had overlooked a possibility that this might be a legit completion I tried to run the resulting code - of course there was no such method on that instance.

In sum, I'm not even sure if filing bugs helps, these features are "experimental" and "exploratory" (i.e. the develoeprs are experimenting) at best, certainly not "production ready".

The way I use WebStorm now is ONLY for the inspections and eslint background checking. I stay away from autocompletion and types - I still write my JSDoc but not for WebStorm, it's no use.

0
Comment actions Permalink

The only thing that `File | Invalidate caches and restart` does for me is reset it long enough to trick me into thinking the error is gone. Once the inspections run again the error comes back.

I saved myself all that frustration by just disabling all JetBrains inspections  (`Editor` > `Inspections` > uncheck `JavaScript`) Then I installed the ESLint plugin. 

The inspection that causes "Unresolved function method" can be turned off by going to JetBrains inspections  (`Editor` > `Inspections` > `JavaScript`) and searching for "Unresolved Javascript" and turning off "Unresolved Javascript function" and "Unresolved Javascript variable" I killed them all and have edited my code hassle free ever since.

Good luck.

0
Comment actions Permalink

I'm having similar problems with autocomplete. My tests pass, but I can't see isAuth() method in my controller class. Must admit, I'm new to Intellij, but I've searched online and can't get to the bottom of it. Any help is greatly appreciated. 

Thanks
Stephen

0
Comment actions Permalink

please provide your 'auth.controller' module code

0
Comment actions Permalink

Many Thanks,
Stephen

0
Comment actions Permalink

thanks! it's a known issue unfortunately, please follow https://youtrack.jetbrains.com/issue/WEB-24161 for updates

0
Comment actions Permalink

Thanks, will do.

0
Comment actions Permalink

@Stephen Harper Please check this solution, It worked for me with exact problem like yours
https://stackoverflow.com/a/37839220/348162

0

Please sign in to leave a comment.