Open lyh970817 opened 4 years ago
I get this in the coc docs window do you?
sum :: Any Integer -> Integer
sum :: forall (t :: * -> *) a. (Foldable t, Num a) => t a -> a
The `sum` function computes the sum of the numbers of a structure.
[Documentation](file:///home/user/.ghcup/ghc/8.8.3/share/doc/ghc-8.8.3/html/libraries/base-4.13.0.0/Data-Foldable.html#v:sum)
[Source](file:///home/user/.ghcup/ghc/8.8.3/share/doc/ghc-8.8.3/html/libraries/base-4.13.0.0/src/Data-Foldable.html#sum)
base Data.Foldable
It works for me too with Coc.
Ask for Coc specific help on https://gitter.im/neoclide/coc.nvim
This is not the place for that.
@lyh970817 You may not have generated a hoogle database. Check the hie readme for instructions for cabal or stack
@lyh970817 You may not have generated a hoogle database. Check the hie readme for instructions for cabal or stack
Thanks. I've realized that too. I did have a hoogle database but I've tried to regenerate it and set HIE_HOOGLE_DATABASE="$HOME/.hoogle/default-haskell-5.0.17.hoo"
. It still doesn't work but I found these messages in the coc debug info
2020-04-14 00:11:29.247987052 [ThreadId 4] - Run entered for HIE(hie-8.8.3) Version 1.3, Git revision 78eb87b221481d81b8764c821ab3d673e9768464 (3873 commits) x86_64 ghc-8.8.3
2020-04-14 00:11:29.254453103 [ThreadId 4] - Operating as a LSP server on stdio
2020-04-14 00:11:29.254604875 [ThreadId 4] - Current directory:/home/lyh970817
2020-04-14 00:11:29.254720905 [ThreadId 4] - Operating system:linux
2020-04-14 00:11:29.255430882 [ThreadId 4] - args:["--lsp"]
2020-04-14 00:11:29.318052289 [ThreadId 4] - Could not find a Project for file: /home/lyh970817/File.hs
2020-04-14 00:11:29.318241283 [ThreadId 4] - Module "/home/lyh970817/File.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/lyh970817", cradleOptsProg = CradleAction: Direct}
2020-04-14 00:11:29.318684066 [ThreadId 4] - Executing GHC on path with args: --numeric-version
2020-04-14 00:11:29.356956607 [ThreadId 9] - Executing GHC on path with args: --print-libdir
Using hie version: Version 1.3, Git revision 78eb87b221481d81b8764c821ab3d673e9768464 (3873 commits) x86_64 ghc-8.8.3
2020-04-14 00:11:31.391215903 [ThreadId 15] - New cradle: /home/lyh970817/.tmp/21:59-04-13.hs
2020-04-14 00:11:31.392684989 [ThreadId 15] - Could not find a Project for file: /home/lyh970817/.tmp/21:59-04-13.hs
2020-04-14 00:11:31.3928309 [ThreadId 15] - Module "/home/lyh970817/.tmp/21:59-04-13.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/lyh970817", cradleOptsProg = CradleAction: Direct}
2020-04-14 00:11:31.392956659 [ThreadId 15] - Found cradle: Cradle {cradleRootDir = "/home/lyh970817", cradleOptsProg = CradleAction: Direct}
Using hoogle db at: /home/lyh970817/.hoogle/default-haskell-5.0.17.hoo
2020-04-14 00:11:31.666985538 [ThreadId 19] - Cradle did not load succesfully
Is it related to the last two lines?
Most likely, do you get type error diagnostics? stack or cabal? hie.yaml? multi component?
Most likely, do you get type error diagnostics? stack or cabal? hie.yaml? multi component?
I'm using stack but have not created a project and are not using a hie.yaml
at all I just created an hs file and put it somewhere randomly. If I do create a project with stack new
and go into the Setup.hs
I get something like this
2020-04-14 08:27:05.058725234 [ThreadId 4] - Run entered for HIE(hie-8.8.3) Version 1.3, Git revision 78eb87b221481d81b8764c821ab3d673e9768464 (3873 commits) x86_64 ghc-8.8.3
2020-04-14 08:27:05.059043817 [ThreadId 4] - Operating as a LSP server on stdio
2020-04-14 08:27:05.059085441 [ThreadId 4] - Current directory:/home/lyh970817
2020-04-14 08:27:05.05911235 [ThreadId 4] - Operating system:linux
2020-04-14 08:27:05.059140453 [ThreadId 4] - args:["--lsp"]
2020-04-14 08:27:05.060339086 [ThreadId 4] - Cabal-Helper decided to use: ProjLocStackYaml {plStackYaml = "/home/lyh970817/myp/stack.yaml"}
2020-04-14 08:27:06.490624454 [ThreadId 4] - Module "/home/lyh970817/myp/File.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/lyh970817/myp", cradleOptsProg = CradleAction: Other Stack}
2020-04-14 08:27:06.490709768 [ThreadId 4] - Executing Stack GHC with args: --numeric-version
2020-04-14 08:27:06.860158462 [ThreadId 28] - Executing Stack GHC with args: --print-libdir
Using hie version: Version 1.3, Git revision 78eb87b221481d81b8764c821ab3d673e9768464 (3873 commits) x86_64 ghc-8.8.3
2020-04-14 08:27:07.222829025 [ThreadId 34] - New cradle: /home/lyh970817/myp/Setup.hs
2020-04-14 08:27:07.223216675 [ThreadId 34] - Cabal-Helper decided to use: ProjLocStackYaml {plStackYaml = "/home/lyh970817/myp/stack.yaml"}
Using hoogle db at: /home/lyh970817/.hoogle/default-haskell-5.0.17.hoo
2020-04-14 08:27:08.624431659 [ThreadId 34] - Module "/home/lyh970817/myp/Setup.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/lyh970817/myp", cradleOptsProg = CradleAction: Other Stack}
2020-04-14 08:27:08.624497332 [ThreadId 34] - Found cradle: Cradle {cradleRootDir = "/home/lyh970817/myp", cradleOptsProg = CradleAction: Other Stack}
2020-04-14 08:27:09.056331445 [ThreadId 58] - Fail on cradle initialisation: (ExitFailure 2)["Could not obtain flags for: \"Setup.hs\".","","This module was not part of any component we are aware of.","","Component: ChLibName ChMainLibName with source directory: [\"src\"]","Component: ChExeName \"myp-exe\" with source directory: [\"app\"]","","","To expose a module, refer to:","https://docs.haskellstack.org/en/stable/GUIDE/","If you are using `package.yaml` then you don't have to manually expose modules.","Maybe you didn't set the source directories for your project correctly."]
2020-04-14 08:27:09.056507995 [ThreadId 34] - ghcDispatcher:Got error for a request: IdeError {ideCode = OtherError, ideMessage = "Fail on initialisation for \"/home/lyh970817/myp/Setup.hs\". Could not obtain flags for: \"Setup.hs\".", ideInfo = Null} with mid: Nothing
2020-04-14 08:27:09.056590428 [ThreadId 34] - New cradle: /home/lyh970817/myp/Setup.hs
2020-04-14 08:27:09.05694471 [ThreadId 34] - Cabal-Helper decided to use: ProjLocStackYaml {plStackYaml = "/home/lyh970817/myp/stack.yaml"}
2020-04-14 08:27:10.49384344 [ThreadId 34] - Module "/home/lyh970817/myp/Setup.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/lyh970817/myp", cradleOptsProg = CradleAction: Other Stack}
2020-04-14 08:27:10.493913638 [ThreadId 34] - Found cradle: Cradle {cradleRootDir = "/home/lyh970817/myp", cradleOptsProg = CradleAction: Other Stack}
2020-04-14 08:27:10.925542302 [ThreadId 80] - Fail on cradle initialisation: (ExitFailure 2)["Could not obtain flags for: \"Setup.hs\".","","This module was not part of any component we are aware of.","","Component: ChLibName ChMainLibName with source directory: [\"src\"]","Component: ChExeName \"myp-exe\" with source directory: [\"app\"]","","","To expose a module, refer to:","https://docs.haskellstack.org/en/stable/GUIDE/","If you are using `package.yaml` then you don't have to manually expose modules.","Maybe you didn't set the source directories for your project correctly."]
2020-04-14 08:27:10.925763731 [ThreadId 34] - ghcDispatcher:Got error for a request: IdeError {ideCode = OtherError, ideMessage = "Fail on initialisation for \"/home/lyh970817/myp/Setup.hs\". Could not obtain flags for: \"Setup.hs\".", ideInfo = Null} with mid: Nothing
2020-04-14 08:27:11.291429928 [ThreadId 34] - New cradle: /home/lyh970817/myp/Setup.hs
2020-04-14 08:27:11.29180652 [ThreadId 34] - Cabal-Helper decided to use: ProjLocStackYaml {plStackYaml = "/home/lyh970817/myp/stack.yaml"}
2020-04-14 08:27:12.716777069 [ThreadId 34] - Module "/home/lyh970817/myp/Setup.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/lyh970817/myp", cradleOptsProg = CradleAction: Other Stack}
2020-04-14 08:27:12.716845418 [ThreadId 34] - Found cradle: Cradle {cradleRootDir = "/home/lyh970817/myp", cradleOptsProg = CradleAction: Other Stack}
2020-04-14 08:27:13.153104377 [ThreadId 102] - Fail on cradle initialisation: (ExitFailure 2)["Could not obtain flags for: \"Setup.hs\".","","This module was not part of any component we are aware of.","","Component: ChLibName ChMainLibName with source directory: [\"src\"]","Component: ChExeName \"myp-exe\" with source directory: [\"app\"]","","","To expose a module, refer to:","https://docs.haskellstack.org/en/stable/GUIDE/","If you are using `package.yaml` then you don't have to manually expose modules.","Maybe you didn't set the source directories for your project correctly."]
2020-04-14 08:27:13.153349196 [ThreadId 34] - ghcDispatcher:Got error for a request: IdeError {ideCode = OtherError, ideMessage = "Fail on initialisation for \"/home/lyh970817/myp/Setup.hs\". Could not obtain flags for: \"Setup.hs\".", ideInfo = Null} with mid: Nothing
2020-04-14 08:27:13.153428155 [ThreadId 34] - New cradle: /home/lyh970817/myp/Setup.hs
2020-04-14 08:27:13.15370313 [ThreadId 34] - Cabal-Helper decided to use: ProjLocStackYaml {plStackYaml = "/home/lyh970817/myp/stack.yaml"}
2020-04-14 08:27:14.577241037 [ThreadId 34] - Module "/home/lyh970817/myp/Setup.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/lyh970817/myp", cradleOptsProg = CradleAction: Other Stack}
2020-04-14 08:27:14.577303015 [ThreadId 34] - Found cradle: Cradle {cradleRootDir = "/home/lyh970817/myp", cradleOptsProg = CradleAction: Other Stack}
2020-04-14 08:27:15.002229841 [ThreadId 125] - Fail on cradle initialisation: (ExitFailure 2)["Could not obtain flags for: \"Setup.hs\".","","This module was not part of any component we are aware of.","","Component: ChLibName ChMainLibName with source directory: [\"src\"]","Component: ChExeName \"myp-exe\" with source directory: [\"app\"]","","","To expose a module, refer to:","https://docs.haskellstack.org/en/stable/GUIDE/","If you are using `package.yaml` then you don't have to manually expose modules.","Maybe you didn't set the source directories for your project correctly."]
2020-04-14 08:27:15.002463364 [ThreadId 34] - ghcDispatcher:Got error for a request: IdeError {ideCode = OtherError, ideMessage = "Fail on initialisation for \"/home/lyh970817/myp/Setup.hs\". Could not obtain flags for: \"Setup.hs\".", ideInfo = Null} with mid: Nothing
2020-04-14 08:27:15.002540018 [ThreadId 34] - New cradle: /home/lyh970817/myp/Setup.hs
2020-04-14 08:27:15.002806916 [ThreadId 34] - Cabal-Helper decided to use: ProjLocStackYaml {plStackYaml = "/home/lyh970817/myp/stack.yaml"}
2020-04-14 08:27:16.399185114 [ThreadId 34] - Module "/home/lyh970817/myp/Setup.hs" is loaded by Cradle: Cradle {cradleRootDir = "/home/lyh970817/myp", cradleOptsProg = CradleAction: Other Stack}
2020-04-14 08:27:16.399248852 [ThreadId 34] - Found cradle: Cradle {cradleRootDir = "/home/lyh970817/myp", cradleOptsProg = CradleAction: Other Stack}
2020-04-14 08:27:16.826857977 [ThreadId 147] - Fail on cradle initialisation: (ExitFailure 2)["Could not obtain flags for: \"Setup.hs\".","","This module was not part of any component we are aware of.","","Component: ChLibName ChMainLibName with source directory: [\"src\"]","Component: ChExeName \"myp-exe\" with source directory: [\"app\"]","","","To expose a module, refer to:","https://docs.haskellstack.org/en/stable/GUIDE/","If you are using `package.yaml` then you don't have to manually expose modules.","Maybe you didn't set the source directories for your project correctly."]
2020-04-14 08:27:16.827086349 [ThreadId 34] - ghcDispatcher:Got error for a request: IdeError {ideCode = OtherError, ideMessage = "Fail on initialisation for \"/home/lyh970817/myp/Setup.hs\". Could not obtain flags for: \"Setup.hs\".", ideInfo = Null} with mid: Nothing
By type diagnostics do you mean like when I try to sum ['a',2]
and it says I can't do that because 'a' is not Num?
Sorry I'm not sure what multi component is... But I have not applied any config so everything should be the default?
Opening setup.hs is not supported, so that is expected
Opening setup.hs is not supported, so that is expected
Thanks! I can see the documentation now if I go into app/Main.hs
. The debug info says cradle has been loaded successfully. I'm wondering if there is any way to make the documentation work globally not just inside projecs?
I'm wondering if there is any way to make the documentation work globally not just inside projecs?
I assume so, but currently it is only supported in projects.
I'm wondering if there is any way to make the documentation work globally not just inside projecs?
I assume so, but currently it is only supported in projects.
I see. Thanks so much!
The hover documentation doesn't seem to work on coc.vim (tested with
call CocAction('doHover')
when cursor is on a function likesum
). Everything else is working fine.call CocAction('doHover')
also works fine for other languages.