Code inspection does not refresh on edit

Answered

Hi, since I upgraded to PyCharm 2016.1, the code inspection triggers any errors on code changes but does not clear the error highlight on edit. Once the code inspection finds an error, even if I correct the error/typo in the editor it still thinks there is an error. The error messages still refer to the old version of the code. I tried invalidating the cache but that did not help. Once I set the "Highlighing Level" to "None" and then back to "Inspections", the errors go away.

I am currently using:

PyCharm Community Edition 2016.1.2
Build #PC-145.844, built on April 8, 2016
JRE: 1.8.0_45-b14 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation
Thanks
-Selim

 

26 comments
Comment actions Permalink

Also just to add, this happens in one particular project. The code completion in other projects seems to work fine.

0
Comment actions Permalink

Same here, I have it in all projects though. If I cut and paste the code the introspection is reevaluated.

2
Comment actions Permalink

Hi Mkrens! Could you please create a ticket in our bug tracker and attach idea.log file from Help | Show Log in ... there?

2
Comment actions Permalink

Same issue here! I have to click on customize highlighting level and change it to syntax level, then back to inspections to make it refresh.

0
Comment actions Permalink

I had the same issue with the code inspection not updating, and at least in this case was able to fix it.   By trial and error and cutting sections out of the code I found that this snippet caused the issue everywhere before and after it in a 3000 line Python file.      

Here is the Bad snippet of code: 

import re   

s1 = re.search(r'(?i)p|\*', col1)    #   Which looks for an  asterisk or a p in the col1 string.  The asterisk is escaped with \

The issue goes away after removing the "\*"   or replacing above with:

pat = r'(?i)p|\*'
s1 = re.search(pat, col1)

 

Version below:

PyCharm 2017.3.2 (Community Edition)
Build #PC-173.4127.16, built on December 18, 2017
JRE: 1.8.0_152-release-1024-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Linux 2.6.32-642.6.2.el6.x86_64

 

1
Comment actions Permalink

Thank you for the comment Gghaibeh! This is, in fact, a different issue, I created a ticket for it: PY-28845.

0
Comment actions Permalink

Looks like this is still an issue for me with PyCharm 2018.1. Having to cut the affected code and paste it back to make errors/warnings go away.

0
Comment actions Permalink

I also still have this problem. Sometimes, however, it does update when you wait long enough. Might also just be a performance problem. Or there is an error that makes it slow.

0
Comment actions Permalink

I'm having this same problem across all projects:

 

PyCharm 2018.1.4 (Professional Edition)
Build #PY-181.5087.37, built on May 24, 2018

JRE: 1.8.0_152-release-1136-b39 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.13.5

0
Comment actions Permalink

I'm having this same problem...

PyCharm 2018.1.4 (Community Edition)
Build #PC-181.5087.37, built on May 24, 2018
JRE: 1.8.0_152-release-1136-b39 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0

How can solve it?

0
Comment actions Permalink

The same for me, it is very annoying, I always need to cut/paste lines to refresh state, please fix it

2
Comment actions Permalink

Hi Nikolay, could you please create a ticket in our bug tracker and attach idea.log from Help | Show Log in ...?

0
Comment actions Permalink

Hi All, I think I'm hitting the same problem. Memory and CPU are not struggling and cut+undo seems to take care of it right away.

Has anyone opened an issue for this yet?

Thanks!

-Jon

 

0
Comment actions Permalink

Hi Jon,

If you cannot find the issue, then you can always create your own and we will just set it as a duplicate if there is already such issue.

But please do not forget to attach idea.log from Help | Show Log in ... to it.

0
Comment actions Permalink

For a quick fix, as alluded to by OP:

  • Open the "Highlighting Level" tooltip: Code > Configure Current File Analysis... (default shortcut is Ctrl+Alt+Shift+H)
  • Set the cursor to "None" then back to "Inspections" (closing and reopening the tooltip in-between)
3
Comment actions Permalink

I still have this problem too. The tickets seems to have timed out. Any progress on this issue?

 

p.s. I don't want to disable all my plug-ins. That is not really an optimal solution.

0
Comment actions Permalink

Hello @Marcus Baker

 

Please submit a ticket here https://youtrack.jetbrains.com/issues/PY  with an attached screencast of the behavior and

folder zipped from ***Help | Collect logs and Diagnostic Data*** .

 

Custom plugins are third-party software and regrettably, we have no ability to track its affection that is why it is highly recommended to disable it as the first step of the investigation. 

0
Comment actions Permalink

2020.3 on mac, started seeing this behavior too. cut and paste indeed helps.

0
Comment actions Permalink

Hello, 

There is an existing issue, please take a look https://youtrack.jetbrains.com/issue/PY-45776 fix will be released soon. If it is not the case, please

upload your logs folder zipped from ***Help | Collect logs and Diagnostic Data***   to the FTP

https://uploads.jetbrains.com/ and please let me know the filename. 

0
Comment actions Permalink

Unfortunately this problem is happening again on 2021.2 ....

6
Comment actions Permalink

João Trevizoli Esteves

This is probably not the same issue, could you please submit a bug report to https://youtrack.jetbrains.com/issues/py ?

0
Comment actions Permalink

I'm encountering this problem too, in 2021.2, as reported by João.

In the event log, there was a complaint about an incompatible plugin (Tezos), so I disabled it (but kept it installed), then restarted through the «Invalidate and Restart» command. I closed some other windows too and it's resolved now. My suspicion is that the plugin incompatibility must've been causing side effects.

2
Comment actions Permalink

I just hit this issue again in 2022.2.2 (Professional Edition)

0
Comment actions Permalink

I'm also getting this again on 2022.2.2 (Community Edition)

0
Comment actions Permalink

Hi Zacpjohnston, Garrickw,

Please, create separate issues on our bug tracker and attach idea.log from Help | Show Log in .... The thread is quite old and probably the original problem already fixed and unrelated.

0

Please sign in to leave a comment.