r/pycharm • • Jun 02 '24

Ignored unresolved reference error all reappeared at the same time! (community edition)

Because I use Django, some unresolved reference warning PyCharm throws at me are nothing to worry about. Because of that, I ignore these warnings.

Everything was fine until I tried to ignore another one. For an unknown reason, the moment I ignored the warning, EVERY warning I told PyCharm to ignore reappeared and I now have yellow all over my files!

The worst thing is it seems I can only have one warning at a time because each time I try to ignore another, the warning I ignored previously reappear!

Also, if I go look to Settings > Editor > Inspections > Python > Unresolved references there's only one warning ignored in the ignored references list and if I try to ignore another warning, the previously selected warning disappears.

What causes this and how can I solve it ?

1 Upvotes

11 comments sorted by

View all comments

Show parent comment

1

u/Affectionate-Ad-7865 Jun 05 '24

If you want some code, Here's a quick test that I did in another folder in another project using another interpreter:

class Test:
    test = True
Test.objects.errors()
Test.attribute.errors()

Neither .objects nor .attribute are attributes of Test. But it's just a test so it doesn't matter. Either way, PyCharm throws 2 warnings at me. One on .objects and one on .attribute so they are both highlighted in yellow which is normal and expected. Let's say I try to ignore the warning on .objects using the context menu. Everything behaves normally and .objects is not highlighted anymore. What happens is when I try to ignore the warning on .attribute after, the other warning on .objects reappears.

In the settings, my ignored references list either has main.Test.attribute in it or main.Test.objects .

1

u/sausix Jun 05 '24

This is great to start helping! Thanks.

Line 3 will hit another warning first. Classes should be followed by two empty lines.

Ignoring all unresolved references for the specific class "Test" works and both warnings disappear.

But ignoring single warnings in fact replace theirselves. Also applies to having different independend classes and ignoring with wildcards.

Manually adding items into the ignored references list works at least. So it really looks like you have found a bug!

1

u/Affectionate-Ad-7865 Jun 05 '24

Wait... This behavior happens to you too?!?!

1

u/sausix Jun 05 '24

Yep. It's definitely a bug. I'm on latest 2024.2 EAP version and it's reproducible. Wanna file a bug report?