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

Extension stops working when using a common stanza in .cabal file #2432

Open
javinor opened this issue Dec 2, 2021 · 1 comment
Open

Extension stops working when using a common stanza in .cabal file #2432

javinor opened this issue Dec 2, 2021 · 1 comment
Labels
can-workaround component: implicit-hie type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@javinor
Copy link

javinor commented Dec 2, 2021

Your environment

Which OS do you use:
Mac OSX

Steps to reproduce

Extracting shared properties to a common stanza, as described in cabal docs (end of section 4.1.7), causes plugin to stop working, with "Multi Cradle: No prefixes matched"

Expected behaviour

Extension should work as usual. When using this it works fine:

cabal-version:      2.4
name:               aoc2021
version:            0.1.0.0

author:             Me
maintainer:         ****

extra-source-files: CHANGELOG.md

executable day01
    main-is:          Day01.hs
    build-depends:    base ^>=4.14.3.0
    hs-source-dirs:   app
    default-language: Haskell2010

executable day02
    main-is:          Day02.hs
    build-depends:    base ^>=4.14.3.0
    hs-source-dirs:   app
    default-language: Haskell2010

Actual behaviour

Squiggly red line under the first line (module Main where) stating Multi Cradle: No prefixes matched

using this cabal file:

cabal-version:      2.4
name:               aoc2021
version:            0.1.0.0

author:             Me
maintainer:         ****

extra-source-files: CHANGELOG.md

common shared-properties
  build-depends:    base ^>=4.14.3.0 && <5
  default-language: Haskell2010
  ghc-options:      -Wall
  hs-source-dirs:   app

executable day01
  import:           shared-properties
  main-is:          Day01.hs

executable day02
  import:           shared-properties
  main-is:          Day02.hs

image

Include debug information

Execute in the root of your project the command haskell-language-server-wrapper --debug . and paste the logs here (you can find the executable location here):

Debug output with bad cabal file:
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.5.0.0, Git revision 311107eabbf0537e0c192b2c377d282505b4eff1 (dirty) x86_64 ghc-8.10.7
Current directory: /Users/javinor/workspace/garbage/adventofcode-2021/haskell
Operating system: darwin
Arguments: ["--debug","."]
Cradle directory: /Users/javinor/workspace/garbage/adventofcode-2021/haskell
Cradle type: Cabal

Tool versions found on the $PATH
cabal:		3.6.2.0
stack:		2.5.1
ghc:		8.10.7


Consulting the cradle to get project GHC version...
Project GHC version: 8.10.7
haskell-language-server exe candidates: ["haskell-language-server-8.10.7","haskell-language-server"]
Launching haskell-language-server exe at:/Users/javinor/.ghcup/bin/haskell-language-server-8.10.7
haskell-language-server version: 1.5.0.0 (GHC: 8.10.7) (PATH: /Users/javinor/.ghcup/bin/haskell-language-server-8.10.7~1.5.0) (GIT hash: 311107eabbf0537e0c192b2c377d282505b4eff1)
 ghcide setup tester in /Users/javinor/workspace/garbage/adventofcode-2021/haskell.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/4: Finding files to test in /Users/javinor/workspace/garbage/adventofcode-2021/haskell
Found 2 files

Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle
  ()

Step 3/4: Initializing the IDE
2021-12-02 16:21:03.768085 [ThreadId 7] DEBUG hls:	Initializing exports map from hiedb

Step 4/4: Type checking the files
2021-12-02 16:21:03.769899 [ThreadId 7] DEBUG hls:	Done initializing exports map from hiedb (7)
2021-12-02 16:21:03.770144 [ThreadId 16] DEBUG hls:	hlint:getIdeas:file:NormalizedFilePath "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs"
2021-12-02 16:21:03.770272 [ThreadId 17] DEBUG hls:	hlint:getIdeas:file:NormalizedFilePath "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day02.hs"
2021-12-02 16:21:03.916935 [ThreadId 53] INFO hls:	Consulting the cradle for "app/Day02.hs"
2021-12-02 16:21:03.91703 [ThreadId 53] WARNING hls:	No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for app/Day02.hs.
 Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2021-12-02 16:21:03.92343 [ThreadId 53] DEBUG hls:	Output from setting up the cradle Cradle {cradleRootDir = "/Users/javinor/workspace/garbage/adventofcode-2021/haskell", cradleOptsProg = CradleAction: Cabal}
2021-12-02 16:21:03.923539 [ThreadId 53] DEBUG hls:	Session loading result: Left [CradleError {cradleErrorDependencies = [], cradleErrorExitCode = ExitSuccess, cradleErrorStderr = ["Multi Cradle: No prefixes matched","pwd: /Users/javinor/workspace/garbage/adventofcode-2021/haskell","filepath: /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day02.hs","prefixes:","(\"./Day01.hs\",Cabal {component = Just \"aoc2021:exe:day01\"})","(\"./Day02.hs\",Cabal {component = Just \"aoc2021:exe:day02\"})"]}]
2021-12-02 16:21:03.923664 [ThreadId 47] INFO hls:	File:     /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day02.hs
Hidden:   no
Range:    1:1-2:1
Source:   cradle
Severity: DsError
Message: 
  Multi Cradle: No prefixes matched
  pwd: /Users/javinor/workspace/garbage/adventofcode-2021/haskell
  filepath: /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day02.hs
  prefixes:
  ("./Day01.hs",Cabal {component = Just "aoc2021:exe:day01"})
  ("./Day02.hs",Cabal {component = Just "aoc2021:exe:day02"})
2021-12-02 16:21:03.924909 [ThreadId 55] INFO hls:	Consulting the cradle for "app/Day01.hs"
2021-12-02 16:21:03.924976 [ThreadId 55] WARNING hls:	No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for app/Day01.hs.
 Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2021-12-02 16:21:03.931104 [ThreadId 55] DEBUG hls:	Output from setting up the cradle Cradle {cradleRootDir = "/Users/javinor/workspace/garbage/adventofcode-2021/haskell", cradleOptsProg = CradleAction: Cabal}
2021-12-02 16:21:03.93119 [ThreadId 55] DEBUG hls:	Session loading result: Left [CradleError {cradleErrorDependencies = [], cradleErrorExitCode = ExitSuccess, cradleErrorStderr = ["Multi Cradle: No prefixes matched","pwd: /Users/javinor/workspace/garbage/adventofcode-2021/haskell","filepath: /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs","prefixes:","(\"./Day01.hs\",Cabal {component = Just \"aoc2021:exe:day01\"})","(\"./Day02.hs\",Cabal {component = Just \"aoc2021:exe:day02\"})"]}]
2021-12-02 16:21:03.931296 [ThreadId 46] INFO hls:	File:     /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs
Hidden:   no
Range:    1:1-2:1
Source:   cradle
Severity: DsError
Message: 
  Multi Cradle: No prefixes matched
  pwd: /Users/javinor/workspace/garbage/adventofcode-2021/haskell
  filepath: /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs
  prefixes:
  ("./Day01.hs",Cabal {component = Just "aoc2021:exe:day01"})
  ("./Day02.hs",Cabal {component = Just "aoc2021:exe:day02"})
2021-12-02 16:21:03.931591 [ThreadId 28] INFO hls:	finish: User TypeCheck (took 0.16s)
2021-12-02 16:21:03.93173 [ThreadId 77] INFO hls:	finish: GetHie (took 0.00s)
2021-12-02 16:21:03.931848 [ThreadId 78] INFO hls:	finish: GenerateCore (took 0.00s)
Files that failed:
 * /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs
 * /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day02.hs

Completed (0 files worked, 2 files failed)
haskell-language-server-wrapper: callProcess: /Users/javinor/.ghcup/bin/haskell-language-server-8.10.7 "--debug" "." (exit 2): failed

Debug output with good cabal file
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.5.0.0, Git revision 311107eabbf0537e0c192b2c377d282505b4eff1 (dirty) x86_64 ghc-8.10.7
Current directory: /Users/javinor/workspace/garbage/adventofcode-2021/haskell
Operating system: darwin
Arguments: ["--debug","."]
Cradle directory: /Users/javinor/workspace/garbage/adventofcode-2021/haskell
Cradle type: Cabal

Tool versions found on the $PATH
cabal:		3.6.2.0
stack:		2.5.1
ghc:		8.10.7


Consulting the cradle to get project GHC version...
Project GHC version: 8.10.7
haskell-language-server exe candidates: ["haskell-language-server-8.10.7","haskell-language-server"]
Launching haskell-language-server exe at:/Users/javinor/.ghcup/bin/haskell-language-server-8.10.7
haskell-language-server version: 1.5.0.0 (GHC: 8.10.7) (PATH: /Users/javinor/.ghcup/bin/haskell-language-server-8.10.7~1.5.0) (GIT hash: 311107eabbf0537e0c192b2c377d282505b4eff1)
 ghcide setup tester in /Users/javinor/workspace/garbage/adventofcode-2021/haskell.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/4: Finding files to test in /Users/javinor/workspace/garbage/adventofcode-2021/haskell
Found 2 files

Step 2/4: Looking for hie.yaml files that control setup
Found 1 cradle
  ()

Step 3/4: Initializing the IDE
2021-12-02 16:21:41.459557 [ThreadId 7] DEBUG hls:	Initializing exports map from hiedb
2021-12-02 16:21:41.46072 [ThreadId 7] DEBUG hls:	Done initializing exports map from hiedb (7)

Step 4/4: Type checking the files
2021-12-02 16:21:41.462494 [ThreadId 29] INFO hls:	Consulting the cradle for "app/Day02.hs"
2021-12-02 16:21:41.462631 [ThreadId 29] WARNING hls:	No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for app/Day02.hs.
 Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2021-12-02 16:21:41.469881 [ThreadId 29] DEBUG hls:	Output from setting up the cradle Cradle {cradleRootDir = "/Users/javinor/workspace/garbage/adventofcode-2021/haskell", cradleOptsProg = CradleAction: Cabal}
2021-12-02 16:21:41.50648 [ThreadId 37] INFO hie-bios:	Build profile: -w ghc-8.10.7 -O1
2021-12-02 16:21:41.506601 [ThreadId 37] INFO hie-bios:	In order, the following will be built (use -v for more details):
2021-12-02 16:21:41.506653 [ThreadId 37] INFO hie-bios:	 - aoc2021-0.1.0.0 (exe:day02) (first run)
2021-12-02 16:21:41.52646 [ThreadId 37] INFO hie-bios:	./aoc2021.cabal has been changed. Re-configuring with most recently used
2021-12-02 16:21:41.526595 [ThreadId 37] INFO hie-bios:	options. If this fails, please run configure manually.
2021-12-02 16:21:41.530054 [ThreadId 37] INFO hie-bios:	Configuring executable 'day02' for aoc2021-0.1.0.0..
2021-12-02 16:21:42.967061 [ThreadId 37] INFO hie-bios:	Preprocessing executable 'day02' for aoc2021-0.1.0.0..
2021-12-02 16:21:43.152075 [ThreadId 29] DEBUG hls:	Session loading result: Right (ComponentOptions {componentOptions = ["-fbuilding-cabal-package","-O0","-outputdir","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/build/day02/day02-tmp","-odir","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/build/day02/day02-tmp","-hidir","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/build/day02/day02-tmp","-stubdir","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/build/day02/day02-tmp","-i","-i/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/build/day02/day02-tmp","-iapp","-i/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/build/day02/autogen","-i/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/build/global-autogen","-I/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/build/day02/autogen","-I/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/build/global-autogen","-I/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/build/day02/day02-tmp","-optP-include","-optP/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/build/day02/autogen/cabal_macros.h","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/Users/javinor/.cabal/store/ghc-8.10.7/package.db","-package-db","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/packagedb/ghc-8.10.7","-package-db","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day02/package.conf.inplace","-package-id","base-4.14.3.0","-XHaskell2010","app/Day02.hs","-hide-all-packages"], componentRoot = "/Users/javinor/workspace/garbage/adventofcode-2021/haskell", componentDependencies = ["aoc2021.cabal","cabal.project","cabal.project.local"]},"/Users/javinor/.ghcup/ghc/8.10.7/lib/ghc-8.10.7")
2021-12-02 16:21:43.233591 [ThreadId 29] INFO hls:	Using interface files cache dir: /Users/javinor/.cache/ghcide/main-7b9b61b4e7e5b093e4c7429a58692d08682aedbc
2021-12-02 16:21:43.233789 [ThreadId 29] INFO hls:	Making new HscEnv[main]
2021-12-02 16:21:43.240903 [ThreadId 29] DEBUG hls:	New Component Cache HscEnvEq: (([],Just HscEnvEq 5),fromList [("aoc2021.cabal",Just 2021-12-02 14:21:35.273654386 UTC),("cabal.project",Nothing),("cabal.project.local",Nothing)])
2021-12-02 16:21:43.241194 [ThreadId 29] DEBUG hls:	Known files updated: fromList [(TargetFile NormalizedFilePath "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day02.hs",fromList ["/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day02.hs"])]
2021-12-02 16:21:43.241312 [ThreadId 10] DEBUG hls:	Finishing build session(exception: AsyncCancelled)
2021-12-02 16:21:43.241581 [ThreadId 29] DEBUG hls:	Restarting build session due to new component for keys [GetKnownTargets; ,GhcSessionIO; ] (aborting the previous one took 0.00s)
2021-12-02 16:21:43.241897 [ThreadId 61] DEBUG hls:	hlint:getIdeas:file:NormalizedFilePath "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day02.hs"
2021-12-02 16:21:43.241958 [ThreadId 66] DEBUG hls:	hlint:getIdeas:file:NormalizedFilePath "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs"
2021-12-02 16:21:43.360568 [ThreadId 89] INFO hls:	Consulting the cradle for "app/Day01.hs"
2021-12-02 16:21:43.360662 [ThreadId 89] WARNING hls:	No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for app/Day01.hs.
 Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2021-12-02 16:21:43.367497 [ThreadId 89] DEBUG hls:	Output from setting up the cradle Cradle {cradleRootDir = "/Users/javinor/workspace/garbage/adventofcode-2021/haskell", cradleOptsProg = CradleAction: Cabal}
2021-12-02 16:21:43.418123 [ThreadId 95] INFO hie-bios:	Build profile: -w ghc-8.10.7 -O1
2021-12-02 16:21:43.418221 [ThreadId 95] INFO hie-bios:	In order, the following will be built (use -v for more details):
2021-12-02 16:21:43.418259 [ThreadId 95] INFO hie-bios:	 - aoc2021-0.1.0.0 (exe:day01) (first run)
2021-12-02 16:21:43.429354 [ThreadId 95] INFO hie-bios:	./aoc2021.cabal has been changed. Re-configuring with most recently used
2021-12-02 16:21:43.429412 [ThreadId 95] INFO hie-bios:	options. If this fails, please run configure manually.
2021-12-02 16:21:43.431519 [ThreadId 95] INFO hie-bios:	Configuring executable 'day01' for aoc2021-0.1.0.0..
2021-12-02 16:21:44.843626 [ThreadId 95] INFO hie-bios:	Preprocessing executable 'day01' for aoc2021-0.1.0.0..
2021-12-02 16:21:45.03347 [ThreadId 89] DEBUG hls:	Session loading result: Right (ComponentOptions {componentOptions = ["-fbuilding-cabal-package","-O0","-outputdir","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/build/day01/day01-tmp","-odir","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/build/day01/day01-tmp","-hidir","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/build/day01/day01-tmp","-stubdir","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/build/day01/day01-tmp","-i","-i/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/build/day01/day01-tmp","-iapp","-i/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/build/day01/autogen","-i/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/build/global-autogen","-I/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/build/day01/autogen","-I/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/build/global-autogen","-I/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/build/day01/day01-tmp","-optP-include","-optP/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/build/day01/autogen/cabal_macros.h","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/Users/javinor/.cabal/store/ghc-8.10.7/package.db","-package-db","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/packagedb/ghc-8.10.7","-package-db","/Users/javinor/.cache/hie-bios/dist-haskell-e1ceb7287f980f66dfb30e0783dce172/build/x86_64-osx/ghc-8.10.7/aoc2021-0.1.0.0/x/day01/package.conf.inplace","-package-id","base-4.14.3.0","-XHaskell2010","app/Day01.hs","-hide-all-packages"], componentRoot = "/Users/javinor/workspace/garbage/adventofcode-2021/haskell", componentDependencies = ["aoc2021.cabal","cabal.project","cabal.project.local"]},"/Users/javinor/.ghcup/ghc/8.10.7/lib/ghc-8.10.7")
2021-12-02 16:21:45.117078 [ThreadId 89] INFO hls:	Using interface files cache dir: /Users/javinor/.cache/ghcide/main-f9d1986147428bed85560dff06a1beec80508247
2021-12-02 16:21:45.117281 [ThreadId 89] INFO hls:	Using interface files cache dir: /Users/javinor/.cache/ghcide/main-f9d1986147428bed85560dff06a1beec80508247
2021-12-02 16:21:45.117401 [ThreadId 89] INFO hls:	Making new HscEnv[main,main]
2021-12-02 16:21:45.125642 [ThreadId 89] DEBUG hls:	New Component Cache HscEnvEq: (([],Just HscEnvEq 7),fromList [("aoc2021.cabal",Just 2021-12-02 14:21:35.273654386 UTC),("cabal.project",Nothing),("cabal.project.local",Nothing)])
2021-12-02 16:21:45.125923 [ThreadId 89] DEBUG hls:	New Component Cache HscEnvEq: (([],Just HscEnvEq 8),fromList [("aoc2021.cabal",Just 2021-12-02 14:21:35.273654386 UTC),("cabal.project",Nothing),("cabal.project.local",Nothing)])
2021-12-02 16:21:45.126171 [ThreadId 89] DEBUG hls:	Known files updated: fromList [(TargetFile NormalizedFilePath "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day02.hs",fromList ["/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day02.hs"]),(TargetFile NormalizedFilePath "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs",fromList ["/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs"])]
2021-12-02 16:21:45.126294 [ThreadId 46] DEBUG hls:	Finishing build session(exception: AsyncCancelled)
2021-12-02 16:21:45.126341 [ThreadId 89] DEBUG hls:	Restarting build session due to new component for keys [GetKnownTargets; ,GhcSessionIO; ] (aborting the previous one took 0.00s)
2021-12-02 16:21:45.126449 [ThreadId 117] DEBUG hls:	hlint:getIdeas:file:NormalizedFilePath "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day02.hs"
2021-12-02 16:21:45.1265 [ThreadId 116] DEBUG hls:	hlint:getIdeas:file:NormalizedFilePath "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs"
2021-12-02 16:21:45.278413 [ThreadId 123] INFO hls:	finish: User TypeCheck (took 0.15s)
2021-12-02 16:21:45.320201 [ThreadId 250] INFO hls:	finish: GetHie (took 0.01s)
2021-12-02 16:21:45.320495 [ThreadId 262] INFO hls:	finish: GenerateCore (took 0.00s)

Completed (2 files worked, 0 files failed)


Paste the contents of extension specific log, you can check instructions about how to find it here

Extension log:
[client][INFO] Searching for server executables haskell-language-server-wrapper,haskell-language-server in $PATH
[client][INFO] Found server executable in $PATH: haskell-language-server-wrapper
[client][INFO] Activating the language server in the workspace folder: /Users/javinor/workspace/garbage/adventofcode-2021/haskell
[client][INFO] run command: haskell-language-server-wrapper --lsp -d
[client][INFO] debug command: haskell-language-server-wrapper --lsp -d
[client][INFO] document selector patten: /Users/javinor/workspace/garbage/adventofcode-2021/haskell/**/*
[client][INFO] Starting language server
No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.5.0.0, Git revision 311107eabbf0537e0c192b2c377d282505b4eff1 (dirty) x86_64 ghc-8.10.7
Current directory: /Users/javinor/workspace/garbage/adventofcode-2021/haskell
Operating system: darwin
Arguments: ["--lsp","-d"]
Cradle directory: /Users/javinor/workspace/garbage/adventofcode-2021/haskell
Cradle type: Cabal

Tool versions found on the $PATH
cabal:		3.6.2.0
stack:		2.5.1
ghc:		8.10.7


Consulting the cradle to get project GHC version...
Project GHC version: 8.10.7
haskell-language-server exe candidates: ["haskell-language-server-8.10.7","haskell-language-server"]
Launching haskell-language-server exe at:/Users/javinor/.ghcup/bin/haskell-language-server-8.10.7
haskell-language-server version: 1.5.0.0 (GHC: 8.10.7) (PATH: /Users/javinor/.ghcup/bin/haskell-language-server-8.10.7~1.5.0) (GIT hash: 311107eabbf0537e0c192b2c377d282505b4eff1)
Starting (haskell-language-server)LSP server...
  with arguments: GhcideArguments {argsCommand = LSP, argsCwd = Nothing, argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = True, argsLogFile = Nothing, argsThreads = 0, argsProjectGhcVersion = False}
  with plugins: [PluginId "pragmas",PluginId "floskell",PluginId "fourmolu",PluginId "tactics",PluginId "ormolu",PluginId "stylish-haskell",PluginId "retrie",PluginId "brittany",PluginId "callHierarchy",PluginId "class",PluginId "haddockComments",PluginId "eval",PluginId "importLens",PluginId "refineImports",PluginId "moduleName",PluginId "hlint",PluginId "splice",PluginId "ghcide-hover-and-symbols",PluginId "ghcide-code-actions-imports-exports",PluginId "ghcide-code-actions-type-signatures",PluginId "ghcide-code-actions-bindings",PluginId "ghcide-code-actions-fill-holes",PluginId "ghcide-completions",PluginId "ghcide-type-lenses",PluginId "ghcide-core"]
  in directory: /Users/javinor/workspace/garbage/adventofcode-2021/haskell
 2021-12-02 16:30:45.76016 [ThreadId 4] INFO hls:	Starting LSP server...
2021-12-02 16:30:45.760789 [ThreadId 4] INFO hls:	If you are seeing this in a terminal, you probably should have run WITHOUT the --lsp option!
2021-12-02 16:30:45.762557 [ThreadId 13] INFO hls:	Started LSP server in 0.00s
2021-12-02 16:30:45.769816 [ThreadId 13] DEBUG hls:	setInitialDynFlags cradle: Cradle {cradleRootDir = "/Users/javinor/workspace/garbage/adventofcode-2021/haskell", cradleOptsProg = CradleAction: Cabal}
2021-12-02 16:30:45.914541 [ThreadId 13] DEBUG hls:	runSubset: True
2021-12-02 16:30:45.914653 [ThreadId 19] DEBUG hls:	Initializing exports map from hiedb
2021-12-02 16:30:45.914869 [ThreadId 13] INFO hls:	Registering ide configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri (-1588271250644660671) "file:///Users/javinor/workspace/garbage/adventofcode-2021/haskell"], clientSettings = hashed Nothing}
2021-12-02 16:30:45.919314 [ThreadId 19] DEBUG hls:	Done initializing exports map from hiedb (7)
2021-12-02 16:30:45.92259 [ThreadId 21] DEBUG hls:	Configuration changed: Object (fromList [("haskell",Object (fromList [("checkProject",Bool True),("formattingProvider",String "ormolu"),("indentationRules",Object (fromList [("enabled",Bool True)])),("logFile",String ""),("maxCompletions",Number 40.0),("openDocumentationInHackage",Bool True),("openSourceInHackage",Bool True),("plugin",Object (fromList [("class",Object (fromList [("globalOn",Bool True)])),("eval",Object (fromList [("globalOn",Bool True)])),("ghcide-completions",Object (fromList [("config",Object (fromList [("autoExtendOn",Bool True),("snippetsOn",Bool True)]))])),("ghcide-type-lenses",Object (fromList [("config",Object (fromList [("mode",Bool True)])),("globalOn",Bool True)])),("haddockComments",Object (fromList [("globalOn",Bool True)])),("hlint",Object (fromList [("codeActionsOn",Bool True),("config",Object (fromList [("flags",Array [])])),("diagnosticsOn",Bool True)])),("importLens",Object (fromList [("codeActionsOn",Bool True),("codeLensOn",Bool True)])),("moduleName",Object (fromList [("globalOn",Bool True)])),("pragmas",Object (fromList [("codeActionsOn",Bool True),("completionOn",Bool True)])),("refineImports",Object (fromList [("globalOn",Bool True)])),("retrie",Object (fromList [("globalOn",Bool True)])),("splice",Object (fromList [("globalOn",Bool True)])),("tactics",Object (fromList [("config",Object (fromList [("auto_gas",Number 4.0),("hole_severity",Null),("max_use_ctor_actions",Number 5.0),("proofstate_styling",Bool True),("timeout_duration",Number 2.0)])),("globalOn",Bool True)]))])),("releasesURL",String ""),("serverExecutablePath",String ""),("serverExtraArgs",String ""),("trace",Object (fromList [("client",String "debug"),("server",String "messages")])),("updateBehavior",String "keep-up-to-date")]))])
2021-12-02 16:30:45.922896 [ThreadId 24] DEBUG hls:	Finishing build session(exception: AsyncCancelled)
2021-12-02 16:30:45.922923 [ThreadId 21] DEBUG hls:	Restarting build session due to config change for keys [GetClientSettings; ] (aborting the previous one took 0.00s)
2021-12-02 16:30:45.923154 [ThreadId 21] DEBUG hls:	Set files of interest to: fromList [(NormalizedFilePath "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs",Modified {firstOpen = True})]
2021-12-02 16:30:45.923308 [ThreadId 39] DEBUG hls:	Finishing build session(exception: AsyncCancelled)
2021-12-02 16:30:45.923303 [ThreadId 21] DEBUG hls:	Restarting build session due to /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs (modified) for keys [IsFileOfInterest; /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs,GetModificationTime; /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs,GetClientSettings; ] (aborting the previous one took 0.00s)
2021-12-02 16:30:45.923395 [ThreadId 21] DEBUG hls:	Opened text document: file:///Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs
2021-12-02 16:30:45.923656 [ThreadId 64] DEBUG hls:	hlint:getIdeas:file:NormalizedFilePath "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs"
2021-12-02 16:30:45.924603 [ThreadId 71] INFO hls:	Consulting the cradle for "app/Day01.hs"
2021-12-02 16:30:45.924685 [ThreadId 71] WARNING hls:	No [cradle](https://github.com/mpickering/hie-bios#hie-bios) found for app/Day01.hs.
 Proceeding with [implicit cradle](https://hackage.haskell.org/package/implicit-hie).
You should ignore this message, unless you see a 'Multi Cradle: No prefixes matched' error.
2021-12-02 16:30:45.93169 [ThreadId 76] DEBUG hls:	Output from setting up the cradle Cradle {cradleRootDir = "/Users/javinor/workspace/garbage/adventofcode-2021/haskell", cradleOptsProg = CradleAction: Cabal}
2021-12-02 16:30:45.931843 [ThreadId 71] DEBUG hls:	Session loading result: Left [CradleError {cradleErrorDependencies = [], cradleErrorExitCode = ExitSuccess, cradleErrorStderr = ["Multi Cradle: No prefixes matched","pwd: /Users/javinor/workspace/garbage/adventofcode-2021/haskell","filepath: /Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs","prefixes:","(\"./Day01.hs\",Cabal {component = Just \"aoc2021:exe:day01\"})","(\"./Day02.hs\",Cabal {component = Just \"aoc2021:exe:day02\"})"]}]
2021-12-02 16:30:45.935476 [ThreadId 104] INFO hls:	finish: Pragmas.GetParsedModule (took 0.00s)
2021-12-02 16:30:45.935603 [ThreadId 109] DEBUG hls:	LOOKUP UP PERSISTENT FOR: GetParsedModule
2021-12-02 16:30:45.935643 [ThreadId 114] INFO hls:	finish: importLens (took 0.00s)
2021-12-02 16:30:45.935676 [ThreadId 112] DEBUG hls:	LOOKUP UP PERSISTENT FOR: TypeCheck
2021-12-02 16:30:45.935727 [ThreadId 109] INFO hls:	finish: Outline (took 0.00s)
2021-12-02 16:30:45.935723 [ThreadId 110] INFO hls:	finish: GhcideCodeActions.getParsedModule (took 0.00s)
2021-12-02 16:30:45.935752 [ThreadId 112] INFO hls:	finish: retrie (took 0.00s)
2021-12-02 16:30:45.935809 [ThreadId 115] INFO hls:	finish: RefineImports (took 0.00s)
2021-12-02 16:30:45.93587 [ThreadId 118] INFO hls:	finish: splice.codeAction.GitHieAst (took 0.00s)
2021-12-02 16:30:45.935972 [ThreadId 113] DEBUG hls:	LOOKUP UP PERSISTENT FOR: GetModSummaryWithoutTimestamps
2021-12-02 16:30:45.93605 [ThreadId 113] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.936083 [ThreadId 111] INFO hls:	finish: Pragmas.GetFileContents (took 0.00s)
2021-12-02 16:30:45.936143 [ThreadId 117] INFO hls:	finish: HaddockComments.GetAnnotatedParsedSource (took 0.00s)
2021-12-02 16:30:45.936202 [ThreadId 132] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.936328 [ThreadId 133] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.936496 [ThreadId 134] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.936646 [ThreadId 135] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.936796 [ThreadId 136] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.936948 [ThreadId 137] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.937095 [ThreadId 138] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.937221 [ThreadId 139] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.937373 [ThreadId 140] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.937544 [ThreadId 141] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.937714 [ThreadId 142] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:45.937872 [ThreadId 143] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.183856 [ThreadId 152] DEBUG hls:	src/Ide/Plugin/Eval/CodeLens.hs:121:15 "fp" "/Users/javinor/workspace/garbage/adventofcode-2021/haskell/app/Day01.hs"
2021-12-02 16:30:46.183949 [ThreadId 157] INFO hls:	finish: codeLens.TypeCheck (took 0.00s)
2021-12-02 16:30:46.184029 [ThreadId 161] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.184161 [ThreadId 163] INFO hls:	finish: ModuleName.ghcSession (took 0.00s)
2021-12-02 16:30:46.184217 [ThreadId 166] DEBUG hls:	LOOKUP UP PERSISTENT FOR: GetParsedModuleWithComments
2021-12-02 16:30:46.184258 [ThreadId 159] INFO hls:	finish: codeLens.GetBindings (took 0.00s)
2021-12-02 16:30:46.184382 [ThreadId 164] DEBUG hls:	LOOKUP UP PERSISTENT FOR: GetEvalComments
2021-12-02 16:30:46.184393 [ThreadId 162] DEBUG hls:	LOOKUP UP PERSISTENT FOR: MinimalImports
2021-12-02 16:30:46.18444 [ThreadId 164] INFO hls:	finish: eval.GetParsedModuleWithComments (took 0.00s)
2021-12-02 16:30:46.184588 [ThreadId 162] INFO hls:	finish:  (took 0.00s)
2021-12-02 16:30:46.184872 [ThreadId 158] DEBUG hls:	LOOKUP UP PERSISTENT FOR: RefineImports
2021-12-02 16:30:46.184582 [ThreadId 170] INFO hls:	finish: codeLens.GetGlobalBindingTypeSigs (took 0.00s)
2021-12-02 16:30:46.18492 [ThreadId 158] INFO hls:	finish: RefineImports (took 0.00s)
2021-12-02 16:30:46.392002 [ThreadId 204] INFO hls:	finish: GhcideCodeActions.getParsedModule (took 0.00s)
2021-12-02 16:30:46.392027 [ThreadId 206] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.392065 [ThreadId 207] INFO hls:	finish: importLens (took 0.00s)
2021-12-02 16:30:46.392131 [ThreadId 202] INFO hls:	finish: Pragmas.GetParsedModule (took 0.00s)
2021-12-02 16:30:46.392155 [ThreadId 205] INFO hls:	finish: RefineImports (took 0.00s)
2021-12-02 16:30:46.392197 [ThreadId 203] INFO hls:	finish: HaddockComments.GetAnnotatedParsedSource (took 0.00s)
2021-12-02 16:30:46.39223 [ThreadId 208] INFO hls:	finish: splice.codeAction.GitHieAst (took 0.00s)
2021-12-02 16:30:46.39227 [ThreadId 209] INFO hls:	finish: retrie (took 0.00s)
2021-12-02 16:30:46.392323 [ThreadId 211] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.392348 [ThreadId 210] INFO hls:	finish: Pragmas.GetFileContents (took 0.00s)
2021-12-02 16:30:46.392491 [ThreadId 212] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.392689 [ThreadId 213] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.392851 [ThreadId 214] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.39304 [ThreadId 215] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.39324 [ThreadId 216] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.393395 [ThreadId 217] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.393565 [ThreadId 218] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.393707 [ThreadId 219] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.393876 [ThreadId 220] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.394052 [ThreadId 221] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)
2021-12-02 16:30:46.394194 [ThreadId 222] INFO hls:	finish: Wingman.getIdeDynflags.GetModSummaryWithoutTimestamps (took 0.00s)

@fendor
Copy link
Collaborator

fendor commented Dec 2, 2021

Thank you for the bug report!

The issue is implicit-hie doesnt parse common stanzas and generates a bad hie.yaml.

Work-around: write a hie.yaml in the root of your project with the contents

cradle:
  cabal:

A fix from HLS is the PR #2342

@fendor fendor transferred this issue from haskell/vscode-haskell Dec 2, 2021
@fendor fendor added can-workaround component: implicit-hie type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels Dec 2, 2021
@jneira jneira linked a pull request Dec 2, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can-workaround component: implicit-hie type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants