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

Reopening a buffer causes errors that have already been fixed

Open suhdonghwi opened this issue 4 years ago • 9 comments

Steps to reproduce

  1. Make any kind of error
doi -- << Error here 
  putStrLn "Hello, world!"
  return 1
  1. Fix it
do -- << Error has been fixed
  putStrLn "Hello, world!"
  return 1
  1. Close and reopen the source file, and edit anywhere
do
  putStrLn "Hello, world!"
  return $ 1 + 1 -- << Edited here
  1. 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

suhdonghwi avatar Feb 03 '20 15:02 suhdonghwi

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

fendor avatar Feb 03 '20 17:02 fendor

I manually saved the file before closing and reopening it.

suhdonghwi avatar Feb 03 '20 17:02 suhdonghwi

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?

fendor avatar Feb 03 '20 17:02 fendor

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.

suhdonghwi avatar Feb 03 '20 17:02 suhdonghwi

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

fendor avatar Feb 03 '20 17:02 fendor

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

suhdonghwi avatar Feb 04 '20 10:02 suhdonghwi

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

fendor avatar Feb 04 '20 10:02 fendor

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

suhdonghwi avatar Feb 04 '20 11:02 suhdonghwi

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.

fendor avatar Feb 24 '20 15:02 fendor