Skip to content

Commit 9698c16

Browse files
authored
Prepare ghcide release v1.3.0.0 (#1811)
* Prepare ghcide release v1.3.0.0 * refactor - move defineNoFile variants * Refactor - move GetFilesOfInterest type and use the appropriate define * Restore compatibility with aeson < 1.5.2 * add missing reexport
1 parent 50ee7fa commit 9698c16

File tree

24 files changed

+69
-62
lines changed

24 files changed

+69
-62
lines changed

ghcide/CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
### 1.3.0.0 (2021-05-09)
2+
* Replace unsafe getmodtime with unix package (#1778) - Pepe Iborra
3+
* Progress reporting improvements (#1784) - Pepe Iborra
4+
* Unify session loading using implicit-hie (#1783) - fendor
5+
* Fix remove constraint (#1578) - Kostas Dermentzis
6+
* Fix wrong extend import while type constuctor and data constructor have the same name (#1775) - Lei Zhu
7+
* Imporve vscode extension schema generation (#1742) - Potato Hatsue
8+
* Add hls-graph abstracting over shake (#1748) - Neil Mitchell
9+
* Tease apart the custom SYB from ExactPrint (#1746) - Sandy Maguire
10+
* fix class method completion (#1741) - Lei Zhu
11+
* Fix: #1690 - Infix typed holes are now filled using infix notation (#1708) - Oliver Madine
12+
113
### 1.2.0.2 (2021-04-13)
214
* Bracketing for snippet completions (#1709) - Oliver Madine
315
* Don't suggest destruct actions for already-destructed terms (#1715) - Sandy Maguire

ghcide/bench/config.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ versions:
8080
# - 1.0.0
8181
# - ghcide-v1.1.0
8282
# - ghcide-v1.2.0
83+
# - ghcide-v1.3.0
8384
- upstream: origin/master
8485
- HEAD
8586

ghcide/ghcide.cabal

+2-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ cabal-version: 2.4
22
build-type: Simple
33
category: Development
44
name: ghcide
5-
version: 1.2.0.2
5+
version: 1.3.0.0
66
license: Apache-2.0
77
license-file: LICENSE
88
author: Digital Asset and Ghcide contributors
@@ -67,14 +67,13 @@ library
6767
optparse-applicative,
6868
parallel,
6969
prettyprinter-ansi-terminal,
70-
prettyprinter-ansi-terminal,
7170
prettyprinter,
7271
regex-tdfa >= 1.3.1.0,
7372
retrie,
7473
rope-utf16-splay,
7574
safe,
7675
safe-exceptions,
77-
hls-graph,
76+
hls-graph ^>= 1.3,
7877
sorted-list,
7978
sqlite-simple,
8079
stm,

ghcide/src/Development/IDE/Core/OfInterest.hs

+2-16
Original file line numberDiff line numberDiff line change
@@ -14,18 +14,13 @@ module Development.IDE.Core.OfInterest(
1414
) where
1515

1616
import Control.Concurrent.Strict
17-
import Control.DeepSeq
18-
import Control.Exception
1917
import Control.Monad
2018
import Control.Monad.IO.Class
2119
import Data.Binary
2220
import Data.HashMap.Strict (HashMap)
2321
import qualified Data.HashMap.Strict as HashMap
24-
import Data.Hashable
2522
import qualified Data.Text as T
26-
import Data.Typeable
2723
import Development.IDE.Graph
28-
import GHC.Generics
2924

3025
import Control.Monad.Trans.Class
3126
import Control.Monad.Trans.Maybe
@@ -44,24 +39,15 @@ import Development.IDE.Types.Options
4439
newtype OfInterestVar = OfInterestVar (Var (HashMap NormalizedFilePath FileOfInterestStatus))
4540
instance IsIdeGlobal OfInterestVar
4641

47-
type instance RuleResult GetFilesOfInterest = HashMap NormalizedFilePath FileOfInterestStatus
48-
49-
data GetFilesOfInterest = GetFilesOfInterest
50-
deriving (Eq, Show, Typeable, Generic)
51-
instance Hashable GetFilesOfInterest
52-
instance NFData GetFilesOfInterest
53-
instance Binary GetFilesOfInterest
54-
55-
5642
-- | The rule that initialises the files of interest state.
5743
ofInterestRules :: Rules ()
5844
ofInterestRules = do
5945
addIdeGlobal . OfInterestVar =<< liftIO (newVar HashMap.empty)
60-
defineEarlyCutoff $ RuleNoDiagnostics $ \GetFilesOfInterest _file -> assert (null $ fromNormalizedFilePath _file) $ do
46+
defineEarlyCutOffNoFile $ \GetFilesOfInterest -> do
6147
alwaysRerun
6248
filesOfInterest <- getFilesOfInterestUntracked
6349
let !cutoff = LBS.toStrict $ encode $ HashMap.toList filesOfInterest
64-
pure (Just cutoff, Just filesOfInterest)
50+
pure (cutoff, filesOfInterest)
6551

6652
-- | Get the files that are open in the IDE.
6753
getFilesOfInterest :: Action (HashMap NormalizedFilePath FileOfInterestStatus)

ghcide/src/Development/IDE/Core/RuleTypes.hs

+9
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ import HscTypes (HomeModInfo,
4040
import qualified Data.Binary as B
4141
import Data.ByteString (ByteString)
4242
import qualified Data.ByteString.Lazy as LBS
43+
import Data.HashMap.Strict (HashMap)
4344
import Data.Text (Text)
4445
import Data.Time
4546
import Development.IDE.Import.FindImports (ArtifactsLocation)
@@ -353,6 +354,8 @@ type instance RuleResult GetModSummary = ModSummaryResult
353354
-- | Generate a ModSummary with the timestamps and preprocessed content elided, for more successful early cutoff
354355
type instance RuleResult GetModSummaryWithoutTimestamps = ModSummaryResult
355356

357+
type instance RuleResult GetFilesOfInterest = HashMap NormalizedFilePath FileOfInterestStatus
358+
356359
data GetParsedModule = GetParsedModule
357360
deriving (Eq, Show, Typeable, Generic)
358361
instance Hashable GetParsedModule
@@ -510,6 +513,12 @@ instance Hashable GhcSessionIO
510513
instance NFData GhcSessionIO
511514
instance Binary GhcSessionIO
512515

516+
data GetFilesOfInterest = GetFilesOfInterest
517+
deriving (Eq, Show, Typeable, Generic)
518+
instance Hashable GetFilesOfInterest
519+
instance NFData GetFilesOfInterest
520+
instance Binary GetFilesOfInterest
521+
513522
makeLensesWith
514523
(lensRules & lensField .~ mappingNamer (pure . (++ "L")))
515524
''Splices

ghcide/src/Development/IDE/Core/Rules.hs

-10
Original file line numberDiff line numberDiff line change
@@ -152,16 +152,6 @@ import Control.Applicative
152152
toIdeResult :: Either [FileDiagnostic] v -> IdeResult v
153153
toIdeResult = either (, Nothing) (([],) . Just)
154154

155-
defineNoFile :: IdeRule k v => (k -> Action v) -> Rules ()
156-
defineNoFile f = defineNoDiagnostics $ \k file -> do
157-
if file == emptyFilePath then do res <- f k; return (Just res) else
158-
fail $ "Rule " ++ show k ++ " should always be called with the empty string for a file"
159-
160-
defineEarlyCutOffNoFile :: IdeRule k v => (k -> Action (BS.ByteString, v)) -> Rules ()
161-
defineEarlyCutOffNoFile f = defineEarlyCutoff $ RuleNoDiagnostics $ \k file -> do
162-
if file == emptyFilePath then do (hash, res) <- f k; return (Just hash, Just res) else
163-
fail $ "Rule " ++ show k ++ " should always be called with the empty string for a file"
164-
165155
------------------------------------------------------------
166156
-- Exposed API
167157
------------------------------------------------------------

ghcide/src/Development/IDE/Core/Shake.hs

+11
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ module Development.IDE.Core.Shake(
4444
define, defineNoDiagnostics,
4545
defineEarlyCutoff,
4646
defineOnDisk, needOnDisk, needOnDisks,
47+
defineNoFile, defineEarlyCutOffNoFile,
4748
getDiagnostics,
4849
mRunLspT, mRunLspTCallback,
4950
getHiddenDiagnostics,
@@ -833,6 +834,16 @@ defineEarlyCutoff (Rule op) = addRule $ \(Q (key, file)) (old :: Maybe BS.ByteSt
833834
defineEarlyCutoff (RuleNoDiagnostics op) = addRule $ \(Q (key, file)) (old :: Maybe BS.ByteString) mode -> otTracedAction key file isSuccess $ do
834835
defineEarlyCutoff' False key file old mode $ second (mempty,) <$> op key file
835836

837+
defineNoFile :: IdeRule k v => (k -> Action v) -> Rules ()
838+
defineNoFile f = defineNoDiagnostics $ \k file -> do
839+
if file == emptyFilePath then do res <- f k; return (Just res) else
840+
fail $ "Rule " ++ show k ++ " should always be called with the empty string for a file"
841+
842+
defineEarlyCutOffNoFile :: IdeRule k v => (k -> Action (BS.ByteString, v)) -> Rules ()
843+
defineEarlyCutOffNoFile f = defineEarlyCutoff $ RuleNoDiagnostics $ \k file -> do
844+
if file == emptyFilePath then do (hash, res) <- f k; return (Just hash, Just res) else
845+
fail $ "Rule " ++ show k ++ " should always be called with the empty string for a file"
846+
836847
defineEarlyCutoff'
837848
:: IdeRule k v
838849
=> Bool -- ^ update diagnostics

haskell-language-server.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
cabal-version: 2.4
22
category: Development
33
name: haskell-language-server
4-
version: 1.1.0.0
4+
version: 1.1.0.1
55
synopsis: LSP server for GHC
66
description:
77
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -62,7 +62,7 @@ library
6262
, cryptohash-sha1
6363
, data-default
6464
, ghc
65-
, ghcide ^>=1.2
65+
, ghcide ^>=1.3
6666
, gitrev
6767
, lsp
6868
, hie-bios

hls-graph/hls-graph.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.4
22
name: hls-graph
3-
version: 1.1.0.0
3+
version: 1.3.0.0
44
synopsis: Haskell Language Server internal graph API
55
description:
66
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>

hls-graph/src/Development/IDE/Graph.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Development.IDE.Graph(
77
actionFinally, actionBracket, actionCatch,
88
Shake.ShakeException(..),
99
-- * Configuration
10-
ShakeOptions(shakeThreads, shakeFiles, shakeExtra),
10+
ShakeOptions(shakeAllowRedefineRules, shakeThreads, shakeFiles, shakeExtra),
1111
getShakeExtra, getShakeExtraRules, newShakeExtra,
1212
-- * Explicit parallelism
1313
parallel,

hls-plugin-api/hls-plugin-api.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.4
22
name: hls-plugin-api
3-
version: 1.1.0.0
3+
version: 1.1.0.1
44
synopsis: Haskell Language Server API for plugin communication
55
description:
66
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -50,7 +50,7 @@ library
5050
, opentelemetry
5151
, process
5252
, regex-tdfa >=1.3.1.0
53-
, hls-graph
53+
, hls-graph ^>=1.3
5454
, text
5555
, unordered-containers
5656

hls-plugin-api/src/Ide/Plugin/ConfigUtils.hs

+10-11
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55

66
module Ide.Plugin.ConfigUtils where
77

8-
import qualified Data.Aeson as A
9-
import qualified Data.Aeson.Types as A
10-
import Data.Containers.ListUtils (nubOrd)
11-
import Data.Default (def)
12-
import qualified Data.Dependent.Map as DMap
13-
import qualified Data.Dependent.Sum as DSum
14-
import qualified Data.HashMap.Lazy as HMap
8+
import qualified Data.Aeson as A
9+
import qualified Data.Aeson.Types as A
10+
import Data.Default (def)
11+
import qualified Data.Dependent.Map as DMap
12+
import qualified Data.Dependent.Sum as DSum
13+
import qualified Data.HashMap.Lazy as HMap
14+
import Data.List (nub)
1515
import Ide.Plugin.Config
16-
import Ide.Plugin.Properties (toDefaultJSON,
17-
toVSCodeExtensionSchema)
16+
import Ide.Plugin.Properties (toDefaultJSON, toVSCodeExtensionSchema)
1817
import Ide.Types
1918
import Language.LSP.Types
2019

@@ -65,7 +64,7 @@ pluginsToDefaultConfig IdePlugins {..} =
6564
-- }
6665
--
6766
genericDefaultConfig =
68-
let x = ["diagnosticsOn" A..= True | configHasDiagnostics] <> nubOrd (mconcat (handlersToGenericDefaultConfig <$> handlers))
67+
let x = ["diagnosticsOn" A..= True | configHasDiagnostics] <> nub (mconcat (handlersToGenericDefaultConfig <$> handlers))
6968
in case x of
7069
-- if the plugin has only one capability, we produce globalOn instead of the specific one;
7170
-- otherwise we don't produce globalOn at all
@@ -108,7 +107,7 @@ pluginsToVSCodeExtensionSchema IdePlugins {..} = A.object $ mconcat $ singlePlug
108107
genericSchema =
109108
let x =
110109
[withIdPrefix "diagnosticsOn" A..= schemaEntry "diagnostics" | configHasDiagnostics]
111-
<> nubOrd (mconcat (handlersToGenericSchema <$> handlers))
110+
<> nub (mconcat (handlersToGenericSchema <$> handlers))
112111
in case x of
113112
-- If the plugin has only one capability, we produce globalOn instead of the specific one;
114113
-- otherwise we don't produce globalOn at all

hls-test-utils/hls-test-utils.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.4
22
name: hls-test-utils
3-
version: 1.0.0.0
3+
version: 1.0.0.1
44
synopsis: Utilities used in the tests of Haskell Language Server
55
description:
66
Please see the README on GitHub at <https://github.com/haskell/haskell-language-server#readme>
@@ -41,7 +41,7 @@ library
4141
, directory
4242
, extra
4343
, filepath
44-
, ghcide ^>=1.2
44+
, ghcide >=1.3 && <1.4
4545
, hls-graph
4646
, hls-plugin-api ^>=1.1
4747
, hspec

plugins/hls-brittany-plugin/hls-brittany-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ library
2525
, filepath
2626
, ghc
2727
, ghc-boot-th
28-
, ghcide ^>=1.2
28+
, ghcide >=1.2 && <1.4
2929
, hls-plugin-api ^>=1.1
3030
, lens
3131
, lsp-types

plugins/hls-class-plugin/hls-class-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ library
2929
, containers
3030
, ghc
3131
, ghc-exactprint
32-
, ghcide ^>=1.2
32+
, ghcide >=1.2 && <1.4
3333
, hls-plugin-api ^>=1.1
3434
, lens
3535
, lsp

plugins/hls-eval-plugin/hls-eval-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ library
6161
, ghc
6262
, ghc-boot-th
6363
, ghc-paths
64-
, ghcide ^>=1.2
64+
, ghcide >=1.2 && <1.4
6565
, hashable
6666
, hls-plugin-api ^>=1.1
6767
, lens

plugins/hls-explicit-imports-plugin/hls-explicit-imports-plugin.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
cabal-version: 2.2
22
name: hls-explicit-imports-plugin
3-
version: 1.0.0.1
3+
version: 1.0.0.2
44
synopsis: Explicit imports plugin for Haskell Language Server
55
license: Apache-2.0
66
license-file: LICENSE
@@ -20,7 +20,7 @@ library
2020
, containers
2121
, deepseq
2222
, ghc
23-
, ghcide ^>=1.2
23+
, ghcide ^>=1.3
2424
, hls-plugin-api ^>=1.1
2525
, lsp
2626
, lsp-types

plugins/hls-haddock-comments-plugin/hls-haddock-comments-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ library
2929
, containers
3030
, ghc
3131
, ghc-exactprint
32-
, ghcide ^>=1.2
32+
, ghcide >=1.2 && <1.4
3333
, hls-plugin-api ^>=1.1
3434
, lsp-types
3535
, text

plugins/hls-hlint-plugin/hls-hlint-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ library
4141
, extra
4242
, filepath
4343
, ghc-exactprint >=0.6.3.4
44-
, ghcide ^>=1.2
44+
, ghcide >=1.2 && <1.4
4545
, hashable
4646
, hlint ^>=3.2
4747
, hls-plugin-api ^>=1.1

plugins/hls-refine-imports-plugin/hls-refine-imports-plugin.cabal

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ extra-source-files:
1414
library
1515
exposed-modules: Ide.Plugin.RefineImports
1616
hs-source-dirs: src
17-
build-depends:
17+
build-depends:
1818
, aeson
1919
, base >=4.12 && <5
2020
, containers
2121
, deepseq
2222
, ghc
23-
, ghcide ^>=1.2
23+
, ghcide ^>=1.3
2424
, hls-plugin-api ^>=1.1
2525
, lsp
2626
, lsp-types

plugins/hls-retrie-plugin/hls-retrie-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ library
2222
, directory
2323
, extra
2424
, ghc
25-
, ghcide ^>=1.2
25+
, ghcide >=1.2 && <1.4
2626
, hashable
2727
, hls-plugin-api ^>=1.1
2828
, lsp

plugins/hls-splice-plugin/hls-splice-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ library
4040
, foldl
4141
, ghc
4242
, ghc-exactprint
43-
, ghcide ^>=1.2
43+
, ghcide >=1.2 && <1.4
4444
, hls-plugin-api ^>=1.1
4545
, lens
4646
, lsp

plugins/hls-stylish-haskell-plugin/hls-stylish-haskell-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ library
2222
, filepath
2323
, ghc
2424
, ghc-boot-th
25-
, ghcide ^>=1.2
25+
, ghcide >=1.2 && <1.4
2626
, hls-plugin-api ^>=1.1
2727
, lsp-types
2828
, mtl

0 commit comments

Comments
 (0)