Skip to content

haddock/hscolour: fix highlighted source location #3452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 24, 2016

Conversation

bennofs
Copy link
Collaborator

@bennofs bennofs commented May 21, 2016

When generating haddocks with the --for-hackage switch, the generated
haddocks are placed in a different directory than the normal ones, which
includes the package id instead of just the package name. When we ran
hscolour, we didn't respect this, so the highlighted source would not
be placed in the correct directory and thus was missing from the tarball.
This patch fixes that.

Fixes #3451

@bennofs
Copy link
Collaborator Author

bennofs commented May 21, 2016

Oops, seems like this still has a small bug. Please don't merge yet.

@bennofs
Copy link
Collaborator Author

bennofs commented May 21, 2016

Fixed, should be ready to merge now.

@23Skidoo
Copy link
Member

@bennofs Apparently, this breaks the test suite. Can you look into that?

@@ -48,12 +49,18 @@ import System.FilePath ((</>), (<.>))
srcPref :: FilePath -> FilePath
srcPref distPref = distPref </> "src"

hscolourPref :: FilePath -> PackageDescription -> FilePath
data PathMode = ForDistribution | ForDevelopment
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs a Haddock comment.

@23Skidoo
Copy link
Member

If ForDistribution only gets set when --for-hackage is enabled, why not call it ForHackage? And then maybe we can change the type of haddockForHackage to Flag DistributionMode and perhaps also rename it to haddockDistributionMode.

@bennofs
Copy link
Collaborator Author

bennofs commented May 22, 2016

Alright, that is a good idea. I'll do that.

bennofs added 2 commits May 24, 2016 14:46
When generating haddocks with the `--for-hackage` switch, the generated
haddocks are placed in a different directory than the normal ones, which
includes the package id instead of just the package name. When we ran
hscolour, we didn't respect this, so the highlighted source would not
be placed in the correct directory and thus was missing from the tarball.
This patch fixes that.

Fixes haskell#3451
@bennofs
Copy link
Collaborator Author

bennofs commented May 24, 2016

Finally got around to finish this up. Should be ready now.

@23Skidoo 23Skidoo merged commit 9d0c0c0 into haskell:master May 24, 2016
@23Skidoo
Copy link
Member

Merged, thanks!

23Skidoo added a commit that referenced this pull request Oct 8, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

cabal haddock --for-hackage missing pretty-printed source-code
2 participants