File tree Expand file tree Collapse file tree 14 files changed +179
-244
lines changed
ghcide/src/Development/IDE Expand file tree Collapse file tree 14 files changed +179
-244
lines changed Original file line number Diff line number Diff line change @@ -148,7 +148,7 @@ jobs:
148148 name : Test hls-pragmas-plugin
149149 run : cabal test hls-pragmas-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-pragmas-plugin --test-options="$TEST_OPTS"
150150
151- - if : matrix.test && matrix.ghc != '9.4.4'
151+ - if : matrix.test
152152 name : Test hls-eval-plugin
153153 run : cabal test hls-eval-plugin --test-options="$TEST_OPTS" || LSP_TEST_LOG_COLOR=0 LSP_TEST_LOG_MESSAGES=true LSP_TEST_LOG_STDERR=true cabal test hls-eval-plugin --test-options="$TEST_OPTS"
154154
Original file line number Diff line number Diff line change 208208 - name : " GHC.Arr.!"
209209 within : []
210210
211+ # We do not want to use functions from the
212+ # GHC driver. Instead use hls rules to construct
213+ # an appropriate GHC session
214+ - name : " load"
215+ within : []
216+ - name : " load'"
217+ within : []
218+ - name : " loadWithCache"
219+ within : []
220+
211221 # Tracing functions
212222 # We ban an explicit list rather than the
213223 # Debug.Trace, because that module also
Original file line number Diff line number Diff line change @@ -1008,28 +1008,6 @@ handleGenerationErrors' dflags source action =
10081008 . ((" Error during " ++ T. unpack source) ++ ) . show @ SomeException
10091009 ]
10101010
1011- -- | Load modules, quickly. Input doesn't need to be desugared.
1012- -- A module must be loaded before dependent modules can be typechecked.
1013- -- This variant of loadModuleHome will *never* cause recompilation, it just
1014- -- modifies the session.
1015- -- The order modules are loaded is important when there are hs-boot files.
1016- -- In particular you should make sure to load the .hs version of a file after the
1017- -- .hs-boot version.
1018- loadModulesHome
1019- :: [HomeModInfo ]
1020- -> HscEnv
1021- -> HscEnv
1022- loadModulesHome mod_infos e =
1023- #if MIN_VERSION_ghc(9,3,0)
1024- hscUpdateHUG (\ hug -> foldl' (flip addHomeModInfoToHug) hug mod_infos) (e { hsc_type_env_vars = emptyKnotVars })
1025- #else
1026- let ! new_modules = addListToHpt (hsc_HPT e) [(mod_name x, x) | x <- mod_infos]
1027- in e { hsc_HPT = new_modules
1028- , hsc_type_env_var = Nothing
1029- }
1030- where
1031- mod_name = moduleName . mi_module . hm_iface
1032- #endif
10331011
10341012-- Merge the HPTs, module graphs and FinderCaches
10351013-- See Note [GhcSessionDeps] in Development.IDE.Core.Rules
Original file line number Diff line number Diff line change @@ -57,6 +57,7 @@ module Development.IDE.Core.Rules(
5757 typeCheckRuleDefinition ,
5858 getRebuildCount ,
5959 getSourceFileSource ,
60+ currentLinkables ,
6061 GhcSessionDepsConfig (.. ),
6162 Log (.. ),
6263 DisplayTHWarning (.. ),
Original file line number Diff line number Diff line change @@ -104,6 +104,7 @@ module Development.IDE.GHC.Compat(
104104 icInteractiveModule ,
105105 HomePackageTable ,
106106 lookupHpt ,
107+ loadModulesHome ,
107108#if MIN_VERSION_ghc(9,3,0)
108109 Dependencies (dep_direct_mods ),
109110#else
@@ -653,3 +654,26 @@ combineRealSrcSpans span1 span2
653654 (srcSpanEndLine span2, srcSpanEndCol span2)
654655 file = srcSpanFile span1
655656#endif
657+
658+ -- | Load modules, quickly. Input doesn't need to be desugared.
659+ -- A module must be loaded before dependent modules can be typechecked.
660+ -- This variant of loadModuleHome will *never* cause recompilation, it just
661+ -- modifies the session.
662+ -- The order modules are loaded is important when there are hs-boot files.
663+ -- In particular you should make sure to load the .hs version of a file after the
664+ -- .hs-boot version.
665+ loadModulesHome
666+ :: [HomeModInfo ]
667+ -> HscEnv
668+ -> HscEnv
669+ loadModulesHome mod_infos e =
670+ #if MIN_VERSION_ghc(9,3,0)
671+ hscUpdateHUG (\ hug -> foldl' (flip addHomeModInfoToHug) hug mod_infos) (e { hsc_type_env_vars = emptyKnotVars })
672+ #else
673+ let ! new_modules = addListToHpt (hsc_HPT e) [(mod_name x, x) | x <- mod_infos]
674+ in e { hsc_HPT = new_modules
675+ , hsc_type_env_var = Nothing
676+ }
677+ where
678+ mod_name = moduleName . mi_module . hm_iface
679+ #endif
Original file line number Diff line number Diff line change @@ -874,7 +874,7 @@ pattern ExposePackage s a mr = DynFlags.ExposePackage s a mr
874874pattern FunTy :: Type -> Type -> Type
875875pattern FunTy arg res <- TyCoRep. FunTy {ft_arg = arg, ft_res = res}
876876
877- #if MIN_VERSION_ghc(9,0 ,0)
877+ #if MIN_VERSION_ghc(8,10 ,0)
878878-- type HasSrcSpan x a = (GenLocated SrcSpan a ~ x)
879879-- type HasSrcSpan x = () :: Constraint
880880
Original file line number Diff line number Diff line change @@ -20,6 +20,13 @@ module Development.IDE.GHC.Compat.Outputable (
2020#if MIN_VERSION_ghc(9,3,0)
2121 DiagnosticReason (.. ),
2222 renderDiagnosticMessageWithHints ,
23+ pprMsgEnvelopeBagWithLoc ,
24+ Error. getMessages ,
25+ renderWithContext ,
26+ defaultSDocContext ,
27+ errMsgDiagnostic ,
28+ unDecorated ,
29+ diagnosticMessage ,
2330#else
2431 pprWarning ,
2532 pprError ,
@@ -29,6 +36,7 @@ module Development.IDE.GHC.Compat.Outputable (
2936 MsgEnvelope ,
3037 ErrMsg ,
3138 WarnMsg ,
39+ SourceError (.. ),
3240 errMsgSpan ,
3341 errMsgSeverity ,
3442 formatErrorWithQual ,
Original file line number Diff line number Diff line change @@ -24,9 +24,7 @@ module Development.IDE.GHC.Compat.Util (
2424 LBooleanFormula ,
2525 BooleanFormula (.. ),
2626 -- * OverridingBool
27- #if !MIN_VERSION_ghc(9,3,0)
2827 OverridingBool (.. ),
29- #endif
3028 -- * Maybes
3129 MaybeErr (.. ),
3230 orElse ,
@@ -104,6 +102,11 @@ import Unique
104102import Util
105103#endif
106104
105+ #if MIN_VERSION_ghc(9,3,0)
106+ import GHC.Data.Bool
107+ #endif
108+
109+
107110#if !MIN_VERSION_ghc(9,0,0)
108111type MonadCatch = Exception. ExceptionMonad
109112
Original file line number Diff line number Diff line change @@ -237,7 +237,7 @@ common haddockComments
237237 cpp-options : -Dhls_haddockComments
238238
239239common eval
240- if flag(eval) && (impl(ghc < 9.4.1 ) || flag(ignore-plugins-ghc-bounds))
240+ if flag(eval)
241241 build-depends : hls-eval-plugin ^>= 1.4
242242 cpp-options : -Dhls_eval
243243
Original file line number Diff line number Diff line change @@ -37,10 +37,6 @@ source-repository head
3737 location : https://github.com/haskell/haskell-language-server
3838
3939library
40- if impl(ghc >= 9.3 )
41- buildable : False
42- else
43- buildable : True
4440 exposed-modules :
4541 Ide.Plugin.Eval
4642 Ide.Plugin.Eval.Types
@@ -101,10 +97,6 @@ library
10197 TypeOperators
10298
10399test-suite tests
104- if impl(ghc >= 9.3 )
105- buildable : False
106- else
107- buildable : True
108100 type : exitcode-stdio-1.0
109101 default-language : Haskell2010
110102 hs-source-dirs : test
You can’t perform that action at this time.
0 commit comments