File tree Expand file tree Collapse file tree 3 files changed +7
-14
lines changed
ghcide/src/Development/IDE
plugins/hls-eval-plugin/src/Ide/Plugin/Eval Expand file tree Collapse file tree 3 files changed +7
-14
lines changed Original file line number Diff line number Diff line change @@ -881,12 +881,7 @@ parseFileContents env customPreprocessor filename ms = do
881
881
PFailedWithErrorMessages msgs -> throwE $ diagFromErrMsgs " parser" dflags $ msgs dflags
882
882
POk pst rdr_module ->
883
883
let
884
- #if MIN_VERSION_ghc(9,2,1)
885
- -- TODO: we need to export the annotations here
886
- hpm_annotations = ()
887
- #else
888
884
hpm_annotations = mkApiAnns pst
889
- #endif
890
885
(warns, errs) = getMessages' pst dflags
891
886
in
892
887
do
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ module Development.IDE.GHC.Compat.Parser (
41
41
#if !MIN_VERSION_ghc(9,2,0)
42
42
Anno. AnnotationComment (.. ),
43
43
#endif
44
+ pattern EpaLineComment ,
45
+ pattern EpaBlockComment
44
46
) where
45
47
46
48
#if MIN_VERSION_ghc(9,0,0)
@@ -163,3 +165,8 @@ mkApiAnns pst =
163
165
: annotations_comments pst))
164
166
#endif
165
167
#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
Original file line number Diff line number Diff line change @@ -104,21 +104,12 @@ evalParsedModuleRule = defineEarlyCutoff $ RuleNoDiagnostics $ \GetEvalComments
104
104
105
105
-- since Haddock parsing is unset explicitly in 'getParsedModuleWithComments',
106
106
-- we can concentrate on these two
107
- #if MIN_VERSION_ghc(9,2,0)
108
107
case bdy of
109
108
EpaLineComment cmt ->
110
109
mempty { lineComments = Map. singleton curRan (RawLineComment cmt) }
111
110
EpaBlockComment cmt ->
112
111
mempty { blockComments = Map. singleton curRan $ RawBlockComment cmt }
113
112
_ -> 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
122
113
_ -> mempty
123
114
)
124
115
$ apiAnnComments' pm
You can’t perform that action at this time.
0 commit comments