Skip to content

Commit 8ea5d69

Browse files
authored
Upgrade to haskell-lsp 0.19 (#254)
* Upgrade to haskell-lsp 0.19 * Clarify version handling
1 parent 0838dcb commit 8ea5d69

File tree

6 files changed

+17
-13
lines changed

6 files changed

+17
-13
lines changed

ghcide.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ library
4141
extra,
4242
filepath,
4343
hashable,
44-
haskell-lsp-types >= 0.18,
45-
haskell-lsp >= 0.18,
44+
haskell-lsp-types == 0.19.*,
45+
haskell-lsp == 0.19.*,
4646
mtl,
4747
network-uri,
4848
prettyprinter-ansi-terminal,

src/Development/IDE/Core/FileStore.hs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ makeVFSHandle = do
7676
modifyVar_ vfsVar $ \(nextVersion, vfs) -> pure $ (nextVersion + 1, ) $
7777
case content of
7878
Nothing -> Map.delete uri vfs
79-
Just content -> Map.insert uri (VirtualFile nextVersion (Rope.fromText content)) vfs
79+
-- The second version number is only used in persistFileVFS which we do not use so we set it to 0.
80+
Just content -> Map.insert uri (VirtualFile nextVersion 0 (Rope.fromText content)) vfs
8081
}
8182

8283
makeLSPVFSHandle :: LspFuncs c -> VFSHandle
@@ -139,7 +140,7 @@ getModificationTimeRule vfs =
139140
alwaysRerun
140141
mbVirtual <- liftIO $ getVirtualFile vfs $ filePathToUri' file
141142
case mbVirtual of
142-
Just (VirtualFile ver _) -> pure (Just $ BS.pack $ show ver, ([], Just $ VFSVersion ver))
143+
Just (virtualFileVersion -> ver) -> pure (Just $ BS.pack $ show ver, ([], Just $ VFSVersion ver))
143144
Nothing -> liftIO $ fmap wrap (getModTime file')
144145
`catch` \(e :: IOException) -> do
145146
let err | isDoesNotExistError e = "File does not exist: " ++ file'

stack-ghc-lib.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ resolver: nightly-2019-09-16
22
packages:
33
- .
44
extra-deps:
5-
- haskell-lsp-0.18.0.0
6-
- haskell-lsp-types-0.18.0.0
7-
- lsp-test-0.8.2.0
5+
- haskell-lsp-0.19.0.0
6+
- haskell-lsp-types-0.19.0.0
7+
- lsp-test-0.9.0.0
88
- hie-bios-0.3.0
99
- ghc-lib-parser-8.8.1
1010
- ghc-lib-8.8.1

stack.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ resolver: nightly-2019-09-16
22
packages:
33
- .
44
extra-deps:
5-
- haskell-lsp-0.18.0.0
6-
- haskell-lsp-types-0.18.0.0
7-
- lsp-test-0.8.2.0
5+
- haskell-lsp-0.19.0.0
6+
- haskell-lsp-types-0.19.0.0
7+
- lsp-test-0.9.0.0
88
- hie-bios-0.3.0
99
nix:
1010
packages: [zlib]

stack84.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ packages:
33
- .
44

55
extra-deps:
6-
- haskell-lsp-0.18.0.0
7-
- haskell-lsp-types-0.18.0.0
8-
- lsp-test-0.8.2.0
6+
- haskell-lsp-0.19.0.0
7+
- haskell-lsp-types-0.19.0.0
8+
- lsp-test-0.9.0.0
99
- rope-utf16-splay-0.3.1.0
1010
- shake-0.18.3
1111
- filepattern-0.1.1

stack88.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ resolver: nightly-2019-12-06
22
packages:
33
- .
44
extra-deps:
5+
- haskell-lsp-0.19.0.0
6+
- haskell-lsp-types-0.19.0.0
7+
- lsp-test-0.9.0.0
58
- hie-bios-0.3.0
69
allow-newer: true
710
nix:

0 commit comments

Comments
 (0)