Open uhafner opened 1 year ago
I am looking into this issue, will probably not be a inspector but will still mark problematic lines in the editor when you edit files.
Hello I see the #152 has been merged but I cannot see any "realtime checks" in my intellij having the latest version installed. Am I missing something ? @amitdev
I checked-out the latest version of the plugin and installed from zip file locally and I encounter some exception:
Any ideas ?
ExternalToolPass:
com.intellij.diagnostic.PluginException: annotator: com.intellij.plugins.bodhi.pmd.annotator.PMDExternalAnnotator@5849ccc (class com.intellij.plugins.bodhi.pmd.annotator.PMDExternalAnnotator) [Plugin: PMDPlugin] at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23) at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:89) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.processError(ExternalToolPass.java:251) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:210) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:201) at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$0(ExternalToolPass.java:164) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.runChangeAware(ExternalToolPass.java:266) at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$2(ExternalToolPass.java:164) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173) at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:360) at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:162) at com.intellij.util.ui.update.Update.runUpdate(Update.java:114) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:348) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:338) at com.intellij.util.ui.update.MergingUpdateQueue.doFlush(MergingUpdateQueue.java:295) at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:277) at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246) at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:254) at com.intellij.util.Alarm$Request.runSafely(Alarm.java:373) at com.intellij.util.Alarm$Request.run(Alarm.java:360) at com.intellij.util.concurrency.Propagation.contextAwareCallable$lambda$2(propagation.kt:328) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272) at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:249) at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:31) at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:227) at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218) at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:215) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:840) Caused by: java.lang.UnsupportedOperationException: Failed to map LightVirtualFile: /fragment.java (filesystem com.intellij.testFramework.LightVirtualFileBase$MyVirtualFileSystem@6ad346fa) into nio Path at com.intellij.openapi.vfs.VirtualFile.toNioPath(VirtualFile.java:164) at com.intellij.plugins.bodhi.pmd.annotator.FileInfo.getFile(FileInfo.java:24) at com.intellij.plugins.bodhi.pmd.annotator.PMDExternalAnnotator.doAnnotate(PMDExternalAnnotator.java:37) at com.intellij.plugins.bodhi.pmd.annotator.PMDExternalAnnotator.doAnnotate(PMDExternalAnnotator.java:21) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:207) ... 37 more
I managed to make it work with a custom ruleset.xml but for some reason I cannot make it work with the pre-defined rulesets
Hello, I have opened #154 that fixes some issues and improves performance by sending all rulesets at once to the PMD engine instead of iterating over each one
I checked-out the latest version of the plugin and installed from zip file locally and I encounter some exception:
Any ideas ?
ExternalToolPass: com.intellij.diagnostic.PluginException: annotator: com.intellij.plugins.bodhi.pmd.annotator.PMDExternalAnnotator@5849ccc (class com.intellij.plugins.bodhi.pmd.annotator.PMDExternalAnnotator) [Plugin: PMDPlugin] at com.intellij.diagnostic.PluginProblemReporterImpl.createPluginExceptionByClass(PluginProblemReporterImpl.java:23) at com.intellij.diagnostic.PluginException.createByClass(PluginException.java:89) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.processError(ExternalToolPass.java:251) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:210) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:201) at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$0(ExternalToolPass.java:164) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.runChangeAware(ExternalToolPass.java:266) at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.lambda$run$2(ExternalToolPass.java:164) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$runProcess$2(CoreProgressManager.java:186) at com.intellij.openapi.progress.impl.CoreProgressManager.lambda$executeProcessUnderProgress$13(CoreProgressManager.java:604) at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:679) at com.intellij.openapi.progress.impl.CoreProgressManager.computeUnderProgress(CoreProgressManager.java:635) at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:603) at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:61) at com.intellij.openapi.progress.impl.CoreProgressManager.runProcess(CoreProgressManager.java:173) at com.intellij.openapi.progress.util.BackgroundTaskUtil.runUnderDisposeAwareIndicator(BackgroundTaskUtil.java:360) at com.intellij.codeInsight.daemon.impl.ExternalToolPass$1.run(ExternalToolPass.java:162) at com.intellij.util.ui.update.Update.runUpdate(Update.java:114) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:348) at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:338) at com.intellij.util.ui.update.MergingUpdateQueue.doFlush(MergingUpdateQueue.java:295) at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:277) at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246) at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:254) at com.intellij.util.Alarm$Request.runSafely(Alarm.java:373) at com.intellij.util.Alarm$Request.run(Alarm.java:360) at com.intellij.util.concurrency.Propagation.contextAwareCallable$lambda$2(propagation.kt:328) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:272) at com.intellij.util.concurrency.BoundedTaskExecutor.doRun(BoundedTaskExecutor.java:249) at com.intellij.util.concurrency.BoundedTaskExecutor.access$200(BoundedTaskExecutor.java:31) at com.intellij.util.concurrency.BoundedTaskExecutor$1.executeFirstTaskAndHelpQueue(BoundedTaskExecutor.java:227) at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:218) at com.intellij.util.concurrency.BoundedTaskExecutor$1.run(BoundedTaskExecutor.java:215) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:702) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:699) at java.base/java.security.AccessController.doPrivileged(AccessController.java:399) at java.base/java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:699) at java.base/java.lang.Thread.run(Thread.java:840) Caused by: java.lang.UnsupportedOperationException: Failed to map LightVirtualFile: /fragment.java (filesystem com.intellij.testFramework.LightVirtualFileBase$MyVirtualFileSystem@6ad346fa) into nio Path at com.intellij.openapi.vfs.VirtualFile.toNioPath(VirtualFile.java:164) at com.intellij.plugins.bodhi.pmd.annotator.FileInfo.getFile(FileInfo.java:24) at com.intellij.plugins.bodhi.pmd.annotator.PMDExternalAnnotator.doAnnotate(PMDExternalAnnotator.java:37) at com.intellij.plugins.bodhi.pmd.annotator.PMDExternalAnnotator.doAnnotate(PMDExternalAnnotator.java:21) at com.intellij.codeInsight.daemon.impl.ExternalToolPass.doAnnotate(ExternalToolPass.java:207) ... 37 more
I think PR #155 fixes this issue, but I have not found how to reproduce, so I am not sure.
Just curious on the status of this?
I'm not sure if inspection is the correct naming, but the Checkstyle IntelliJ plugin registered its checks as an IntelliJ Inspection.
It would be very helpful if the same approach would be available by the PMD plugin. Then there would be a single entry point for static analysis tools and PMD will be running automatically during the development cycle (if configured so). Currently I need to manually run PMD using the context menu, it would be much simpler if the PMD checks would run automatically with the set of configured inspections.