6 comments

Doesn't look like a regression, https://youtrack.jetbrains.com/issue/WEB-12808 is not repeatable for me.

Please provide a code snippet (as text) that can be used to recreate the issue

0
Avatar
Permanently deleted user

Hmm... this problem only seems to happen on that particular project. Upon creating a new one, it doesn't have that problem. Did the project settings get messed up somehow? If so, how can I fix it?

 

New project:

 

Old project:

 

Code snippet:

class Movie {
constructor(title, rating, hasWatched) {
this.title = title;
this.rating = rating;
this.hasWatched = hasWatched;
}

toString() {
let str = `You have `;
if (this.hasWatched) {
str += `watched `
} else {
str += `not seen `
}
return str + `"${this.title}" - ${this.rating} stars`
}
}

console.log(new Movie(`Frozen`, 4.5, false).toString());

 

Thanks!

0

Works fine for me:

 

Please try invalidating caches (File > Invalidate caches, Invalidate and restart) - does the issue persist?

1
Avatar
Permanently deleted user

 It's still happening after invalidating caches... :/

0

Please share a project that shows up the issue

0
I think I have the same problem. I have an ES6 class
with 2 methods open in WebStorm editor:

example ()
{ let see = $fs.readdirSync (myPath );
let see2 = $fs.readdirSync (myPath2);
}
example2 ()
{ let myPath = this.path();
}

The problem is in example(), the variable 'myPath2'
is (correctly) highlighted as unresolved but 'myPath' is not.

So just because I have used the variable 'myPath'
in some other method of the same class it thinks
it is ok to use it also in a method that does not
declare it. It seems.
 

 

0

Please sign in to leave a comment.