ide-haskell-repl icon indicating copy to clipboard operation
ide-haskell-repl copied to clipboard

Error tab gets cleared after reload on save

Open freeman42x opened this issue 7 years ago • 6 comments

How to reproduce:

Enable reload-repeat on file save.

Paste in a hs file:

j :: Monad m => m (m a) -> m a
j = _

In the Error tab for a short while the error message will be shown:

* Found hole: _ :: m (m a) -> m a
  Where: `m' is a rigid type variable bound by
           the type signature for:
             j :: forall (m :: * -> *) a. Monad m => m (m a) -> m a
           at /home/neo/HaskellLearning/IdeTest/src/Ch18.hs:202:1-30
         `a' is a rigid type variable bound by
           the type signature for:
             j :: forall (m :: * -> *) a. Monad m => m (m a) -> m a
           at /home/neo/HaskellLearning/IdeTest/src/Ch18.hs:202:1-30
* In the expression: _
  In an equation for `j': j = _
* Relevant bindings include
    j :: m (m a) -> m a
      (bound at /home/neo/HaskellLearning/IdeTest/src/Ch18.hs:203:1)
|
/home/neo/HaskellLearning/IdeTest/src/Ch18.hs: 203, 5
* Found hole: _ :: m (m a) -> m a

After a very short while, the build error message will get cleared.

It was expected for the message to not get cleared.

I started getting this issue around the fix for this ticket, possibly related: https://github.com/atom-haskell/ide-haskell-repl/issues/62

freeman42x avatar Mar 16 '18 18:03 freeman42x

#62 is unrelated, and this isn't new. Long story short, this is a bit of an oversight. At least if "very short while" is about 10 seconds, and errors are cleared on REPL activity (running commands that is)

Hopefully, v0.8.0 works more or less as expected.

lierdakil avatar Mar 18 '18 10:03 lierdakil

While on topic, if you're using ide-haskell-repl as a replacement for ghc-mod, you might be interested in 'Show Types' and 'Check On Save' ide-haskell-repl settings. A fair warning: this will spawn repl processes in background in addition to any open REPL windows, so memory usage might be a concern.

lierdakil avatar Mar 18 '18 10:03 lierdakil

After updating to v0.8.0 the issue seems to be fixed. The amount of time the error was shown before disappearing was something like 1-2 seconds so it was quite hard to copy paste bits of it. And now it is working fine thank you.

I noticed another issue with undefined not always appearing in the autocomplete list which was not happening before - but that is not a big issue.

freeman42x avatar Mar 18 '18 15:03 freeman42x

I had both ide-haskell-repl and haskell-ghc-mod plugins installed with 'Show Types' and 'Check On Save' enabled but show types on hover does not work:

This might be because I am using ghc-mod with GHC 8.2.2

freeman42x avatar Mar 18 '18 15:03 freeman42x

I noticed another issue with undefined not always appearing in the autocomplete list which was not happening before - but that is not a big issue.

In the autocomplete list where? Autocomplete in REPL is a completely different beast from autocomplete in files, the latter being handled by ghc-mod (and I'm honestly more inclined to blame ghc-mod there)

show types on hover does not work

It should work -- if one provider fails (as does h-g-m in this case), the other one should pick up the slack.

But getting types from ghci isn't as thoroughly tested, so some bugs might be lurking. Btw, you can immediately tell if you're seeing types from ghci, because it always spits out fully qualified types, e.g. image

lierdakil avatar Mar 18 '18 15:03 lierdakil

The autocomplete was flaky in the Haskell code editor window (not in the ide-haskell-repl). I could only reproduce it one more time and it stopped. Having something like (probably doesn't matter):

j :: Monad m => m (m a) -> m a
j = 

by typing undefined it kept showing UNPACK, but by waiting 2 seconds or so it changed to undefined. I found this unusual since undefined was shown immediately before (no caching or whatever happened now). After that 2 second delay, it works like before - instantly so I can't reproduce it anymore. And it might be caused by having an issue in ghc-mod for ghc 8.2.2 -> https://github.com/DanielG/ghc-mod/pull/922#issuecomment-353896120

freeman42x avatar Mar 19 '18 04:03 freeman42x