Skip to content
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

re-enable haddock #3015

Merged
merged 3 commits into from
Jul 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ optional-packages: vendored/*/*.cabal
tests: true

package *
-- ghc 8.10 cannot build ghc-lib 9.2 with --haddock
-- ghc-options: -haddock
ghc-options: -haddock
test-show-details: direct

write-ghc-environment-files: never
Expand Down
6 changes: 0 additions & 6 deletions plugins/hls-hlint-plugin/hls-hlint-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ flag pedantic
default: False
manual: True

flag ghc-lib
default: True
manual: True
description: Use ghc-lib types (requires hlint to be built with ghc-lib)

library
exposed-modules: Ide.Plugin.Hlint
hs-source-dirs: src
Expand Down Expand Up @@ -61,7 +56,6 @@ library
, transformers
, unordered-containers
, apply-refact >=0.9.0.0
, ghc-lib
, ghc-lib-parser
, ghc-lib-parser-ex

Expand Down
31 changes: 17 additions & 14 deletions plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE FlexibleInstances #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedLabels #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE PatternSynonyms #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TupleSections #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE ViewPatterns #-}
{-# LANGUAGE LambdaCase #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}

{-# OPTIONS_GHC -Wno-orphans #-}

#ifdef HLINT_ON_GHC_LIB
#define MIN_GHC_API_VERSION(x,y,z) MIN_VERSION_ghc_lib(x,y,z)
#define MIN_GHC_API_VERSION(x,y,z) MIN_VERSION_ghc_lib_parser(x,y,z)
#else
#define MIN_GHC_API_VERSION(x,y,z) MIN_VERSION_ghc(x,y,z)
#endif
Expand All @@ -44,8 +44,8 @@ import Data.Aeson.Types (FromJSON (.
Value (..))
import qualified Data.ByteString as BS
import Data.Default
import qualified Data.HashMap.Strict as Map
import Data.Hashable
import qualified Data.HashMap.Strict as Map
import Data.Maybe
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
Expand All @@ -67,13 +67,15 @@ import Development.IDE.GHC.Compat (DynFlags,
topDir,
wopt)
import qualified Development.IDE.GHC.Compat.Util as EnumSet
import "ghc-lib" GHC hiding
(DynFlags (..),
RealSrcSpan,
ms_hspp_opts)
import qualified "ghc-lib" GHC

#if MIN_GHC_API_VERSION(9,0,0)
import "ghc-lib-parser" GHC.Types.SrcLoc (BufSpan)
import "ghc-lib-parser" GHC.Types.SrcLoc hiding
(RealSrcSpan)
import qualified "ghc-lib-parser" GHC.Types.SrcLoc as GHC
#else
import "ghc-lib-parser" SrcLoc hiding
(RealSrcSpan)
import qualified "ghc-lib-parser" SrcLoc as GHC
#endif
import "ghc-lib-parser" GHC.LanguageExtensions (Extension)
import Language.Haskell.GhclibParserEx.GHC.Driver.Session as GhclibParserEx (readExtension)
Expand All @@ -89,7 +91,8 @@ import System.IO (IOMode (Wri
import System.IO.Temp
#else
import Development.IDE.GHC.Compat hiding
(setEnv, (<+>))
(setEnv,
(<+>))
import GHC.Generics (Associativity (LeftAssociative, NotAssociative, RightAssociative))
#if MIN_GHC_API_VERSION(9,2,0)
import Language.Haskell.GHC.ExactPrint.ExactPrint (deltaOptions)
Expand Down