File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
plugins/hls-rename-plugin/src/Ide/Plugin Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import GHC.Types.Name
25
25
#else
26
26
import Name
27
27
#endif
28
+ import Development.IDE.GHC.ExactPrint (GetAnnotatedParsedSource (GetAnnotatedParsedSource ))
28
29
import HieDb.Query
29
30
import Ide.Plugin.Config
30
31
import Ide.PluginUtils
@@ -67,14 +68,14 @@ getSrcEdits ::
67
68
getSrcEdits state updateMod uri = do
68
69
ccs <- lift getClientCapabilities
69
70
nfp <- safeUriToNfp uri
70
- ~ ParsedModule {pm_parsed_source = ps, pm_annotations = apiAnns} <-
71
+ annotatedAst <-
71
72
handleMaybeM " Error: could not get parsed source" $ liftIO $ runAction
72
73
" Rename.GetParsedModuleWithComments"
73
74
state
74
- (use GetParsedModuleWithComments nfp)
75
+ (use GetAnnotatedParsedSource nfp)
76
+ let (ps, apiAnns) = (astA annotatedAst, annsA annotatedAst)
75
77
#if !MIN_VERSION_ghc(9,2,1)
76
- let anns = relativiseApiAnns ps apiAnns
77
- src = T. pack $ exactPrint ps anns
78
+ let src = T. pack $ exactPrint ps anns
78
79
res = T. pack $ exactPrint (updateMod <$> ps) anns
79
80
#else
80
81
let src = T. pack $ exactPrint ps
You can’t perform that action at this time.
0 commit comments