hls-hlint-plugin 1.0.0.1 → 1.0.0.2
raw patch · 2 files changed
+33/−27 lines, 2 filesdep ~Diffdep ~ghcidedep ~hlintPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: Diff, ghcide, hlint, hls-plugin-api
API changes (from Hackage documentation)
Files
- hls-hlint-plugin.cabal +25/−19
- src/Ide/Plugin/Hlint.hs +8/−8
hls-hlint-plugin.cabal view
@@ -1,8 +1,10 @@ cabal-version: 2.2 name: hls-hlint-plugin -version: 1.0.0.1 +version: 1.0.0.2 synopsis: Hlint integration plugin with Haskell Language Server -description: Please see Haskell Language Server Readme (https://github.com/haskell/haskell-language-server#readme) +description: + Please see Haskell Language Server Readme (https://github.com/haskell/haskell-language-server#readme) + license: Apache-2.0 license-file: LICENSE author: The Haskell IDE Team @@ -23,29 +25,29 @@ Force dependency on ghc-lib-parser even if GHC API in the ghc package is supported library - exposed-modules: Ide.Plugin.Hlint - hs-source-dirs: src + exposed-modules: Ide.Plugin.Hlint + hs-source-dirs: src build-depends: , aeson - , apply-refact >=0.9 - , base >=4.12 && <5 + , apply-refact >=0.9 + , base >=4.12 && <5 , binary , bytestring , containers , data-default , deepseq - , Diff + , Diff ^>=0.4.0 , directory , extra , filepath - , ghc-exactprint >=0.6.3.4 - , ghcide ^>= 1.0.0.0 + , ghc-exactprint >=0.6.3.4 + , ghcide ^>=1.2 , hashable - , lsp - , hlint >=3.2 - , hls-plugin-api ^>= 1.0.0.0 + , hlint ^>=3.2 + , hls-plugin-api ^>=1.1 , hslogger , lens + , lsp , regex-tdfa , shake , temporary @@ -53,21 +55,25 @@ , transformers , unordered-containers - if (!flag(ghc-lib) && impl(ghc >=8.10.1) && impl(ghc <9.0.0)) - build-depends: ghc ^>= 8.10 + if ((!flag(ghc-lib) && impl(ghc >=8.10.1)) && impl(ghc <9.0.0)) + build-depends: ghc ^>=8.10 else build-depends: , ghc - , ghc-lib ^>= 8.10.4.20210206 - , ghc-lib-parser-ex ^>= 8.10 + , ghc-lib ^>=8.10.4.20210206 + , ghc-lib-parser-ex ^>=8.10 cpp-options: -DHLINT_ON_GHC_LIB - ghc-options: -Wall -Wredundant-constraints -Wno-name-shadowing -Wno-unticked-promoted-constructors + ghc-options: + -Wall -Wredundant-constraints -Wno-name-shadowing + -Wno-unticked-promoted-constructors if flag(pedantic) ghc-options: -Werror - default-language: Haskell2010 - default-extensions: DataKinds, TypeOperators + default-language: Haskell2010 + default-extensions: + DataKinds + TypeOperators
src/Ide/Plugin/Hlint.hs view
@@ -190,7 +190,7 @@ getIdeas :: NormalizedFilePath -> Action (Either ParseError [Idea]) getIdeas nfp = do - logm $ "hlint:getIdeas:file:" ++ show nfp + debugm $ "hlint:getIdeas:file:" ++ show nfp (flags, classify, hint) <- useNoFile_ GetHlintSettings let applyHints' (Just (Right modEx)) = Right $ applyHints classify hint [modEx] @@ -222,7 +222,7 @@ setExtensions flags = do hlintExts <- getExtensions flags nfp - logm $ "hlint:getIdeas:setExtensions:" ++ show hlintExts + debugm $ "hlint:getIdeas:setExtensions:" ++ show hlintExts return $ flags { enabledExtensions = hlintExts } getExtensions :: ParseFlags -> NormalizedFilePath -> Action [Extension] @@ -234,8 +234,8 @@ return hlintExts where getFlags :: Action DynFlags getFlags = do - (modsum, _) <- use_ GetModSummary nfp - return $ ms_hspp_opts modsum + modsum <- use_ GetModSummary nfp + return $ ms_hspp_opts $ msrModSummary modsum #endif -- --------------------------------------------------------------------- @@ -289,7 +289,7 @@ applyAllAction = let args = Just [toJSON (docId ^. LSP.uri)] cmd = mkLspCommand plId "applyAll" "Apply all hints" args - in LSP.CodeAction "Apply all hints" (Just LSP.CodeActionQuickFix) Nothing Nothing Nothing Nothing (Just cmd) + in LSP.CodeAction "Apply all hints" (Just LSP.CodeActionQuickFix) Nothing Nothing Nothing Nothing (Just cmd) Nothing applyOneActions :: [LSP.CodeAction] applyOneActions = mapMaybe mkHlintAction (filter validCommand diags) @@ -306,7 +306,7 @@ mkHlintAction diag@(LSP.Diagnostic (LSP.Range start _) _s (Just (InR code)) (Just "hlint") _ _ _) = Just . codeAction $ mkLspCommand plId "applyOne" title (Just args) where - codeAction cmd = LSP.CodeAction title (Just LSP.CodeActionQuickFix) (Just (LSP.List [diag])) Nothing Nothing Nothing (Just cmd) + codeAction cmd = LSP.CodeAction title (Just LSP.CodeActionQuickFix) (Just (LSP.List [diag])) Nothing Nothing Nothing (Just cmd) Nothing -- we have to recover the original ideaHint removing the prefix ideaHint = T.replace "refact:" "" code title = "Apply hint: " <> ideaHint @@ -378,8 +378,8 @@ let fp = fromNormalizedFilePath nfp (_, mbOldContent) <- liftIO $ runAction' $ getFileContents nfp oldContent <- maybe (liftIO $ T.readFile fp) return mbOldContent - (modsum, _) <- liftIO $ runAction' $ use_ GetModSummary nfp - let dflags = ms_hspp_opts modsum + modsum <- liftIO $ runAction' $ use_ GetModSummary nfp + let dflags = ms_hspp_opts $ msrModSummary modsum -- Setting a environment variable with the libdir used by ghc-exactprint. -- It is a workaround for an error caused by the use of a hadcoded at compile time libdir -- in ghc-exactprint that makes dependent executables non portables.