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
2525#else
2626import Name
2727#endif
28+ import Development.IDE.GHC.ExactPrint (GetAnnotatedParsedSource (GetAnnotatedParsedSource ))
2829import HieDb.Query
2930import Ide.Plugin.Config
3031import Ide.PluginUtils
@@ -67,14 +68,14 @@ getSrcEdits ::
6768getSrcEdits state updateMod uri = do
6869 ccs <- lift getClientCapabilities
6970 nfp <- safeUriToNfp uri
70- ~ ParsedModule {pm_parsed_source = ps, pm_annotations = apiAnns} <-
71+ annotatedAst <-
7172 handleMaybeM " Error: could not get parsed source" $ liftIO $ runAction
7273 " Rename.GetParsedModuleWithComments"
7374 state
74- (use GetParsedModuleWithComments nfp)
75+ (use GetAnnotatedParsedSource nfp)
76+ let (ps, apiAnns) = (astA annotatedAst, annsA annotatedAst)
7577#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
7879 res = T. pack $ exactPrint (updateMod <$> ps) anns
7980#else
8081 let src = T. pack $ exactPrint ps
You can’t perform that action at this time.
0 commit comments