-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add non-backwards compatible support for ghc-9.0.1 * Make changes backwards-compatible * Fix warnings and tests * Restore accidentally deleted project file * Link the versions needed to build on ghc-9.0.1 in cabal.project * Add ghc-9.0.1 to github actions * Regenerate haskell-ci from cabal.project
- Loading branch information
Showing
11 changed files
with
228 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,16 @@ | ||
packages: . | ||
packages: . | ||
-- package hiedb | ||
-- ghc-options: -fwrite-ide-info -hiedir /home/zubin/hiedb/.hie/ | ||
|
||
|
||
source-repository-package | ||
type: git | ||
location: https://github.com/jwaldmann/blaze-textual.git | ||
tag: d8ee6cf80e27f9619d621c936bb4bda4b99a183f | ||
-- https://github.com/jwaldmann/blaze-textual/commit/d8ee6cf80e27f9619d621c936bb4bda4b99a183f | ||
-- https://github.com/bos/blaze-textual/issues/13 | ||
|
||
source-repository-package | ||
type: git | ||
location: https://github.com/hsyl20/ghc-api-compat | ||
tag: 6178d75772c7d923918dfffa0b1f503dfb36d0a6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
|
||
{-# LANGUAGE CPP #-} | ||
module HieDb.Compat ( | ||
nodeInfo' | ||
, Unit | ||
, unitString | ||
, stringToUnit | ||
, moduleUnit | ||
, unhelpfulSpanFS | ||
|
||
) where | ||
|
||
import Compat.HieTypes | ||
|
||
import Module | ||
|
||
#if __GLASGOW_HASKELL__ >= 900 | ||
import GHC.Types.SrcLoc | ||
import Compat.HieUtils | ||
|
||
import qualified Data.Map as M | ||
import qualified Data.Set as S | ||
|
||
|
||
-- nodeInfo' :: Ord a => HieAST a -> NodeInfo a | ||
nodeInfo' :: HieAST TypeIndex -> NodeInfo TypeIndex | ||
nodeInfo' = M.foldl' combineNodeInfo' emptyNodeInfo . getSourcedNodeInfo . sourcedNodeInfo | ||
|
||
combineNodeInfo' :: Ord a => NodeInfo a -> NodeInfo a -> NodeInfo a | ||
(NodeInfo as ai ad) `combineNodeInfo'` (NodeInfo bs bi bd) = | ||
NodeInfo (S.union as bs) (mergeSorted ai bi) (M.unionWith (<>) ad bd) | ||
where | ||
mergeSorted :: Ord a => [a] -> [a] -> [a] | ||
mergeSorted la@(a:as) lb@(b:bs) = case compare a b of | ||
LT -> a : mergeSorted as lb | ||
EQ -> a : mergeSorted as bs | ||
GT -> b : mergeSorted la bs | ||
mergeSorted as [] = as | ||
mergeSorted [] bs = bs | ||
#else | ||
import qualified FastString as FS | ||
|
||
nodeInfo' :: HieAST TypeIndex -> NodeInfo TypeIndex | ||
nodeInfo' = nodeInfo | ||
type Unit = UnitId | ||
unitString :: Unit -> String | ||
unitString = unitIdString | ||
stringToUnit :: String -> Unit | ||
stringToUnit = stringToUnitId | ||
moduleUnit :: Module -> Unit | ||
moduleUnit = moduleUnitId | ||
unhelpfulSpanFS :: FS.FastString -> FS.FastString | ||
unhelpfulSpanFS = id | ||
#endif | ||
|
||
#if __GLASGOW_HASKELL__ >= 900 | ||
#else | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.