Skip to content

Commit

Permalink
Upgrade to haskell-lsp 0.19 (haskell/ghcide#254)
Browse files Browse the repository at this point in the history
* Upgrade to haskell-lsp 0.19

* Clarify version handling
  • Loading branch information
cocreature authored Dec 16, 2019
1 parent 1b5dd50 commit ffca7ef
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 13 deletions.
4 changes: 2 additions & 2 deletions ghcide/ghcide.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ library
extra,
filepath,
hashable,
haskell-lsp-types >= 0.18,
haskell-lsp >= 0.18,
haskell-lsp-types == 0.19.*,
haskell-lsp == 0.19.*,
mtl,
network-uri,
prettyprinter-ansi-terminal,
Expand Down
5 changes: 3 additions & 2 deletions ghcide/src/Development/IDE/Core/FileStore.hs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ makeVFSHandle = do
modifyVar_ vfsVar $ \(nextVersion, vfs) -> pure $ (nextVersion + 1, ) $
case content of
Nothing -> Map.delete uri vfs
Just content -> Map.insert uri (VirtualFile nextVersion (Rope.fromText content)) vfs
-- The second version number is only used in persistFileVFS which we do not use so we set it to 0.
Just content -> Map.insert uri (VirtualFile nextVersion 0 (Rope.fromText content)) vfs
}

makeLSPVFSHandle :: LspFuncs c -> VFSHandle
Expand Down Expand Up @@ -139,7 +140,7 @@ getModificationTimeRule vfs =
alwaysRerun
mbVirtual <- liftIO $ getVirtualFile vfs $ filePathToUri' file
case mbVirtual of
Just (VirtualFile ver _) -> pure (Just $ BS.pack $ show ver, ([], Just $ VFSVersion ver))
Just (virtualFileVersion -> ver) -> pure (Just $ BS.pack $ show ver, ([], Just $ VFSVersion ver))
Nothing -> liftIO $ fmap wrap (getModTime file')
`catch` \(e :: IOException) -> do
let err | isDoesNotExistError e = "File does not exist: " ++ file'
Expand Down
6 changes: 3 additions & 3 deletions ghcide/stack-ghc-lib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ resolver: nightly-2019-09-16
packages:
- .
extra-deps:
- haskell-lsp-0.18.0.0
- haskell-lsp-types-0.18.0.0
- lsp-test-0.8.2.0
- haskell-lsp-0.19.0.0
- haskell-lsp-types-0.19.0.0
- lsp-test-0.9.0.0
- hie-bios-0.3.0
- ghc-lib-parser-8.8.1
- ghc-lib-8.8.1
Expand Down
6 changes: 3 additions & 3 deletions ghcide/stack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ resolver: nightly-2019-09-16
packages:
- .
extra-deps:
- haskell-lsp-0.18.0.0
- haskell-lsp-types-0.18.0.0
- lsp-test-0.8.2.0
- haskell-lsp-0.19.0.0
- haskell-lsp-types-0.19.0.0
- lsp-test-0.9.0.0
- hie-bios-0.3.0
nix:
packages: [zlib]
6 changes: 3 additions & 3 deletions ghcide/stack84.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ packages:
- .

extra-deps:
- haskell-lsp-0.18.0.0
- haskell-lsp-types-0.18.0.0
- lsp-test-0.8.2.0
- haskell-lsp-0.19.0.0
- haskell-lsp-types-0.19.0.0
- lsp-test-0.9.0.0
- rope-utf16-splay-0.3.1.0
- shake-0.18.3
- filepattern-0.1.1
Expand Down
3 changes: 3 additions & 0 deletions ghcide/stack88.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ resolver: nightly-2019-12-06
packages:
- .
extra-deps:
- haskell-lsp-0.19.0.0
- haskell-lsp-types-0.19.0.0
- lsp-test-0.9.0.0
- hie-bios-0.3.0
allow-newer: true
nix:
Expand Down

0 comments on commit ffca7ef

Please sign in to comment.