amitdev / PMD-Intellij

Plugin for doing static analysis in Intellij using PMD
http://plugins.intellij.net/plugin/?id=1137
MIT License
67 stars 22 forks source link

Custom rules are not remembered after restart #130

Closed uhafner closed 1 year ago

uhafner commented 1 year ago

Right after adding custom rules I can check my code with these rules. However, when I restart Intellij (I'm running 2023.1 Beta) the custom rules are shown in the UI, but I cannot select them in the PMD action anymore.

Note that also the icons seems to be broken in the config dialog.

Bildschirm­foto 2023-03-17 um 23 35 30 Bildschirm­foto 2023-03-17 um 23 35 12
jborgers commented 1 year ago

Hi @uhafner, thanks for reporting. I just tested and found that all works fine in version 2022.3. In 2023.1 beta I also find that most icons are broken, probably by intelij api changes. However, I cannot reproduce that custom rules after restart cannot be selected and run.

jborgers commented 1 year ago

Not sure how the run the plugin in development on 2023.1-RC. I guess we have to wait until it is out of beta.

uhafner commented 1 year ago

I think I can reproduce it locally. I am typically working with multiple projects in parallel. Maybe the problem is, that the rule is not available in the second one. When I switch back to the original one, the deactivation seems not to be updated. When I restart IntelliJ with just one project (that contains those rules), then it is correctly active.

  1. Define new custom rule
  2. Run PMD with custom rule
  3. Open another project in a different tab
  4. Switch back to original project
  5. PMD Custom Rules are deactivated
jborgers commented 1 year ago

Right, that is issue #105 . Should be fixed in my PR to be released in coming days.

jborgers commented 1 year ago

@uhafner It is released. Can you check? And close issue when solved?

uhafner commented 1 year ago

Thanks for fixing! I can confirm, that 1.8.26 fixes the problem.