haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 211 forks source link

Reopening a buffer causes errors that have already been fixed #1629

Open suhdonghwi opened 4 years ago

suhdonghwi commented 4 years ago

Steps to reproduce

  1. Make any kind of error
    doi -- << Error here 
    putStrLn "Hello, world!"
    return 1
  2. Fix it
    do -- << Error has been fixed
    putStrLn "Hello, world!"
    return 1
  3. Close and reopen the source file, and edit anywhere
    do
    putStrLn "Hello, world!"
    return $ 1 + 1 -- << Edited here
  4. Error which occured in Step 1 occurs again at the same location
    do -- << Error here!
    putStrLn "Hello, world!"
    return $ 1 + 1

This is my output of hie-wrapper --version:

Version 1.0.0.0, Git revision 4bec07d79cf77c8ee855957d20e315a89f799d75 (3745 commits) x86_64 ghc-8.6.5
fendor commented 4 years ago

Is there auto-save or something? Or is it unsaved?

suhdonghwi commented 4 years ago

I manually saved the file before closing and reopening it.

fendor commented 4 years ago

Can not reproduce with vscode on nixos with hie-8.6.5 on a cabal project. Can you add more information? What is the hie version, which one is used, what type of project, operating system, lsp-client and are you sure there are no other plugins active?

suhdonghwi commented 4 years ago

This is the output of hie --version:

Version 1.0.0.0, Git revision 4bec07d79cf77c8ee855957d20e315a89f799d75 (3745 commits) x86_64 ghc-8.6.5

I run it in Windows Subsystem for Linux, Ubuntu 18.04 LTS. Language server client is VSCode (WSL remote development) Haskell Language server extension. (But this problem also happens in neovim coc.nvim) There are no other Haskell related plugins active.

fendor commented 4 years ago

Can you provide the logs? If possible with --debug enabled. Either in vscode with File > Preferences > Settings > Haskell Language Server > Language Server Haskell > Trace: Server set to verbose or by invoking the hie/hie-wrapper process with the arguments hie --lsp --debug/hie-wrapper --lsp --debug

suhdonghwi commented 4 years ago

This is my log reproducing the bug: https://pastebin.com/ZRYwWn1H

fendor commented 4 years ago

And at the end errors were shown in the file Expr.hs?

suhdonghwi commented 4 years ago

Yes. But after reopening, if I edit anywhere and save the file again, errors disappear.

fendor commented 4 years ago

I can reproduce this error on windows as well, not reliably, but encountered it several times now. I suspect some caching issue, but I did not dig into it, yet.