diff --git a/ghcide/CHANGELOG.md b/ghcide/CHANGELOG.md index 0452c4263d..ff893a1ffb 100644 --- a/ghcide/CHANGELOG.md +++ b/ghcide/CHANGELOG.md @@ -1,3 +1,15 @@ +### 1.3.0.0 (2021-05-09) +* Replace unsafe getmodtime with unix package (#1778) - Pepe Iborra +* Progress reporting improvements (#1784) - Pepe Iborra +* Unify session loading using implicit-hie (#1783) - fendor +* Fix remove constraint (#1578) - Kostas Dermentzis +* Fix wrong extend import while type constuctor and data constructor have the same name (#1775) - Lei Zhu +* Imporve vscode extension schema generation (#1742) - Potato Hatsue +* Add hls-graph abstracting over shake (#1748) - Neil Mitchell +* Tease apart the custom SYB from ExactPrint (#1746) - Sandy Maguire +* fix class method completion (#1741) - Lei Zhu +* Fix: #1690 - Infix typed holes are now filled using infix notation (#1708) - Oliver Madine + ### 1.2.0.2 (2021-04-13) * Bracketing for snippet completions (#1709) - Oliver Madine * Don't suggest destruct actions for already-destructed terms (#1715) - Sandy Maguire diff --git a/ghcide/bench/config.yaml b/ghcide/bench/config.yaml index 7baed85117..8977f57106 100644 --- a/ghcide/bench/config.yaml +++ b/ghcide/bench/config.yaml @@ -80,6 +80,7 @@ versions: # - 1.0.0 # - ghcide-v1.1.0 # - ghcide-v1.2.0 +# - ghcide-v1.3.0 - upstream: origin/master - HEAD diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index 7ba852f08b..42a3867174 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -2,7 +2,7 @@ cabal-version: 2.4 build-type: Simple category: Development name: ghcide -version: 1.2.0.2 +version: 1.3.0.0 license: Apache-2.0 license-file: LICENSE author: Digital Asset and Ghcide contributors @@ -67,14 +67,13 @@ library optparse-applicative, parallel, prettyprinter-ansi-terminal, - prettyprinter-ansi-terminal, prettyprinter, regex-tdfa >= 1.3.1.0, retrie, rope-utf16-splay, safe, safe-exceptions, - hls-graph, + hls-graph ^>= 1.3, sorted-list, sqlite-simple, stm, diff --git a/ghcide/src/Development/IDE/Core/OfInterest.hs b/ghcide/src/Development/IDE/Core/OfInterest.hs index 2ccca48c0c..2c46bd0ba8 100644 --- a/ghcide/src/Development/IDE/Core/OfInterest.hs +++ b/ghcide/src/Development/IDE/Core/OfInterest.hs @@ -14,18 +14,13 @@ module Development.IDE.Core.OfInterest( ) where import Control.Concurrent.Strict -import Control.DeepSeq -import Control.Exception import Control.Monad import Control.Monad.IO.Class import Data.Binary import Data.HashMap.Strict (HashMap) import qualified Data.HashMap.Strict as HashMap -import Data.Hashable import qualified Data.Text as T -import Data.Typeable import Development.IDE.Graph -import GHC.Generics import Control.Monad.Trans.Class import Control.Monad.Trans.Maybe @@ -44,24 +39,15 @@ import Development.IDE.Types.Options newtype OfInterestVar = OfInterestVar (Var (HashMap NormalizedFilePath FileOfInterestStatus)) instance IsIdeGlobal OfInterestVar -type instance RuleResult GetFilesOfInterest = HashMap NormalizedFilePath FileOfInterestStatus - -data GetFilesOfInterest = GetFilesOfInterest - deriving (Eq, Show, Typeable, Generic) -instance Hashable GetFilesOfInterest -instance NFData GetFilesOfInterest -instance Binary GetFilesOfInterest - - -- | The rule that initialises the files of interest state. ofInterestRules :: Rules () ofInterestRules = do addIdeGlobal . OfInterestVar =<< liftIO (newVar HashMap.empty) - defineEarlyCutoff $ RuleNoDiagnostics $ \GetFilesOfInterest _file -> assert (null $ fromNormalizedFilePath _file) $ do + defineEarlyCutOffNoFile $ \GetFilesOfInterest -> do alwaysRerun filesOfInterest <- getFilesOfInterestUntracked let !cutoff = LBS.toStrict $ encode $ HashMap.toList filesOfInterest - pure (Just cutoff, Just filesOfInterest) + pure (cutoff, filesOfInterest) -- | Get the files that are open in the IDE. getFilesOfInterest :: Action (HashMap NormalizedFilePath FileOfInterestStatus) diff --git a/ghcide/src/Development/IDE/Core/RuleTypes.hs b/ghcide/src/Development/IDE/Core/RuleTypes.hs index 228a063cea..be6e4e3a02 100644 --- a/ghcide/src/Development/IDE/Core/RuleTypes.hs +++ b/ghcide/src/Development/IDE/Core/RuleTypes.hs @@ -40,6 +40,7 @@ import HscTypes (HomeModInfo, import qualified Data.Binary as B import Data.ByteString (ByteString) import qualified Data.ByteString.Lazy as LBS +import Data.HashMap.Strict (HashMap) import Data.Text (Text) import Data.Time import Development.IDE.Import.FindImports (ArtifactsLocation) @@ -353,6 +354,8 @@ type instance RuleResult GetModSummary = ModSummaryResult -- | Generate a ModSummary with the timestamps and preprocessed content elided, for more successful early cutoff type instance RuleResult GetModSummaryWithoutTimestamps = ModSummaryResult +type instance RuleResult GetFilesOfInterest = HashMap NormalizedFilePath FileOfInterestStatus + data GetParsedModule = GetParsedModule deriving (Eq, Show, Typeable, Generic) instance Hashable GetParsedModule @@ -510,6 +513,12 @@ instance Hashable GhcSessionIO instance NFData GhcSessionIO instance Binary GhcSessionIO +data GetFilesOfInterest = GetFilesOfInterest + deriving (Eq, Show, Typeable, Generic) +instance Hashable GetFilesOfInterest +instance NFData GetFilesOfInterest +instance Binary GetFilesOfInterest + makeLensesWith (lensRules & lensField .~ mappingNamer (pure . (++ "L"))) ''Splices diff --git a/ghcide/src/Development/IDE/Core/Rules.hs b/ghcide/src/Development/IDE/Core/Rules.hs index 12038f4a02..3930e4f5d4 100644 --- a/ghcide/src/Development/IDE/Core/Rules.hs +++ b/ghcide/src/Development/IDE/Core/Rules.hs @@ -152,16 +152,6 @@ import Control.Applicative toIdeResult :: Either [FileDiagnostic] v -> IdeResult v toIdeResult = either (, Nothing) (([],) . Just) -defineNoFile :: IdeRule k v => (k -> Action v) -> Rules () -defineNoFile f = defineNoDiagnostics $ \k file -> do - if file == emptyFilePath then do res <- f k; return (Just res) else - fail $ "Rule " ++ show k ++ " should always be called with the empty string for a file" - -defineEarlyCutOffNoFile :: IdeRule k v => (k -> Action (BS.ByteString, v)) -> Rules () -defineEarlyCutOffNoFile f = defineEarlyCutoff $ RuleNoDiagnostics $ \k file -> do - if file == emptyFilePath then do (hash, res) <- f k; return (Just hash, Just res) else - fail $ "Rule " ++ show k ++ " should always be called with the empty string for a file" - ------------------------------------------------------------ -- Exposed API ------------------------------------------------------------ diff --git a/ghcide/src/Development/IDE/Core/Shake.hs b/ghcide/src/Development/IDE/Core/Shake.hs index 52463e51f6..f4b702b794 100644 --- a/ghcide/src/Development/IDE/Core/Shake.hs +++ b/ghcide/src/Development/IDE/Core/Shake.hs @@ -44,6 +44,7 @@ module Development.IDE.Core.Shake( define, defineNoDiagnostics, defineEarlyCutoff, defineOnDisk, needOnDisk, needOnDisks, + defineNoFile, defineEarlyCutOffNoFile, getDiagnostics, mRunLspT, mRunLspTCallback, getHiddenDiagnostics, @@ -833,6 +834,16 @@ defineEarlyCutoff (Rule op) = addRule $ \(Q (key, file)) (old :: Maybe BS.ByteSt defineEarlyCutoff (RuleNoDiagnostics op) = addRule $ \(Q (key, file)) (old :: Maybe BS.ByteString) mode -> otTracedAction key file isSuccess $ do defineEarlyCutoff' False key file old mode $ second (mempty,) <$> op key file +defineNoFile :: IdeRule k v => (k -> Action v) -> Rules () +defineNoFile f = defineNoDiagnostics $ \k file -> do + if file == emptyFilePath then do res <- f k; return (Just res) else + fail $ "Rule " ++ show k ++ " should always be called with the empty string for a file" + +defineEarlyCutOffNoFile :: IdeRule k v => (k -> Action (BS.ByteString, v)) -> Rules () +defineEarlyCutOffNoFile f = defineEarlyCutoff $ RuleNoDiagnostics $ \k file -> do + if file == emptyFilePath then do (hash, res) <- f k; return (Just hash, Just res) else + fail $ "Rule " ++ show k ++ " should always be called with the empty string for a file" + defineEarlyCutoff' :: IdeRule k v => Bool -- ^ update diagnostics diff --git a/haskell-language-server.cabal b/haskell-language-server.cabal index 11089fab94..136121985f 100644 --- a/haskell-language-server.cabal +++ b/haskell-language-server.cabal @@ -1,7 +1,7 @@ cabal-version: 2.4 category: Development name: haskell-language-server -version: 1.1.0.0 +version: 1.1.0.1 synopsis: LSP server for GHC description: Please see the README on GitHub at @@ -62,7 +62,7 @@ library , cryptohash-sha1 , data-default , ghc - , ghcide ^>=1.2 + , ghcide ^>=1.3 , gitrev , lsp , hie-bios diff --git a/hls-graph/hls-graph.cabal b/hls-graph/hls-graph.cabal index e3b338caef..f0b66343f9 100644 --- a/hls-graph/hls-graph.cabal +++ b/hls-graph/hls-graph.cabal @@ -1,6 +1,6 @@ cabal-version: 2.4 name: hls-graph -version: 1.1.0.0 +version: 1.3.0.0 synopsis: Haskell Language Server internal graph API description: Please see the README on GitHub at diff --git a/hls-graph/src/Development/IDE/Graph.hs b/hls-graph/src/Development/IDE/Graph.hs index 0076e1fa40..1578dda086 100644 --- a/hls-graph/src/Development/IDE/Graph.hs +++ b/hls-graph/src/Development/IDE/Graph.hs @@ -7,7 +7,7 @@ module Development.IDE.Graph( actionFinally, actionBracket, actionCatch, Shake.ShakeException(..), -- * Configuration - ShakeOptions(shakeThreads, shakeFiles, shakeExtra), + ShakeOptions(shakeAllowRedefineRules, shakeThreads, shakeFiles, shakeExtra), getShakeExtra, getShakeExtraRules, newShakeExtra, -- * Explicit parallelism parallel, diff --git a/hls-plugin-api/hls-plugin-api.cabal b/hls-plugin-api/hls-plugin-api.cabal index acec2485d4..d2885f2ae8 100644 --- a/hls-plugin-api/hls-plugin-api.cabal +++ b/hls-plugin-api/hls-plugin-api.cabal @@ -1,6 +1,6 @@ cabal-version: 2.4 name: hls-plugin-api -version: 1.1.0.0 +version: 1.1.0.1 synopsis: Haskell Language Server API for plugin communication description: Please see the README on GitHub at @@ -50,7 +50,7 @@ library , opentelemetry , process , regex-tdfa >=1.3.1.0 - , hls-graph + , hls-graph ^>=1.3 , text , unordered-containers diff --git a/hls-plugin-api/src/Ide/Plugin/ConfigUtils.hs b/hls-plugin-api/src/Ide/Plugin/ConfigUtils.hs index 2deb8872a6..0996c0c92a 100644 --- a/hls-plugin-api/src/Ide/Plugin/ConfigUtils.hs +++ b/hls-plugin-api/src/Ide/Plugin/ConfigUtils.hs @@ -5,16 +5,15 @@ module Ide.Plugin.ConfigUtils where -import qualified Data.Aeson as A -import qualified Data.Aeson.Types as A -import Data.Containers.ListUtils (nubOrd) -import Data.Default (def) -import qualified Data.Dependent.Map as DMap -import qualified Data.Dependent.Sum as DSum -import qualified Data.HashMap.Lazy as HMap +import qualified Data.Aeson as A +import qualified Data.Aeson.Types as A +import Data.Default (def) +import qualified Data.Dependent.Map as DMap +import qualified Data.Dependent.Sum as DSum +import qualified Data.HashMap.Lazy as HMap +import Data.List (nub) import Ide.Plugin.Config -import Ide.Plugin.Properties (toDefaultJSON, - toVSCodeExtensionSchema) +import Ide.Plugin.Properties (toDefaultJSON, toVSCodeExtensionSchema) import Ide.Types import Language.LSP.Types @@ -65,7 +64,7 @@ pluginsToDefaultConfig IdePlugins {..} = -- } -- genericDefaultConfig = - let x = ["diagnosticsOn" A..= True | configHasDiagnostics] <> nubOrd (mconcat (handlersToGenericDefaultConfig <$> handlers)) + let x = ["diagnosticsOn" A..= True | configHasDiagnostics] <> nub (mconcat (handlersToGenericDefaultConfig <$> handlers)) in case x of -- if the plugin has only one capability, we produce globalOn instead of the specific one; -- otherwise we don't produce globalOn at all @@ -108,7 +107,7 @@ pluginsToVSCodeExtensionSchema IdePlugins {..} = A.object $ mconcat $ singlePlug genericSchema = let x = [withIdPrefix "diagnosticsOn" A..= schemaEntry "diagnostics" | configHasDiagnostics] - <> nubOrd (mconcat (handlersToGenericSchema <$> handlers)) + <> nub (mconcat (handlersToGenericSchema <$> handlers)) in case x of -- If the plugin has only one capability, we produce globalOn instead of the specific one; -- otherwise we don't produce globalOn at all diff --git a/hls-test-utils/hls-test-utils.cabal b/hls-test-utils/hls-test-utils.cabal index 777524f3e5..7f73059eca 100644 --- a/hls-test-utils/hls-test-utils.cabal +++ b/hls-test-utils/hls-test-utils.cabal @@ -1,6 +1,6 @@ cabal-version: 2.4 name: hls-test-utils -version: 1.0.0.0 +version: 1.0.0.1 synopsis: Utilities used in the tests of Haskell Language Server description: Please see the README on GitHub at @@ -41,7 +41,7 @@ library , directory , extra , filepath - , ghcide ^>=1.2 + , ghcide >=1.3 && <1.4 , hls-graph , hls-plugin-api ^>=1.1 , hspec diff --git a/plugins/hls-brittany-plugin/hls-brittany-plugin.cabal b/plugins/hls-brittany-plugin/hls-brittany-plugin.cabal index b2964348ca..4a0bbd0c29 100644 --- a/plugins/hls-brittany-plugin/hls-brittany-plugin.cabal +++ b/plugins/hls-brittany-plugin/hls-brittany-plugin.cabal @@ -25,7 +25,7 @@ library , filepath , ghc , ghc-boot-th - , ghcide ^>=1.2 + , ghcide >=1.2 && <1.4 , hls-plugin-api ^>=1.1 , lens , lsp-types diff --git a/plugins/hls-class-plugin/hls-class-plugin.cabal b/plugins/hls-class-plugin/hls-class-plugin.cabal index 19533be7af..2ddc47c513 100644 --- a/plugins/hls-class-plugin/hls-class-plugin.cabal +++ b/plugins/hls-class-plugin/hls-class-plugin.cabal @@ -29,7 +29,7 @@ library , containers , ghc , ghc-exactprint - , ghcide ^>=1.2 + , ghcide >=1.2 && <1.4 , hls-plugin-api ^>=1.1 , lens , lsp diff --git a/plugins/hls-eval-plugin/hls-eval-plugin.cabal b/plugins/hls-eval-plugin/hls-eval-plugin.cabal index 886595cf33..7520d264d7 100644 --- a/plugins/hls-eval-plugin/hls-eval-plugin.cabal +++ b/plugins/hls-eval-plugin/hls-eval-plugin.cabal @@ -61,7 +61,7 @@ library , ghc , ghc-boot-th , ghc-paths - , ghcide ^>=1.2 + , ghcide >=1.2 && <1.4 , hashable , hls-plugin-api ^>=1.1 , lens diff --git a/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal b/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal index ab963e8830..1ade9e28c7 100644 --- a/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal +++ b/plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal @@ -1,6 +1,6 @@ cabal-version: 2.2 name: hls-explicit-imports-plugin -version: 1.0.0.1 +version: 1.0.0.2 synopsis: Explicit imports plugin for Haskell Language Server license: Apache-2.0 license-file: LICENSE @@ -20,7 +20,7 @@ library , containers , deepseq , ghc - , ghcide ^>=1.2 + , ghcide ^>=1.3 , hls-plugin-api ^>=1.1 , lsp , lsp-types diff --git a/plugins/hls-haddock-comments-plugin/hls-haddock-comments-plugin.cabal b/plugins/hls-haddock-comments-plugin/hls-haddock-comments-plugin.cabal index aae85727f6..e490a7831e 100644 --- a/plugins/hls-haddock-comments-plugin/hls-haddock-comments-plugin.cabal +++ b/plugins/hls-haddock-comments-plugin/hls-haddock-comments-plugin.cabal @@ -29,7 +29,7 @@ library , containers , ghc , ghc-exactprint - , ghcide ^>=1.2 + , ghcide >=1.2 && <1.4 , hls-plugin-api ^>=1.1 , lsp-types , text diff --git a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal b/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal index a164cc0a29..166217a44b 100644 --- a/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal +++ b/plugins/hls-hlint-plugin/hls-hlint-plugin.cabal @@ -41,7 +41,7 @@ library , extra , filepath , ghc-exactprint >=0.6.3.4 - , ghcide ^>=1.2 + , ghcide >=1.2 && <1.4 , hashable , hlint ^>=3.2 , hls-plugin-api ^>=1.1 diff --git a/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal b/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal index d2594569df..e2ada35b0f 100644 --- a/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal +++ b/plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal @@ -14,13 +14,13 @@ extra-source-files: library exposed-modules: Ide.Plugin.RefineImports hs-source-dirs: src - build-depends: + build-depends: , aeson , base >=4.12 && <5 , containers , deepseq , ghc - , ghcide ^>=1.2 + , ghcide ^>=1.3 , hls-plugin-api ^>=1.1 , lsp , lsp-types diff --git a/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal b/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal index 605fd3f21f..b0d562e5d9 100644 --- a/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal +++ b/plugins/hls-retrie-plugin/hls-retrie-plugin.cabal @@ -22,7 +22,7 @@ library , directory , extra , ghc - , ghcide ^>=1.2 + , ghcide >=1.2 && <1.4 , hashable , hls-plugin-api ^>=1.1 , lsp diff --git a/plugins/hls-splice-plugin/hls-splice-plugin.cabal b/plugins/hls-splice-plugin/hls-splice-plugin.cabal index 281d5efa7a..87168efa4d 100644 --- a/plugins/hls-splice-plugin/hls-splice-plugin.cabal +++ b/plugins/hls-splice-plugin/hls-splice-plugin.cabal @@ -40,7 +40,7 @@ library , foldl , ghc , ghc-exactprint - , ghcide ^>=1.2 + , ghcide >=1.2 && <1.4 , hls-plugin-api ^>=1.1 , lens , lsp diff --git a/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal b/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal index 2137fd83a2..6231cd32de 100644 --- a/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal +++ b/plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal @@ -22,7 +22,7 @@ library , filepath , ghc , ghc-boot-th - , ghcide ^>=1.2 + , ghcide >=1.2 && <1.4 , hls-plugin-api ^>=1.1 , lsp-types , mtl diff --git a/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal b/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal index 4e03d73144..c52cd6830b 100644 --- a/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal +++ b/plugins/hls-tactics-plugin/hls-tactics-plugin.cabal @@ -1,7 +1,7 @@ cabal-version: 2.4 category: Development name: hls-tactics-plugin -version: 1.1.0.0 +version: 1.1.0.1 synopsis: Wingman plugin for Haskell Language Server description: Please see README.md author: Sandy Maguire, Reed Mullanix @@ -73,7 +73,7 @@ library , ghc-boot-th , ghc-exactprint , ghc-source-gen - , ghcide ^>=1.2 + , ghcide ^>=1.3 , hls-plugin-api ^>=1.1 , lens , lsp