Skip to content
This repository has been archived by the owner on Oct 5, 2022. It is now read-only.

Error tab gets cleared after reload on save #65

Open
freeman42x opened this issue Mar 16, 2018 · 6 comments
Open

Error tab gets cleared after reload on save #65

freeman42x opened this issue Mar 16, 2018 · 6 comments

Comments

@freeman42x
Copy link

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: #62

@lierdakil
Copy link
Contributor

#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
Copy link
Contributor

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.

@freeman42x
Copy link
Author

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
Copy link
Author

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

@lierdakil
Copy link
Contributor

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

@freeman42x
Copy link
Author

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 -> DanielG/ghc-mod#922 (comment)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants