Code inspection does not refresh on edit
已回答
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
请先登录再写评论。
Also just to add, this happens in one particular project. The code completion in other projects seems to work fine.
Same here, I have it in all projects though. If I cut and paste the code the introspection is reevaluated.
Hi Mkrens! Could you please create a ticket in our bug tracker and attach idea.log file from Help | Show Log in ... there?
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.
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
Thank you for the comment Gghaibeh! This is, in fact, a different issue, I created a ticket for it: PY-28845.
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.
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.
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
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?
The same for me, it is very annoying, I always need to cut/paste lines to refresh state, please fix it
Hi Nikolay, could you please create a ticket in our bug tracker and attach idea.log from Help | Show Log in ...?
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
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.
Hi Jon,
It is here https://youtrack.jetbrains.com/issue/WI-43870
For a quick fix, as alluded to by OP:
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.
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.
2020.3 on mac, started seeing this behavior too. cut and paste indeed helps.
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.
Unfortunately this problem is happening again on 2021.2 ....
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 ?
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.
I just hit this issue again in 2022.2.2 (Professional Edition)
I'm also getting this again on 2022.2.2 (Community Edition)
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.
I had this in version 2023.2.1
I deleted the .idea folder inside my project (created with a previous pycharm version) and opened the project again; issue was fixed.
I am still seeing this problem in 2023.2.1. Changing my code triggers an error, removing the code does not get rid of the errors, se attached image. I have to remove the code line or restart PyCharm to fix it.
The problem also seem to be limited to one file at a time, meaning in the same PyCharm instans i see the problem for one file, but when i edit in another file, code errors do dissapear when corrected.
Deleting .idea folder did not help.
Created an issue and linked to this comment: https://youtrack.jetbrains.com/issue/WEB-63138/Code-inspection-does-not-refresh-on-edit
Upload id: 2023_09_24_ZfkrV1jT2WvMgZgLrNKDRD (file: idea.log)
GUYS! I SOLVED IT! You just need to go to File > setting > project:python-workspace(under"version control"),
then set your Project Interpreter from None to your current Python version,
and that will solve the case!
Molliojing 's solution does not work for me. I have the project interpreter set and still have this bug.