packages feed

hls-explicit-record-fields-plugin 2.0.0.0 → 2.0.0.1

raw patch · 2 files changed

+12/−19 lines, 2 filesdep ~ghcidedep ~hls-plugin-apiPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependency ranges changed: ghcide, hls-plugin-api

API changes (from Hackage documentation)

- Ide.Plugin.ExplicitFields: instance Control.DeepSeq.NFData Ide.Plugin.ExplicitFields.GhcExtension

Files

hls-explicit-record-fields-plugin.cabal view
@@ -1,6 +1,6 @@ cabal-version:      3.0 name:               hls-explicit-record-fields-plugin-version:            2.0.0.0+version:            2.0.0.1 synopsis:           Explicit record fields plugin for Haskell Language Server description:   Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>@@ -29,8 +29,8 @@     -- other-extensions:     build-depends:       , base                  >=4.12 && <5-      , ghcide                == 2.0.0.0-      , hls-plugin-api        == 2.0.0.0+      , ghcide                == 2.0.0.1+      , hls-plugin-api        == 2.0.0.1       , lsp       , lens       , hls-graph
src/Ide/Plugin/ExplicitFields.hs view
@@ -22,8 +22,8 @@ import           Data.Generics                   (GenericQ, everything, extQ,                                                   mkQ) import qualified Data.HashMap.Strict             as HashMap-import           Data.Maybe                      (isJust, listToMaybe,-                                                  maybeToList, fromMaybe)+import           Data.Maybe                      (fromMaybe, isJust,+                                                  listToMaybe, maybeToList) import           Data.Text                       (Text) import           Development.IDE                 (IdeState, NormalizedFilePath,                                                   Pretty (..), Recorder (..),@@ -36,8 +36,8 @@ import qualified Development.IDE.Core.Shake      as Shake import           Development.IDE.GHC.Compat      (HsConDetails (RecCon),                                                   HsRecFields (..), LPat,-                                                  Outputable, getLoc, unLoc,-                                                  recDotDot)+                                                  Outputable, getLoc, recDotDot,+                                                  unLoc) import           Development.IDE.GHC.Compat.Core (Extension (NamedFieldPuns),                                                   GhcPass,                                                   HsExpr (RecordCon, rcon_flds),@@ -103,7 +103,7 @@ codeActionProvider ideState pId (CodeActionParams _ _ docId range _) = pluginResponse $ do   nfp <- getNormalizedFilePath (docId ^. L.uri)   pragma <- getFirstPragma pId ideState nfp-  CRR recMap (map unExt -> exts) <- collectRecords' ideState nfp+  CRR recMap exts <- collectRecords' ideState nfp   let actions = map (mkCodeAction nfp exts pragma) (RangeMap.filterByRange range recMap)   pure $ List actions @@ -160,8 +160,8 @@           pure ([], CRR <$> recMap <*> Just exts)    where-    getEnabledExtensions :: TcModuleResult -> [GhcExtension]-    getEnabledExtensions = map GhcExtension . getExtensions . tmrParsed+    getEnabledExtensions :: TcModuleResult -> [Extension]+    getEnabledExtensions =  getExtensions . tmrParsed  getRecords :: TcModuleResult -> [RecordInfo] getRecords (tmrRenamed -> (hs_valds -> valBinds,_,_,_)) =@@ -186,7 +186,7 @@  data CollectRecordsResult = CRR   { recordInfos       :: RangeMap RenderedRecordInfo-  , enabledExtensions :: [GhcExtension]+  , enabledExtensions :: [Extension]   }   deriving (Generic) @@ -213,15 +213,8 @@  type instance RuleResult CollectNames = CollectNamesResult --- `Extension` is wrapped so that we can provide an `NFData` instance--- (without resorting to creating an orphan instance).-newtype GhcExtension = GhcExtension { unExt :: Extension }--instance NFData GhcExtension where-  rnf x = x `seq` ()- -- As with `GhcExtension`, this newtype exists mostly to attach--- an `NFData` instance to `UniqFM`.+-- an `NFData` instance to `UniqFM`.(without resorting to creating an orphan instance). newtype NameMap = NameMap (UniqFM Name [Name])  instance NFData NameMap where