hls-explicit-imports-plugin 0.1.0.0 → 0.1.0.1
raw patch · 2 files changed
+5/−16 lines, 2 filesdep ~ghcidePVP ok
version bump matches the API change (PVP)
Dependency ranges changed: ghcide
API changes (from Hackage documentation)
Files
hls-explicit-imports-plugin.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.2 name: hls-explicit-imports-plugin-version: 0.1.0.0+version: 0.1.0.1 synopsis: Explicit imports plugin for Haskell Language Server license: Apache-2.0 license-file: LICENSE@@ -22,7 +22,7 @@ , haskell-lsp-types , hls-plugin-api , ghc- , ghcide+ , ghcide >= 0.7.4 , shake , text , unordered-containers
src/Ide/Plugin/ExplicitImports.hs view
@@ -3,13 +3,11 @@ {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE DuplicateRecordFields #-}-{-# LANGUAGE LambdaCase #-} {-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RecordWildCards #-} {-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-}-{-# LANGUAGE ViewPatterns #-} #include "ghc-api-version.h" @@ -189,10 +187,10 @@ -- | Use the ghc api to extract a minimal, explicit set of imports for this module extractMinimalImports ::- Maybe (HscEnvEq) ->- Maybe (TcModuleResult) ->+ Maybe HscEnvEq ->+ Maybe TcModuleResult -> IO ([LImportDecl GhcRn], Maybe [LImportDecl GhcRn])-extractMinimalImports (Just (hsc)) (Just (TcModuleResult {..})) = do+extractMinimalImports (Just hsc) (Just TcModuleResult {..}) = do -- extract the original imports and the typechecking environment let tcEnv = tmrTypechecked (_, imports, _, _) = tmrRenamed@@ -249,15 +247,6 @@ runIde state = runAction "importLens" state ----------------------------------------------------------------------------------isQualifiedImport :: ImportDecl a -> Bool-#if MIN_GHC_API_VERSION(8,10,0)-isQualifiedImport ImportDecl{ideclQualified = NotQualified} = False-isQualifiedImport ImportDecl{} = True-#else-isQualifiedImport ImportDecl{ideclQualified} = ideclQualified-#endif-isQualifiedImport _ = False within :: Range -> SrcSpan -> Bool within (Range start end) span =