Closed lf- closed 3 months ago
This was hacked around on the testsuite (although at the cost of waiting like 5 minutes for it to interpret multiple thousand modules and using an even more hilarious than usual amount of RAM [currently my heap is 42GB, 25GB live. god help me]) by a test-dev
target which includes src/ and test/.
This should be fixed with the new multi-component support.
Your environment
Which OS do you use? macOS 12.5.1 on aarch64
Which version of GHC do you use and how did you install it? ghc-9.2.4 from nix
How is your project built (alternative: link to the project)? This has happened on HLS itself in the past, I think, but I can't repro it >:(
The work code uses cabal and the standard nix Haskell infrastructure.
The case of this happening on dependencies is where the dependencies are provided by Nix and overridden to local development versions in
cabal.project.local
.It also happens to my work testsuite on imports of files in the main lib package.
Which LSP client (editor/plugin) do you use? coc.nvim on nvim
Which version of HLS do you use and how did you install it? 1.7.0.0, commit b5ab14cfbe7a992739167fce6671cf1881211566, built with nix.
Have you configured HLS in any way (especially: a
hie.yaml
file)? See hie.yaml snippet below.Steps to reproduce
It seems that this happens when I open a file that imports something from some other package in the
cabal.project
and the imported file is not open in the editor.In this case, it was importing
<projectRoot>/hs-opentelemetry/sdk/src/OpenTelemetry/Processor/Simple.hs
.To my great annoyance, my efforts to make any kind of repro have fallen flat on their face :(
It's quite reproducible in my closed source work code plus nix setup, but that's not very helpful.
Some snippets of the shape of the config files:
cabal.project.local:
hie.yaml:
content
```yaml cradle: multi: - path: "./" config: cradle: cabal: - path: "hs-opentelemetry/examples/hspec/src" component: "lib:hspec-example" - path: "hs-opentelemetry/examples/hspec/test" component: "hspec-example:test:test" - path: "hs-opentelemetry/api/src" component: "lib:hs-opentelemetry-api" - path: "hs-opentelemetry/api/test" component: "hs-opentelemetry-api:test:hs-opentelemetry-api-test" - path: "hs-opentelemetry/exporters/handle/src" component: "lib:hs-opentelemetry-exporter-handle" - path: "hs-opentelemetry/exporters/otlp/src" component: "lib:hs-opentelemetry-exporter-otlp" - path: "hs-opentelemetry/exporters/otlp/test" component: "hs-opentelemetry-exporter-otlp:test:hs-opentelemetry-exporter-otlp-test" - path: "hs-opentelemetry/instrumentation/cloudflare/src" component: "lib:hs-opentelemetry-instrumentation-cloudflare" - path: "hs-opentelemetry/instrumentation/cloudflare/test" component: "hs-opentelemetry-instrumentation-cloudflare:test:cloudflare-test" - path: "hs-opentelemetry/instrumentation/conduit/src" component: "lib:hs-opentelemetry-instrumentation-conduit" - path: "hs-opentelemetry/instrumentation/conduit/test" component: "hs-opentelemetry-instrumentation-conduit:test:hs-opentelemetry-instrumentation-conduit-test" - path: "hs-opentelemetry/instrumentation/http-client/src" component: "lib:hs-opentelemetry-instrumentation-http-client" - path: "hs-opentelemetry/instrumentation/http-client/test" component: "hs-opentelemetry-instrumentation-http-client:test:hs-opentelemetry-instrumentation-http-client-t est" - path: "hs-opentelemetry/instrumentation/persistent/src" component: "lib:hs-opentelemetry-instrumentation-persistent" - path: "hs-opentelemetry/instrumentation/persistent/test" component: "hs-opentelemetry-instrumentation-persistent:test:hs-opentelemetry-persistent-test" - path: "hs-opentelemetry/instrumentation/postgresql-simple/src" component: "lib:hs-opentelemetry-instrumentation-postgresql-simple" - path: "hs-opentelemetry/instrumentation/postgresql-simple/test" component: "hs-opentelemetry-instrumentation-postgresql-simple:test:hs-opentelemetry-instrumentation-postgre sql-simple-test" - path: "hs-opentelemetry/instrumentation/wai/src" component: "lib:hs-opentelemetry-instrumentation-wai" - path: "hs-opentelemetry/instrumentation/wai/test" component: "hs-opentelemetry-instrumentation-wai:test:hs-opentelemetry-instrumentation-wai-test" - path: "hs-opentelemetry/instrumentation/yesod/src" component: "lib:hs-opentelemetry-instrumentation-yesod" - path: "hs-opentelemetry/instrumentation/yesod/test" component: "hs-opentelemetry-instrumentation-yesod:test:hs-opentelemetry-instrumentation-yesod-test" - path: "hs-opentelemetry/otlp/src" component: "lib:hs-opentelemetry-otlp" - path: "hs-opentelemetry/propagators/w3c/src" component: "lib:hs-opentelemetry-propagator-w3c" - path: "hs-opentelemetry/propagators/w3c/test" component: "hs-opentelemetry-propagator-w3c:test:hs-opentelemetry-propagator-w3c-test" - path: "hs-opentelemetry/sdk/src" component: "lib:hs-opentelemetry-sdk" - path: "hs-opentelemetry/sdk/test" component: "hs-opentelemetry-sdk:test:hs-opentelemetry-sdk-test" ```Expected behaviour
I would like HLS to load up my file with full diagnostics working.
Actual behaviour
error example:
Debug information
Logs: