different behavior from haskell-language-server-wrapper from emacs vs command line

416 Views Asked by At

If I call the haskell-language-server-wrapper from the command line in the main folder of my project (created with stack), I get the outputs below. Not sure what the for "/Users/ar/Temp/lixo/a" means, but it seems to work as expected.

But, in the *lsp-haskell::stderr* buffer, I have a different result. Emacs found another version of GHC.. The current directory was wrongly associated with the parent folder of the project folder... How can I fix it? What am I missing?

No 'hie.yaml' found. Try to discover the project type!
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.7.0.0 x86_64 ghc-9.2.2
Current directory: /Users/ar/Temp
Operating system: darwin
Arguments: ["--lsp","-d","-l","/var/folders/b_/7nbv248s2nq019mcx58xrrb80000gn/T/hls.log"]
Cradle directory: /Users/ar/Temp
Cradle type: Default

Tool versions found on the $PATH
cabal:      3.6.2.0
stack:      2.7.5
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/ar/.ghcup/bin/haskell-language-server-8.10.7

Command line:

ar@tenis lixo % haskell-language-server-wrapper
Found "/Users/ar/Temp/lixo/hie.yaml" for "/Users/ar/Temp/lixo/a"
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 1.7.0.0 x86_64 ghc-9.2.2
Current directory: /Users/ar/Temp/lixo
Operating system: darwin
Arguments: []
Cradle directory: /Users/ar/Temp/lixo
Cradle type: Stack

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


Consulting the cradle to get project GHC version...
Project GHC version: 9.0.2
haskell-language-server exe candidates: ["haskell-language-server-9.0.2","haskell-language-server"]
Launching haskell-language-server exe at:/Users/ar/.ghcup/bin/haskell-language-server-9.0.2
2022-08-19T14:41:34.696256Z | Info | No log file specified; using stderr.
2022-08-19T14:41:34.700545Z | Info | haskell-language-server version: 1.7.0.0 (GHC: 9.0.2) (PATH: /Users/ar/.ghcup/hls/1.7.0.0/lib/haskell-language-server-1.7.0.0/bin/haskell-language-server-9.0.2)
2022-08-19T14:41:34.703039Z | Info | Directory: /Users/ar/Temp/lixo
2022-08-19T14:41:34.703374Z | Info | Logging heap statistics every 60.00s
 ghcide setup tester in /Users/ar/Temp/lixo.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/4: Finding files to test in /Users/ar/Temp/lixo
Found 4 files

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

Step 3/4: Initializing the IDE

Step 4/4: Type checking the files
2022-08-19T14:41:34.719184Z | Info | Cradle path: Setup.hs
2022-08-19T14:41:34.720457Z | Info | Cradle path: src/Lib.hs
2022-08-19T14:41:34.739216Z | Info | updateFileDiagnostics published different from new diagnostics - file diagnostics: File:     /Users/ar/Temp/lixo/Setup.hs
Hidden:   no
Range:    1:1-2:1
Source:   cradle
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /Users/ar/Temp/lixo
  filepath: /Users/ar/Temp/lixo/Setup.hs
  prefixes:
  ("./src",Stack {component = Just "lixo:lib", stackYaml = Nothing})
  ("./app/Main.hs",Stack {component = Just "lixo:exe:lixo-exe", stackYaml = Nothing})
  ("./app/Paths_lixo.hs",Stack {component = Just "lixo:exe:lixo-exe", stackYaml = Nothing})
  ("./test",Stack {component = Just "lixo:test:lixo-test", stackYaml = Nothing})
....
0

There are 0 best solutions below