rikvdkleij / intellij-haskell

IntelliJ plugin for Haskell
https://rikvdkleij.github.io/intellij-haskell/
Apache License 2.0
1.31k stars 94 forks source link

Notification should have title and/or content; groupId: Haskell Log #600

Closed ForNeVeR closed 4 years ago

ForNeVeR commented 4 years ago

In the latest builds from master, I keep getting error asserts like this: "Notification should have title and/or content; groupId: Haskell Log"

With the following stack trace:

      at com.intellij.openapi.diagnostic.Logger.assertTrue(Logger.java:177)
      at com.intellij.notification.Notification.assertHasTitleOrContent(Notification.java:387)
      at com.intellij.notification.Notifications$Bus.notify(Notifications.java:72)
      at com.intellij.notification.Notification.notify(Notification.java:365)
      at intellij.haskell.HaskellNotificationGroup$.log(HaskellNotificationGroup.scala:130)
      at intellij.haskell.HaskellNotificationGroup$.logEvent(HaskellNotificationGroup.scala:121)
      at intellij.haskell.HaskellNotificationGroup$.logInfoEvent(HaskellNotificationGroup.scala:62)
      at intellij.haskell.external.execution.CapturingProcessToProgressIndicator.onTextAvailable(CommandLine.scala:170)
      at sun.reflect.GeneratedMethodAccessor83.invoke(Unknown Source:-1)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:498)
      at com.intellij.execution.process.ProcessHandler$2.invoke(ProcessHandler.java:246)
      at com.sun.proxy.$Proxy34.onTextAvailable(Unknown Source:-1)
      at com.intellij.execution.process.ProcessHandler.notifyTextAvailable(ProcessHandler.java:220)
      at com.intellij.execution.process.BaseOSProcessHandler$SimpleOutputReader.onTextAvailable(BaseOSProcessHandler.java:153)
      at com.intellij.util.io.BaseOutputReader.sendText(BaseOutputReader.java:206)
      at com.intellij.util.io.BaseOutputReader.processInput(BaseOutputReader.java:190)
      at com.intellij.util.io.BaseOutputReader.readAvailableBlocking(BaseOutputReader.java:137)
      at com.intellij.util.io.BaseDataReader.readAvailable(BaseDataReader.java:67)
      at com.intellij.util.io.BaseDataReader.doRun(BaseDataReader.java:160)
      at com.intellij.util.io.BaseDataReader$$Lambda$349.241037983.run(Unknown Source:-1)
      at com.intellij.util.ConcurrencyUtil.runUnderThreadName(ConcurrencyUtil.java:207)
      at com.intellij.util.io.BaseDataReader.lambda$start$0(BaseDataReader.java:50)
      at com.intellij.util.io.BaseDataReader$$Lambda$348.627479675.run(Unknown Source:-1)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
      at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266)
      at java.util.concurrent.FutureTask.run(FutureTask.java:-1)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
      at java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:652)
      at java.util.concurrent.Executors$PrivilegedThreadFactory$1$1.run(Executors.java:649)
      at java.security.AccessController.doPrivileged(AccessController.java:-1)
      at java.util.concurrent.Executors$PrivilegedThreadFactory$1.run(Executors.java:649)
      at java.lang.Thread.run(Thread.java:748)

I've found that the issue is connected to my changes in #596: earlier, we were getting some strings like "" and happily creating notifications from them. But now, when these strings got post-processed by AnsiDecoder, it's clear they're pure whitespace (e.g. "\n" in this case), so IDEA detects them as such and shows the errors.

So, we should improve the filtering you've added in f39b1b236883f39bc3d77bcd16e58c12fb82846e.