Syntax errors not going away even after they are fixed

Hello,

I have been using PhpStorm for a few months. This issue seems to appear after I have updated to the latest version (6.0.2), but I am not sure if this is the cause of my problem.

The problem is that, when I am editing the PHP file, the syntax error doesn't go away even I am very certain that I have fixed the highlighted error.

Here are a few examples:

#1. When I write something like "$x = 1;", the editor prompts me that the local variable $x is unused. Fine. But this won't go away even I use $x later on.

#2. I use the autocomplete feature a lot. So for example when I want to type "$this->getSomeObject($id)", I can only just type "$this->getS" and press [enter] to let PhpStorm outputs something like "$this->getSomeObject()".
Now, as "getSomeObject()" expects a pareter, PhpStorm would underline this line with red, saying  that "Required parameter $id is missing". Fine. However, this error won't go away even I fill in the missing piece.
Which means that the IDE will still underline the line "$this->getSomeObject($id)" and complain that I "Required parameter $id is missing".

I see similar problems everywhere in my code, where PhpStorm reports of "unused local variable", "required parameter missing", "undefined variable" etc. never go away. Not even after I reopen the offending file.

Reopening the project can eliminate the outdated error highlights, but similar errors will occur again.

I tried removing the .idea folder, but it doesn't seem to help.
Is there anything else I can try?  Will a reinstall fix this issue?

Thanks in advance.

2 comments

Hi there,

Please try "File | Invalidate Caches..." -- very useful if having problems after upgrading from one version to another.

0

Exactly what I'm looking for. Thank you very much!

0

Please sign in to leave a comment.