Unresolved function or method on very basic JS class

I'm using PHPStorm 2017.2, and no matter what I do, I can't get it to recognize JS methods. I've stripped it down to the most basic example I can, and still no luck.

 

In the example below, PHPStorm shows "Unresolved function or method exampleInstanceMethod()" for line 8. What do I need to do to fix this?

 

/* eslint-disable no-console */
/**
*
* @constructor
*/
var TestThing = function()
{
this.exampleInstanceMethod();
};

TestThing.prototype.exampleInstanceMethod = function()
{
console.log('hello');
};
3 comments
Comment actions Permalink

First, please try running through the caches invalidation (File | Invalidate Caches / Restart).

If it doesn't help, try creating a new empty project and check the same example there.

0
Comment actions Permalink

Invalidating the caches did not correct the issue.

The example worked in a new empty project.

Should I delete and recreate my existing project?

0
Comment actions Permalink

Please try that. Back up the .idea folder, delete it and recreate the project.

0

Please sign in to leave a comment.