where to go for HLS details?

Where is the place to go to talk details of the Haskell Language Server? I'm using the HLS with the GHC I have compiled from HEAD, and I am sitting on a number of difficulties: - When a project is compiled against a Stage 1 `base` library (as opposed to the one shipped with the bootstrap compiler), I am not always getting the documentation I expect. - The HLint part of the HLS seems to struggle finding modules in nested directories. - I cannot seem to get the `hiedb` command to index any files. - I'd like to set up the HLS to get to documentation via an HTTP-ish URL rather than the file:// URL that it is currently using, so that `doc-index.json` can be loaded successfully. I'm not quite ready to open a Github issue for any of these troubles just yet, but I'm not sure I can make progress on my own. Where is a good place to go for help? Norman

In general #haskell-language-server on libera is a good place to ask these questions.
- When a project is compiled against a Stage 1 `base` library (as opposed to the one shipped with the bootstrap compiler), I am not always getting the documentation I expect.
Are you getting any documentation at all, or none? If your GHC is built with hadrian, there is currently a bug (#20427) which means that the location of the haddock interfaces and html files is not correct in the package configuration. It will be fixed by !6295 (in particular https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6295/diffs?commit_id=737...) Also how are you setting your project up to use the stage 1 base library? Do you have a specially configured .hie-bios file?
- I cannot seem to get the `hiedb` command to index any files.
Ah, I see nr (I'm assuming you) asked a similar question on the IRC channel. Unfortunately I did not wake up in time to be able to answer before you left. The `hiedb` subcommand is more of a low level interface to access the guts of the database, and as such directly passes on the remaing arguments to `hiedb`, without co-operating with `haskell-language-server` very much beyond figuring out the location of the database. As such, it has no idea where the build products of files are located and can only index already generated .hie files. So to index using that command, you would have to point it at a directory containing `.hie` files. `haskell-language-server` usually puts its hie files under a project specific subdirectory of $XDG_CACHE_DIR/ghcide. For example, this works when I'm using HLS on ghc: haskell-language-server hiedb index ~/.cache/ghc-$HASH/ then to verify you can use haskell-language-server hiedb ls ~/.cache/ghc-$HASH/
- I'd like to set up the HLS to get to documentation via an HTTP-ish URL rather than the file:// URL that it is currently using, so that `doc-index.json` can be loaded successfully.
I don't think this is currently possible without modifications to HLS. HLS uses the `haddock-html:` field of the package configuration to locate rendered haddock pages. Feel free to ask in case you have any other questions. I don't really know about the HLint one. Cheers, Zubin.

In general #haskell-language-server on libera is a good place to ask these questions.
Can you recommend an IRC client? I tried using the web-based client, got limited response, and then the client destroyed all history. --------
- When a project is compiled against a Stage 1 `base` library (as opposed to the one shipped with the bootstrap compiler), I am not always getting the documentation I expect.
Are you getting any documentation at all, or none? If your GHC is built with hadrian, there is currently a bug (#20427) which means that the location of the haddock interfaces and html files is not correct in the package configuration. It will be fixed by !6295 (in particular https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6295/diffs?commit_id=737...)
I applied the patch, removed _build/docs, and rebuilt the documentation via `./hadrian/build -j _build/docs/html/libraries/index.html`. I then restarted the HLS. Unfortunately, that change did not resolve the difficulty. As an example, the documentation for `putStrLn` reads as follows: ``` putStrLn :: String -> IO () Defined in ‘System.IO’ (base-4.15.0.0) ``` but the documentation I am hoping for (and that I get using the base library installed by `ghcup`) is ``` putStrLn :: String -> IO () Defined in ‘System.IO’ (base-4.15.0.0) The same as putStr , but adds a newline character. Documentation Source ```` The `Documentation` and `Source` strings are links; I am viewing using Emacs lsp-ui-doc. --------
Also how are you setting your project up to use the stage 1 base library?
Whoops! I meant stage 0 (so the things can be swallowed by the bootstrap compiler). It is with this `hie.yaml` file: ``` cradle: direct: arguments: ["-package-env", "-", "-clear-package-db", "-package-db", "/home/nr/asterius/ghc/_build/stage0/lib/package.conf.d", "-package-id", "ghc-9.3"] ``` Once I get everything sorted, I will add something to the GHC Wiki somewhere explaining how this works. --------
- I cannot seem to get the `hiedb` command to index any files.
Ah, I see nr (I'm assuming you) asked a similar question
Yes!
So to index using that command, you would have to point it at a directory containing `.hie` files.
Perfect. I had a go at this, and I made some progress. Thanks!
- I'd like to set up the HLS to get to documentation via an HTTP-ish URL rather than the file:// URL that it is currently using, so that `doc-index.json` can be loaded successfully.
I don't think this is currently possible without modifications to HLS. HLS uses the `haddock-html:` field of the package configuration to locate rendered haddock pages.
Where can I find this configuration for GHC and it's accompanying packages `base` and `ghc`? I tried grepping for "haddock-html" in all the .cabal files in the GHC tree, but the only hits were in `libraries/Cabal/Cabal-tests/tests/ParserTests`, which suggests that I'm looking in the wrong place. Norman

For what it's worth, I use hexchat. You may prefer to use IRC via matrix,
though.
On Tue, Oct 12, 2021 at 2:22 PM Norman Ramsey
In general #haskell-language-server on libera is a good place to ask these questions.
Can you recommend an IRC client? I tried using the web-based client, got limited response, and then the client destroyed all history.
-- brandon s allbery kf8nh allbery.b@gmail.com

Norman Ramsey
In general #haskell-language-server on libera is a good place to ask these questions.
Can you recommend an IRC client? I tried using the web-based client, got limited response, and then the client destroyed all history.
I also use Hexchat although I have considered moving to Matrix [1]. You might consider joining via the Matrix bridge using the element.io [2] web-based client (just join `#ghc:libera.chat`). I suspect this is the lowest-friction option. Cheers, - Ben [1] https://matrix.org/ [2] https://element.io/get-started

Can you recommend an IRC client? I tried using the web-based client, got limited response, and then the client destroyed all history.
I hear Matrix is a reasonable way to have a persistent connection these days.
I applied the patch, removed _build/docs, and rebuilt the documentation via `./hadrian/build -j _build/docs/html/libraries/index.html`. I then restarted the HLS. Unfortunately, that change did not resolve the difficulty. As an example, the documentation for `putStrLn` reads as follows:
The bug affects GHC 9.0.1 (which I'm assuming is your boot compiler given the appearance of base-4.15.0.0). The patch hasn't been backported yet, so it would need to be applied to the ghc-9.0 tree and you would need to use that as your boot compiler if this is indeed the problem. The docs you built using the hadrian invokation are for `base-4.16.0.0` or the boot libaries for the stage2 compiler (which lives in _build/stage1). You can check that this is indeed the problem by running $ ghc-pkg -f _build/stage0/lib/package.conf.d describe base or $ ghc-pkg -f _build/stage0/lib/package.conf.d field base haddock-html You could also inspect `_build/stage0/lib/package.conf.d/base-*.conf` The 'haddock-html` field should point to a directory with all the rendered haddock HTML pages.
participants (4)
-
Ben Gamari
-
Brandon Allbery
-
Norman Ramsey
-
Zubin Duggal