haskell / haskell/haskell-language-server
Local compiler plugin cannot be loaded in ghcide even with `-fobject-code`
- Langage dominant
- Haskell
- Étoiles
- 3k
- Forks
- 455
- Merge moyen
- 2 j 19 h
- PR mergées (30 j)
- 11
Description
This was originally reported as haskell/haskell-language-server#70, but it turns out that this is a bug in ghcide, so I re-open the issue here.
### Subject of the issue
If one specifies GHC's compiler plugin provided in the *same* package, ghcide fails to find the plugin module.
### Your environment
* ghcide HEAD (10dbde048e8ac028e80f607445776c8375722f75)
* VSCode
* Describe your project: You can use the [same repro repo](/konn/hls-repro) as reported on hls.
* hie.yaml: Provided above.
### Steps to reproduce
1. Set the Languager Server path to the ghcide.
2. Open the src/Lib.hs in the editor.
### Expected behaviour
ghcide should work properly and no bugs must be reported, as `-fobject-code` flag is properly detected by hie-bios.
### Actual behaviour
`Lib` module gets the following error:
```
{
"resource": "/Users/hiromi/Documents/Programming/Haskell/git/hls-repro/src/Lib.hs",
"owner": "Haskell (hls-repro)",
"severity": 8,
"message": "Unexpected usage error\nCould not load module ‘Lib.Plugin’\nIt is a member of the hidden package ‘hls-repro-0.1.0.0’.\nPerhaps you need to add ‘hls-repro’ to the build-depends in your .cabal file.\n",
"source": "pragmas",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 2,
"endColumn": 1
}
```
(Note that the error message has changed since the first report)
### Possible cause
It seems that the cause of this behaviour is the lack of dependency information in `HsEnv` value obtained in `getModSummaryRule`, which is finally passed to `Development.IDE.Core.Preprocessor.preprocess`.
I once tried to expand the definition of `GhcSessionDeps` definition into `getModSummaryRule`, but it won't work since the core logic contains the call for `GetModSummaryWithoutTimestamps`, which eventually calls `GetModSummary`, resulting in cyclic dependency and ghcide stuck in the infinite loop.
Guide de contribution
Aucun guide de contribution indexé pour ce dépôt
Évaluation
Cette issue n'a pas encore été évaluée.