where to go for HLS details?

Norman Ramsey nr at cs.tufts.edu
Tue Oct 12 18:21:24 UTC 2021


 > 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=73799ad32b6009ffc50049e80b1276a306818ad3)

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


More information about the ghc-devs mailing list