haskell-language-server icon indicating copy to clipboard operation
haskell-language-server copied to clipboard

Import/export errors block import/export re-scanning

Open deemp opened this issue 2 years ago • 5 comments

Your environment

Which OS do you use: Ubuntu 20.04 Which LSP client (editor/plugin) do you use: VS Code+Haskell+enabled autosave there Describe your project (alternative: link to the project): link

Steps to reproduce

  1. Clone the project's repo and switch to the second commit (link). In module A, module B will be highlighted red. image
  2. Create B.hs as in the third commit (link). Though B does export b, in module A, module B will still be highlighted red. image And there will be an error image

Expected behaviour

When a module exports a function, the errors for modules which expected such function should be re-checked.

Actual behaviour

Instead, if there happens an error, HLS blocks further export/import checks, and there is no way to make checks start again without restarting the HLS

Include debug information

deemp avatar May 08 '22 10:05 deemp

This looks like a regression. What version of HLS are you using? Did this use to work with previous versions of HLS?

pepeiborra avatar May 08 '22 16:05 pepeiborra

Doesn't work on both 1.7.0.0 and 1.6.1.0. Manage them with ghcup

deemp avatar May 08 '22 16:05 deemp

@pepeiborra, I have a similar issue in another, slightly more complicated package A with a module F. I cloned a package B with modules C and D there, made hie.yaml, etc. In this package B, module D re-exports the contents of module C. When I try to import a not-yet-exported function from D into F, I get an error like " D doesn't export such function". Then, I add a necessary export into C, then import and export in D, but HLS still doesn't recognize these imports in F until I restart it.

Here's the project.

  • F is src/EO/EOtoPhi.hs
  • D is eo-parser/src/EOParser.hs
  • C is eo-parser/src/ToTerm.hs

deemp avatar May 08 '22 16:05 deemp

I've definitely observed HLS invalidating things properly when I change a cabal file. I wonder if it's a problem with stack cradles?

michaelpj avatar May 08 '22 20:05 michaelpj