haskell / haskell/haskell-language-server
Imports from local modules in the `$setup` section don't work
- Dominant language
- Haskell
- Stars
- 3k
- Forks
- 455
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 11
Description
Might be related to
- https://github.com/haskell/haskell-language-server/issues/509
### Your environment
#### Which OS do you use?
Ubuntu 22.04
#### Which version of GHC do you use and how did you install it?
9.10.1 from nixpkgs
#### How is your project built (alternative: link to the project)?
https://github.com/deemp/gists/tree/8b6722763a1c6baed180bd54dd89a9d2cfc33b2d/hlsEvalPluginSetupDoesntImportFromLocalModule
#### Which LSP client (editor/plugin) do you use?
I run it in VS Code with the `mkhl.direnv` and `haskell.haskell` extensions installed.
#### Which version of HLS do you use and how did you install it?
haskell-language-server version: 2.10.0.0 (GHC: 9.10.1) (PATH: /nix/store/0l89i2pwxn16lfzpi33iy5qlnnhwxjid-haskell-language-server-2.10.0.0/bin/haskell-language-server-wrapper)
#### Have you configured HLS in any way (especially: a `hie.yaml` file)?
No
### Steps to reproduce
Open VS Code in the package directory.
```
code hlsEvalPluginSetupDoesntImportFromLocalModule
```
Open `src/AnotherModule.hs` in VS Code.
Click `Evaluate` that appears over the line `-- >>> someFunc`.
### Expected behaviour
I click Evaluate for the first time and see:
```
-- >>> someFunc
-- "someFunc"
```
### Actual behaviour
When I click `Evaluate` for the first time, I see the following:
```
-- $setup
-- >>> import MyLib
attempting to use module `demo-0.1.0.0-inplace:MyLib' (**/Desktop/gh/gists/hlsEvalPluginSetupDoesntImportFromLocalModule/src/MyLib.hs) which is not loaded
-- >>> someFunc
-- Variable not in scope: someFunc
```
When I click Evaluate again, I see the following:
```
-- $setup
-- >>> import MyLib
-- >>> someFunc
-- Variable not in scope: someFunc
```
### Debug information
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.