Skip to content

Commit d1dafb7

Browse files
committed
Refactor: move pragma to compat module
1 parent 06fcd81 commit d1dafb7

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -881,12 +881,7 @@ parseFileContents env customPreprocessor filename ms = do
881881
PFailedWithErrorMessages msgs -> throwE $ diagFromErrMsgs "parser" dflags $ msgs dflags
882882
POk pst rdr_module ->
883883
let
884-
#if MIN_VERSION_ghc(9,2,1)
885-
-- TODO: we need to export the annotations here
886-
hpm_annotations = ()
887-
#else
888884
hpm_annotations = mkApiAnns pst
889-
#endif
890885
(warns, errs) = getMessages' pst dflags
891886
in
892887
do

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ module Development.IDE.GHC.Compat.Parser (
4141
#if !MIN_VERSION_ghc(9,2,0)
4242
Anno.AnnotationComment(..),
4343
#endif
44+
pattern EpaLineComment,
45+
pattern EpaBlockComment
4446
) where
4547

4648
#if MIN_VERSION_ghc(9,0,0)
@@ -163,3 +165,8 @@ mkApiAnns pst =
163165
:annotations_comments pst))
164166
#endif
165167
#endif
168+
169+
#if !MIN_VERSION_ghc(9,2,0)
170+
pattern EpaLineComment a = Anno.AnnLineComment a
171+
pattern EpaBlockComment a = Anno.AnnBlockComment a
172+
#endif

plugins/hls-eval-plugin/src/Ide/Plugin/Eval/Rules.hs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,21 +104,12 @@ evalParsedModuleRule = defineEarlyCutoff $ RuleNoDiagnostics $ \GetEvalComments
104104

105105
-- since Haddock parsing is unset explicitly in 'getParsedModuleWithComments',
106106
-- we can concentrate on these two
107-
#if MIN_VERSION_ghc(9,2,0)
108107
case bdy of
109108
EpaLineComment cmt ->
110109
mempty { lineComments = Map.singleton curRan (RawLineComment cmt) }
111110
EpaBlockComment cmt ->
112111
mempty { blockComments = Map.singleton curRan $ RawBlockComment cmt }
113112
_ -> mempty
114-
#else
115-
case bdy of
116-
AnnLineComment cmt ->
117-
mempty { lineComments = Map.singleton curRan (RawLineComment cmt) }
118-
AnnBlockComment cmt ->
119-
mempty { blockComments = Map.singleton curRan $ RawBlockComment cmt }
120-
_ -> mempty
121-
#endif
122113
_ -> mempty
123114
)
124115
$ apiAnnComments' pm

0 commit comments

Comments
 (0)