hls-retrie-plugin 2.4.0.0 → 2.5.0.0
raw patch · 2 files changed
+8/−33 lines, 2 filesdep ~ghcidedep ~hls-plugin-apidep ~hls-test-utils
Dependency ranges changed: ghcide, hls-plugin-api, hls-test-utils
Files
- hls-retrie-plugin.cabal +4/−4
- src/Ide/Plugin/Retrie.hs +4/−29
hls-retrie-plugin.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: hls-retrie-plugin-version: 2.4.0.0+version: 2.5.0.0 synopsis: Retrie integration plugin for Haskell Language Server description: Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>@@ -37,9 +37,9 @@ , directory , extra , ghc- , ghcide == 2.4.0.0+ , ghcide == 2.5.0.0 , hashable- , hls-plugin-api == 2.4.0.0+ , hls-plugin-api == 2.5.0.0 , hls-refactor-plugin , lens , lsp@@ -77,5 +77,5 @@ , hls-plugin-api , hls-refactor-plugin , hls-retrie-plugin- , hls-test-utils == 2.4.0.0+ , hls-test-utils == 2.5.0.0 , text
src/Ide/Plugin/Retrie.hs view
@@ -159,24 +159,17 @@ import GHC.Types.PkgQual #endif -#if MIN_VERSION_ghc(9,2,0)+import Control.Arrow ((&&&)) import Control.Exception (evaluate) import Data.Monoid (First (First))-import Retrie.ExactPrint (makeDeltaAst)-import Retrie.GHC (ann)-#else-import Data.Monoid (First (..))-import qualified GHC.Exts as Ext-import Retrie.AlphaEnv (extendAlphaEnv)-import Retrie.ExactPrint (relativiseApiAnns)-#endif-import Control.Arrow ((&&&)) import Development.IDE.Core.Actions (lookupMod) import Development.IDE.Core.PluginUtils import Development.IDE.Spans.AtPoint (LookupModule, getNamesAtPoint, nameToLocation) import Development.IDE.Types.Shake (WithHieDb)+import Retrie.ExactPrint (makeDeltaAst)+import Retrie.GHC (ann) descriptor :: PluginId -> PluginDescriptor IdeState descriptor plId =@@ -571,11 +564,7 @@ (theImports, theRewrites) = partitionEithers rewrites annotatedImports =-#if MIN_VERSION_ghc(9,2,0) unsafeMkA (map (noLocA . toImportDecl) theImports) 0-#else- unsafeMkA (map (noLocA . toImportDecl) theImports) mempty 0-#endif (originFixities, originParsedModule) <- reuseParsedModule state origin retrie <-@@ -630,13 +619,7 @@ return (fixities, res) fixAnns :: ParsedModule -> Annotated GHC.ParsedSource-#if MIN_VERSION_ghc(9,2,0) fixAnns GHC.ParsedModule{pm_parsed_source} = unsafeMkA (makeDeltaAst pm_parsed_source) 0-#else-fixAnns GHC.ParsedModule {..} =- let ranns = relativiseApiAnns pm_parsed_source pm_annotations- in unsafeMkA pm_parsed_source ranns 0-#endif parseSpecs :: IdeState@@ -646,14 +629,10 @@ -> [RewriteSpec] -> IO [Rewrite Universe] parseSpecs state origin originParsedModule originFixities specs = do-#if MIN_VERSION_ghc(9,2,0) -- retrie needs the libdir for `parseRewriteSpecs` libdir <- topDir . ms_hspp_opts . msrModSummary <$> useOrFail state "Retrie.GetModSummary" (CallRetrieInternalError "file not found") GetModSummary origin-#endif parseRewriteSpecs-#if MIN_VERSION_ghc(9,2,0) libdir-#endif (\_f -> return $ NoCPP originParsedModule) originFixities specs@@ -678,9 +657,7 @@ s :: Data a => a -> String s = T.unpack . printOutputable . showAstData NoBlankSrcSpan-#if MIN_VERSION_ghc(9,2,0) NoBlankEpAnnotations-#endif constructInlineFromIdentifer originParsedModule originSpan = do -- traceM $ s $ astA originParsedModule fmap astA $ transformA originParsedModule $ \(L _ m) -> do@@ -779,10 +756,8 @@ , ideclSourceText = ideclSourceSrc , ideclImplicit = ideclImplicit }-#elif MIN_VERSION_ghc(9,2,0)- ideclExt = GHCGHC.EpAnnNotUsed #else- ideclExt = GHC.noExtField+ ideclExt = GHCGHC.EpAnnNotUsed #endif ideclAs = toMod <$> ideclAsString ideclQualified = if ideclQualifiedBool then GHC.QualifiedPre else GHC.NotQualified