Skip to content

Unable to determine that the file contains an error unless force CocRestart #696

Closed
@C-alcium

Description

@C-alcium

Your environment

haskell-language-server version: 0.7.0.0 (GHC: 8.10.1) (PATH: /home/calc/.ghcup/bin/haskell-language-server-wrapper-0.7.0) (GIT hash: 6a692de3308c06d8eb7bdf0f7b8a35b6e9a92610)
Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.5.1
ghc:		8.8.4

Which lsp-client do you use:
coc.nvim for NeoVim

Contents of hie.yaml:

cradle:
  stack:
    - path: "./lib"
      component: "HinfoBot:lib"

    - path: "./src"
      component: "HinfoBot:exe:HinfoBot"

Steps to reproduce

  1. Screenshot text
main' :: IO () 
main' = do 
  let res = Just "Hello"
  case res of 
    Nothing -> print "Nothing"
    (Just a) -> print a
  1. Given the below screenshot
    image

  2. remove a
    image

  3. Notice there is no error prompt, remember that coc.nvim includes information in the FAQ about how some language servers will not work on buffered text, so save the file with :w
    image

  4. Still no error, attempt to perform a documentation lookup using shift + k (my personal binding, used to force an onHover call).

  5. Observe that only now after manually calling to the server does it present an error:
    image

Expected behaviour

When I write the file, I should be notified that I have a type error

Actual behaviour

No error is present until I force a documentation lookup, or call :CocRestart

Debug log output

Found "/home/calc/dev/HinfoBot/hie.yaml" for "/home/calc/dev/HinfoBot/a"
Module "/home/calc/dev/HinfoBot/a" is loaded by Cradle: Cradle {cradleRootDir = "/home/calc/dev/HinfoBot", cradleOptsProg = CradleAction: Stack}
Run entered for haskell-language-server-wrapper(haskell-language-server-wrapper) Version 0.7.0.0, Git revision 6a692de3308c06d8eb7bdf0f7b8a35b6e9a92610 (dirty) x86_64 ghc-8.10.1
Current directory: /home/calc/dev/HinfoBot
Operating system: linux
Arguments: ["--debug"]
Cradle directory: /home/calc/dev/HinfoBot
Cradle type: Stack

Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.5.1
ghc:		8.8.4


Consulting the cradle to get project GHC version...
Project GHC version: 8.8.4
haskell-language-server exe candidates: ["haskell-language-server-8.8.4","haskell-language-server-8.8","haskell-language-server"]
Launching haskell-language-server exe at:/home/calc/.ghcup/bin/haskell-language-server-8.8.4
haskell-language-server version: 0.7.0.0 (GHC: 8.8.4) (PATH: /home/calc/.ghcup/bin/haskell-language-server-8.8.4~0.7.0) (GIT hash: 6a692de3308c06d8eb7bdf0f7b8a35b6e9a92610)
(haskell-language-server)Ghcide setup tester in /home/calc/dev/HinfoBot.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Tool versions found on the $PATH
cabal:		3.2.0.0
stack:		2.5.1
ghc:		8.8.4


Step 1/4: Finding files to test in /home/calc/dev/HinfoBot
Found 3 files

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

Step 3/4: Initializing the IDE

Step 4/4: Type checking the files
[INFO] Consulting the cradle for "lib/NewsAPI.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/home/calc/dev/HinfoBot", cradleOptsProg = CradleAction: Stack}
> The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
> Configuring GHCi with the following packages: HinfoBot
> /home/calc/dev/HinfoBot/.stack-work/install/x86_64-linux-tinfo6/f64016d8294d61070b7e6453655c2ba01b8fe4f231a7d68a8057bbbd47142ef1/8.8.4/pkgdb:/home/calc/.stack/snapshots/x86_64-linux-tinfo6/f64016d8294d61070b7e6453655c2ba01b8fe4f231a7d68a8057bbbd47142ef1/8.8.4/pkgdb:/home/calc/.stack/programs/x86_64-linux/ghc-tinfo6-8.8.4/lib/ghc-8.8.4/package.conf.d
[INFO] Using interface files cache dir: ghcide
[INFO] Making new HscEnv[main]
[INFO] Consulting the cradle for "src/Main.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/home/calc/dev/HinfoBot", cradleOptsProg = CradleAction: Stack}
> Using main module: 1. Package `HinfoBot' component HinfoBot:exe:HinfoBot with main-is file: /home/calc/dev/HinfoBot/src/Main.hs
> The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
> Configuring GHCi with the following packages: HinfoBot
> /home/calc/dev/HinfoBot/.stack-work/install/x86_64-linux-tinfo6/f64016d8294d61070b7e6453655c2ba01b8fe4f231a7d68a8057bbbd47142ef1/8.8.4/pkgdb:/home/calc/.stack/snapshots/x86_64-linux-tinfo6/f64016d8294d61070b7e6453655c2ba01b8fe4f231a7d68a8057bbbd47142ef1/8.8.4/pkgdb:/home/calc/.stack/programs/x86_64-linux/ghc-tinfo6-8.8.4/lib/ghc-8.8.4/package.conf.d
[INFO] Using interface files cache dir: ghcide
[INFO] Using interface files cache dir: ghcide
[INFO] Making new HscEnv[main,main]
[INFO] Consulting the cradle for "Setup.hs"
Output from setting up the cradle Cradle {cradleRootDir = "/home/calc/dev/HinfoBot", cradleOptsProg = CradleAction: Stack}
File:     /home/calc/dev/HinfoBot/Setup.hs
Hidden:   no
Range:    1:1-2:1
Source:   cradle
Severity: DsError
Message: 
  Multi Cradle: No prefixes matched
  pwd: /home/calc/dev/HinfoBot
  filepath: /home/calc/dev/HinfoBot/Setup.hs
  prefixes:
  ("./lib",Stack {component = Just "HinfoBot:lib", stackYaml = Nothing})
  ("./src",Stack {component = Just "HinfoBot:exe:HinfoBot", stackYaml = Nothing})
Files that failed:
 * /home/calc/dev/HinfoBot/Setup.hs

Completed (2 files worked, 1 file failed)
haskell-language-server-wrapper: callProcess: /home/calc/.ghcup/bin/haskell-language-server-8.8.4 "--debug" (exit 1): failed

Notes

Perhaps this is a Coc.nvim issue? I am really not sure

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions