Giter Club home page Giter Club logo

Comments (14)

lierdakil avatar lierdakil commented on July 17, 2024

errors tab gets cleared

That is very unexpected. This actually shouldn't happen.

A bit of a design explanation. Every package that can show messages via ide-haskell output panel manages it's own messages completely and sets those more or less atomically. Messages from different sources, in general, do not interfere, with one exception: if literally the same messages (meaning location, text, etc are the same) already exist, "ownership" gets reassigned.

Lint is handled by haskell-ghc-mod. Build errors can come from either haskell-ghc-mod or ide-haskell-cabal.

In any case, I can't imagine a scenario where error tab would be cleared.

More detailed reproduction instructions could help.

from ide-haskell.

freeman42x avatar freeman42x commented on July 17, 2024

@lierdakil The instructions above are as detailed as needed, you just need to take some file that compiles and get it to not compile, then add some unneeded parentheses or something so you get a HLint error. Once you do that you will only see the HLint tab messages but there will be no errors shown on their tab - unless you fix the HLint issue.

from ide-haskell.

lierdakil avatar lierdakil commented on July 17, 2024

Well, I can't reproduce with instructions given.

from ide-haskell.

freeman42x avatar freeman42x commented on July 17, 2024

@lierdakil A basic example to reproduce, create a file HelloError.hs with content:

module HelloError where

add a b = a + [b]

Error tab should show the error:

/home/neo/HaskellLearning/IdeTest/src/HelloError.hs: 3, 1

  • Non type-variable argument in the constraint: Num [t]
    (Use FlexibleContexts to permit this)
  • When checking the inferred type
    add :: forall t. Num [t] => [t] -> t -> [t]

Now put parentheses around a to get a HLint issue:

module HelloError where

add a b = (a) + [b]

The error will be shown for a split second then the Error tab will be cleared and only the HLint will be focused and shown it its tab:

/home/neo/HaskellLearning/IdeTest/src/HelloError.hs: 3, 11
Redundant bracket
Found:
(a)
Why not:
a

from ide-haskell.

lierdakil avatar lierdakil commented on July 17, 2024

Well, I still can't repro, but the particular way you're phrasing this makes me wonder what your haskell-ghc-mod settings are. In particular, 'Check/Lint On Change/Save'

from ide-haskell.

freeman42x avatar freeman42x commented on July 17, 2024

haskell-ghc-mod has:

  • On Save Check set
  • On Save Lint set
  • On Change Check unset
  • On Change Lint unset

The issue I am getting is upon saving the file after making the changes.

from ide-haskell.

lierdakil avatar lierdakil commented on July 17, 2024

Huh... I think having only one of 'Change/Save' enabled can lead to the described behaviour (at least I did find a bug in the implementation, which I just fixed in [email protected]). But with these settings, I honestly have no idea how that would be possible since both check and lint results are set together.

EDIT: re-reading, it's not obvious what I mean by "only one of 'Change/Save' enabled". What I mean is situations similar to this:

  • On Save Check
  • On Save Lint
  • On Change Check
  • On Change Lint

Check that you're running Atom >= 1.23.3 and all related packages are up to date. You might as well test [email protected], on the off chance that it somehow helps with this issue.

And just to show that I've actually tried reproducing:
idehaskell225

from ide-haskell.

freeman42x avatar freeman42x commented on July 17, 2024

I am running Atom 1.23.3 and updated to haskell-ghc-mod 2.2.3 and the issue is still happening.

from ide-haskell.

lierdakil avatar lierdakil commented on July 17, 2024

No idea. Restart Atom? Reinstall ide-haskell & friends?

I'm on Gentoo with Atom installed via Nix package manager, so my environment should be pretty close to yours...

And besides, to the best of my knowledge, there are no code paths that could produce the described behaviour in the first place. Except for maybe bizarre cases where a package somehow managed to activate twice or something like that due to some obscure race condition somewhere, but you shouldn't be able to consistently reproduce an obscure race condition.

from ide-haskell.

freeman42x avatar freeman42x commented on July 17, 2024

@lierdakil I uninstalled Atom, then installed the following plugins only:

language-haskell
ide-haskell
haskell-ghc-mod

Pressing save does not show an error in the error tab - for add a b = (a) + [b]
Pressing save does show lint errors though - for add a b = (a) + [b]
If I build the project using Builder -> Build (with stack) the error is shown - for add a b = a + [b]
Fixing the error and pressing save has no effect - the error is still shown in its tab - for add a b = a + [b]
Adding parentheses does trigger the HLint on saving though. add a b = (a) + [b] but the error tab is still empty/cleared.
Running Builder -> Build doesn't show any error but shows the lint issue - for add a b = (a) + [b]

As you can see the behavior is very flaky and in any case in which there is a HLint issue the errors can't be seen.

I was using GHC version 8.0.2 because I knew ghc-mod had issues with latest GHC versions.

I'll try downgrading cabal-install from version 2 to version 1 and see if that helps.

from ide-haskell.

freeman42x avatar freeman42x commented on July 17, 2024

Just noticed that on saving even with compiling program (add a b = a + b) the following errors/warnings appear in the developer console:

Uncaught Error: read ECONNRESET
at exports._errnoException (util.js:1022)
at Pipe.onread (net.js:572)
exports._errnoException @ util.js:1022
onread @ net.js:572
util.ts:52 haskell-ghc-mod warning:
warn @ util.ts:52
proc.once @ interactive-process.ts:131
onceWrapper @ events.js:290
emitTwo @ events.js:111
emit @ events.js:191
ChildProcess._handle.onexit @ internal/child_process.js:215
upi-consumer.ts:508 Haskell-ghc-mod: ghc-mod interactive command check failed with error GHCModInteractiveCrash caps:
{
"version": [
5,
8,
0,
0
],
"fileMap": true,
"quoteArgs": true,
"optparse": true,
"typeConstraints": true,
"browseParents": true,
"interactiveCaseSplit": true,
"importedFrom": false,
"browseMain": false
}
Args:
{
"interactive": true,
"command": "check",
"uri": "/home/neo/HaskellLearning/IdeTest/src/HelloError.hs"
}
message:

cabal-helper-wrapper: /home/neo/.ghc-mod/cabal-helper/cabal-helper-0.7.3.0-Cabal-1.24.2.0: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory),ghc-mod: readCreateProcess: /nix/store/07wnp40jsxzavj5n31ld2n1536w87spa-cabal-helper-0.7.3.0/libexec/x86_64-linux-ghc-8.0.2/cabal-helper-0.7.3.0/cabal-helper-wrapper "--with-ghc=/nix/store/fd5vgah6xcwzy6xahlkl1xg637xy2n50-ghc-8.0.2/bin/ghc" "--with-ghc-pkg=/nix/store/fd5vgah6xcwzy6xahlkl1xg637xy2n50-ghc-8.0.2/bin/ghc-pkg" "--with-cabal=cabal" "/home/neo/HaskellLearning/IdeTest" "/home/neo/HaskellLearning/IdeTest/.stack-work/dist/x86_64-linux-nix/Cabal-1.24.2.0" "package-db-stack" "entrypoints" "source-dirs" "ghc-options" "ghc-src-options" "ghc-pkg-options" "ghc-merged-pkg-options" "ghc-lang-options" "licenses" "flags" "config-flags" "non-default-config-flags" "compiler-version" (exit 1): failed
log:

consoleReport @ upi-consumer.ts:508
handleProcessError @ upi-consumer.ts:524
module.exports.Emitter.simpleDispatch @ :65955
module.exports.Emitter.emit @ :66071
disposables.add.backend.onError @ index.ts:403
module.exports.Emitter.simpleDispatch @ :65955
module.exports.Emitter.emit @ :66071
run @ ghc-modi-process-real.ts:145
_tickCallback @ internal/process/next_tick.js:103

from ide-haskell.

freeman42x avatar freeman42x commented on July 17, 2024

Tried with:

cabal-install version 1.24.0.2
compiled using version 1.24.2.0 of the Cabal library

and it still behaves the same way.

from ide-haskell.

freeman42x avatar freeman42x commented on July 17, 2024

Apparently, ghc-mod is not working with Cabal v.2 DanielG/ghc-mod#910 (comment)

from ide-haskell.

freeman42x avatar freeman42x commented on July 17, 2024

I installed ghc-mod for ghc 8.2.2 via DanielG/ghc-mod#922 (comment) and now I am no longer seeing the errors in the developer console.

Probably the issue was caused by partially broken ghc-mod.

Closing since I can no longer reproduce this issue.

from ide-haskell.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.