haskell / haskell/cabal

Unifying the various documentation flags under the `documentation:` stanza

Open
#9,979 3 comments 1 reaction 0 assignees View on GitHub
Dominant language
Haskell
Stars
1.7k
Forks
750
Avg merge
4d 3h
Merged PRs (30d)
28

Description

(_Please read https://github.com/haskell/haskell-language-server/issues/4210 first_)

There seems to be a fragmentation of the various ways to generate Haddocks on a cabal project, and this confuses end-users.

The most ergonomic option, setting `documentation: True` in one's cabal.project file, is actually not going all the way through, which is quite surprising:

> documentation: true does not imply haddock-all, haddock-benchmarks, haddock-executables, haddock-internal or haddock-tests. These need to be enabled separately if desired.

– https://cabal.readthedocs.io/en/stable/cabal-project-description-file.html#cfg-field-documentation

And according to the ticket linked above, it doesn't pass the `-haddock` option to GHC, which is what HLS needs for proper displaying of the documentation through LSP.

1. Is there a reason about the aforementioned caveat of `documentation:`?
2. I think we should probably pass `-haddock` to GHC when `documentation:` is set to True. Any issue one can see with this?

Contributor guide

Open the contributing guide

Research direction

Read the linked HLS issue #4210 first, then review the Cabal project description documentation for the `documentation:` stanza and its related Haddock flags. The issue does not name repository files or tests; the work is done only after the intended flag behavior and GHC integration are agreed and verified.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
build-system
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.