Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare ghcide release v1.3.0.0 #1811

Merged
merged 5 commits into from
May 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions ghcide/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions ghcide/bench/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ versions:
# - 1.0.0
# - ghcide-v1.1.0
# - ghcide-v1.2.0
# - ghcide-v1.3.0
- upstream: origin/master
- HEAD

Expand Down
5 changes: 2 additions & 3 deletions ghcide/ghcide.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down
18 changes: 2 additions & 16 deletions ghcide/src/Development/IDE/Core/OfInterest.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
9 changes: 9 additions & 0 deletions ghcide/src/Development/IDE/Core/RuleTypes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
10 changes: 0 additions & 10 deletions ghcide/src/Development/IDE/Core/Rules.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
------------------------------------------------------------
Expand Down
11 changes: 11 additions & 0 deletions ghcide/src/Development/IDE/Core/Shake.hs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ module Development.IDE.Core.Shake(
define, defineNoDiagnostics,
defineEarlyCutoff,
defineOnDisk, needOnDisk, needOnDisks,
defineNoFile, defineEarlyCutOffNoFile,
getDiagnostics,
mRunLspT, mRunLspTCallback,
getHiddenDiagnostics,
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions haskell-language-server.cabal
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/haskell/haskell-language-server#readme>
Expand Down Expand Up @@ -62,7 +62,7 @@ library
, cryptohash-sha1
, data-default
, ghc
, ghcide ^>=1.2
, ghcide ^>=1.3
, gitrev
, lsp
, hie-bios
Expand Down
2 changes: 1 addition & 1 deletion hls-graph/hls-graph.cabal
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/haskell/haskell-language-server#readme>
Expand Down
2 changes: 1 addition & 1 deletion hls-graph/src/Development/IDE/Graph.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions hls-plugin-api/hls-plugin-api.cabal
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/haskell/haskell-language-server#readme>
Expand Down Expand Up @@ -50,7 +50,7 @@ library
, opentelemetry
, process
, regex-tdfa >=1.3.1.0
, hls-graph
, hls-graph ^>=1.3
, text
, unordered-containers

Expand Down
21 changes: 10 additions & 11 deletions hls-plugin-api/src/Ide/Plugin/ConfigUtils.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions hls-test-utils/hls-test-utils.cabal
Original file line number Diff line number Diff line change
@@ -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 <https://github.com/haskell/haskell-language-server#readme>
Expand Down Expand Up @@ -41,7 +41,7 @@ library
, directory
, extra
, filepath
, ghcide ^>=1.2
, ghcide >=1.3 && <1.4
, hls-graph
, hls-plugin-api ^>=1.1
, hspec
Expand Down
2 changes: 1 addition & 1 deletion plugins/hls-brittany-plugin/hls-brittany-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/hls-class-plugin/hls-class-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ library
, containers
, ghc
, ghc-exactprint
, ghcide ^>=1.2
, ghcide >=1.2 && <1.4
, hls-plugin-api ^>=1.1
, lens
, lsp
Expand Down
2 changes: 1 addition & 1 deletion plugins/hls-eval-plugin/hls-eval-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -20,7 +20,7 @@ library
, containers
, deepseq
, ghc
, ghcide ^>=1.2
, ghcide ^>=1.3
, hls-plugin-api ^>=1.1
, lsp
, lsp-types
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/hls-hlint-plugin/hls-hlint-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/hls-retrie-plugin/hls-retrie-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ library
, directory
, extra
, ghc
, ghcide ^>=1.2
, ghcide >=1.2 && <1.4
, hashable
, hls-plugin-api ^>=1.1
, lsp
Expand Down
2 changes: 1 addition & 1 deletion plugins/hls-splice-plugin/hls-splice-plugin.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ library
, foldl
, ghc
, ghc-exactprint
, ghcide ^>=1.2
, ghcide >=1.2 && <1.4
, hls-plugin-api ^>=1.1
, lens
, lsp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading