Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 59b733f

Browse files
Remove hie-compat (#4613)
While removing references to GHC 9.4, I realized that some parts of HLS are referring to even older versions of GHC. For example, `hie-compat` is a compatibility library backporting support of Haskell IDE Engine (HIE) features to older versions of GHC. Since GHC 9.2, `hie-compat` only re-exported definitions already present in the `ghc` library, and so, is essentially obsolete. FYI: We still have `hie-compat` in the dependency graph, because some libraries (e.g., `hiedb`) are using it.
1 parent 748603e commit 59b733f

File tree

52 files changed

+111
-2514
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+111
-2514
lines changed

‎CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
/hls-graph @wz1000
55
/hls-plugin-api @michaelpj @fendor
66
/hls-test-utils @fendor
7-
/hie-compat @wz1000
87

98
# HLS main
109
/src @fendor

‎RELEASING.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
- [ ] bump package versions in all `*.cabal` files (same version as hls)
1010
- HLS uses lockstep versioning. The core packages and all plugins use the same version number, and only support exactly this version.
1111
- Exceptions:
12-
- `hie-compat` requires no automatic version bump.
1312
- `shake-bench` is an internal testing tool, not exposed to the outside world. Thus, no version bump required for releases.
1413
- For updating cabal files, the following script can be used:
1514
- ```sh

‎cabal.project

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
packages:
22
./
3-
./hie-compat
43
./shake-bench
54
./hls-graph
65
./ghcide

‎docs/contributing/contributing.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ pre-commit install
197197
#### Why are some components excluded from automatic formatting?
198198

199199
- `test/testdata` and `test/data` are excluded because we want to test formatting plugins.
200-
- `hie-compat` is excluded because we want to keep its code as close to GHC as possible.
201200

202201
## Plugin tutorial
203202

‎ghcide/ghcide.cabal

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ library
7474
, haddock-library >=1.8 && <1.12
7575
, hashable
7676
, hie-bios ^>=0.16.0
77-
, hie-compat ^>=0.3.0.0
7877
, hiedb ^>= 0.7.0.0
7978
, hls-graph == 2.11.0.0
8079
, hls-plugin-api == 2.11.0.0

‎ghcide/src/Development/IDE/Core/Actions.hs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import Development.IDE.Graph
2828
import qualified Development.IDE.Spans.AtPoint as AtPoint
2929
import Development.IDE.Types.HscEnvEq (hscEnv)
3030
import Development.IDE.Types.Location
31+
import GHC.Iface.Ext.Types (Identifier)
3132
import qualified HieDb
3233
import Language.LSP.Protocol.Types (DocumentHighlight (..),
3334
SymbolInformation (..),

‎ghcide/src/Development/IDE/Core/Compile.hs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ import qualified Data.Set as Set
109109
import qualified GHC as G
110110
import GHC.Core.Lint.Interactive
111111
import GHC.Driver.Config.CoreToStg.Prep
112+
import GHC.Iface.Ext.Types (HieASTs)
112113
import qualified GHC.Runtime.Loader as Loader
113114
import GHC.Tc.Gen.Splice
114115
import GHC.Types.Error
@@ -145,6 +146,7 @@ import Development.IDE.GHC.Compat hiding
145146
import qualified Data.List.NonEmpty as NE
146147
import Data.Time (getCurrentTime)
147148
import GHC.Driver.Env (hsc_all_home_unit_ids)
149+
import GHC.Iface.Ext.Types (NameEntityInfo)
148150
#endif
149151

150152
#if MIN_VERSION_ghc(9,12,0)

‎ghcide/src/Development/IDE/Core/RuleTypes.hs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ import Development.IDE.Import.DependencyInformation
3434
import Development.IDE.Types.HscEnvEq (HscEnvEq)
3535
import Development.IDE.Types.KnownTargets
3636
import GHC.Generics (Generic)
37+
import GHC.Iface.Ext.Types (HieASTs,
38+
TypeIndex)
39+
import GHC.Iface.Ext.Utils (RefMap)
3740

3841
import Data.ByteString (ByteString)
3942
import Data.Text.Utf16.Rope.Mixed (Rope)

‎ghcide/src/Development/IDE/Core/Rules.hs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ import Development.IDE.Types.HscEnvEq
138138
import Development.IDE.Types.Location
139139
import Development.IDE.Types.Options
140140
import qualified Development.IDE.Types.Shake as Shake
141+
import GHC.Iface.Ext.Types (HieASTs (..))
142+
import GHC.Iface.Ext.Utils (generateReferencesMap)
141143
import qualified GHC.LanguageExtensions as LangExt
142144
import HIE.Bios.Ghc.Gap (hostIsDynamic)
143145
import qualified HieDb
@@ -510,7 +512,7 @@ persistentHieFileRule recorder = addPersistentRule GetHieAst $ \file -> runMaybe
510512
(currentSource, ver) <- liftIO $ case M.lookup (filePathToUri' file) vfsData of
511513
Nothing -> (,Nothing) . T.decodeUtf8 <$> BS.readFile (fromNormalizedFilePath file)
512514
Just vf -> pure (virtualFileText vf, Just $ virtualFileVersion vf)
513-
let refmap = Compat.generateReferencesMap . Compat.getAsts . Compat.hie_asts $ res
515+
let refmap = generateReferencesMap . getAsts . Compat.hie_asts $ res
514516
del = deltaFromDiff (T.decodeUtf8 $ Compat.hie_hs_src res) currentSource
515517
pure (HAR (Compat.hie_module res) (Compat.hie_asts res) refmap mempty (HieFromDisk res),del,ver)
516518

@@ -538,8 +540,8 @@ getHieAstRuleDefinition f hsc tmr = do
538540
liftIO $ writeAndIndexHieFile hsc se modSummary f exports asts source
539541
_ -> pure []
540542

541-
let refmap = Compat.generateReferencesMap . Compat.getAsts <$> masts
542-
typemap = AtPoint.computeTypeReferences . Compat.getAsts <$> masts
543+
let refmap = generateReferencesMap . getAsts <$> masts
544+
typemap = AtPoint.computeTypeReferences . getAsts <$> masts
543545
pure (diags <> diagsWrite, HAR (ms_mod $ tmrModSummary tmr) <$> masts <*> refmap <*> typemap <*> pure HieFresh)
544546

545547
getImportMapRule :: Recorder (WithPriority Log) -> Rules ()

‎ghcide/src/Development/IDE/GHC/Compat.hs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ module Development.IDE.GHC.Compat(
4545
readHieFile,
4646
setHieDir,
4747
dontWriteHieFiles,
48-
module Compat.HieTypes,
49-
module Compat.HieUtils,
5048
-- * Compat modules
5149
module Development.IDE.GHC.Compat.Core,
5250
module Development.IDE.GHC.Compat.Env,
@@ -112,14 +110,8 @@ module Development.IDE.GHC.Compat(
112110
#if MIN_VERSION_ghc(9,7,0)
113111
tcInitTidyEnv,
114112
#endif
115-
) where
116113

117-
import Compat.HieAst (enrichHie)
118-
import Compat.HieBin
119-
import Compat.HieTypes hiding
120-
(nodeAnnotations)
121-
import qualified Compat.HieTypes as GHC (nodeAnnotations)
122-
import Compat.HieUtils
114+
) where
123115
import Control.Applicative ((<|>))
124116
import qualified Data.ByteString as BS
125117
import Data.Coerce (coerce)
@@ -146,12 +138,18 @@ import GHC.Core.Tidy (tidyExpr)
146138
import GHC.CoreToStg.Prep (corePrepPgm)
147139
import qualified GHC.CoreToStg.Prep as GHC
148140
import GHC.Driver.Hooks (hscCompileCoreExprHook)
141+
import GHC.Iface.Ext.Types hiding
142+
(nodeAnnotations)
143+
import qualified GHC.Iface.Ext.Types as GHC (nodeAnnotations)
144+
import GHC.Iface.Ext.Utils
149145

150146
import GHC.ByteCode.Asm (bcoFreeNames)
151147
import GHC.Core
152148
import GHC.Data.FastString
153149
import GHC.Data.StringBuffer
154150
import GHC.Driver.Session hiding (ExposePackage)
151+
import GHC.Iface.Ext.Ast (enrichHie)
152+
import GHC.Iface.Ext.Binary
155153
import GHC.Iface.Make (mkIfaceExports)
156154
import GHC.SysTools.Tasks (runPp, runUnlit)
157155
import GHC.Types.Annotations (AnnTarget (ModuleTarget),

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /