hls-refine-imports-plugin 1.0.0.2 → 1.0.1.0
raw patch · 3 files changed
+9/−9 lines, 3 filesdep ~ghcidedep ~hls-plugin-apiPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: ghcide, hls-plugin-api
API changes (from Hackage documentation)
Files
hls-refine-imports-plugin.cabal view
@@ -1,6 +1,6 @@ cabal-version: 2.4 name: hls-refine-imports-plugin-version: 1.0.0.2+version: 1.0.1.0 synopsis: Refine imports plugin for Haskell Language Server description: Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>@@ -24,10 +24,10 @@ , containers , deepseq , ghc- , ghcide ^>=1.4 || ^>=1.5+ , ghcide ^>=1.6 , hls-explicit-imports-plugin ^>=1.0.0.1 , hls-graph- , hls-plugin-api >=1.1 && <1.3+ , hls-plugin-api ^>=1.3 , lsp , text , unordered-containers
src/Ide/Plugin/RefineImports.hs view
@@ -215,8 +215,8 @@ i@(L lim id@ImportDecl {ideclName = L _ mn, ideclHiding = Just (hiding, L _ names)}) (newModuleName, avails) = L lim id- { ideclName = noLoc newModuleName- , ideclHiding = Just (hiding, noLoc newNames)+ { ideclName = noLocA newModuleName+ , ideclHiding = Just (hiding, noLocA newNames) } where newNames = filter (\n -> any (n `containsAvail`) avails) names constructImport lim _ = lim@@ -247,9 +247,9 @@ -------------------------------------------------------------------------------- -mkExplicitEdit :: PositionMapping -> LImportDecl pass -> T.Text -> Maybe TextEdit+mkExplicitEdit :: PositionMapping -> LImportDecl GhcRn -> T.Text -> Maybe TextEdit mkExplicitEdit posMapping (L src imp) explicit- | RealSrcSpan l _ <- src,+ | RealSrcSpan l _ <- locA src, L _ mn <- ideclName imp, -- (almost) no one wants to see an refine import list for Prelude mn /= moduleName pRELUDE,
test/Main.hs view
@@ -74,6 +74,6 @@ pointRange :: Int -> Int -> Range pointRange- (subtract 1 -> line)- (subtract 1 -> col) =+ (subtract 1 -> fromIntegral -> line)+ (subtract 1 -> fromIntegral -> col) = Range (Position line col) (Position line $ col + 1)