Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import/export errors block import/export re-scanning #2897

Open
deemp opened this issue May 8, 2022 · 5 comments
Open

Import/export errors block import/export re-scanning #2897

deemp opened this issue May 8, 2022 · 5 comments
Labels
component: ghcide component: hie-bios type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@deemp
Copy link

deemp commented May 8, 2022

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 deemp added status: needs triage type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels May 8, 2022
@pepeiborra
Copy link
Collaborator

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

@deemp
Copy link
Author

deemp commented May 8, 2022

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

@deemp
Copy link
Author

deemp commented May 8, 2022

@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

@michaelpj
Copy link
Collaborator

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

I haven't seen anything like this recently, is this still a problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: ghcide component: hie-bios type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

No branches or pull requests

4 participants