From 7c7e3f0a2c49bb440320f919fd32d881c5f704c8 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 27 Jun 2021 14:46:24 +0100 Subject: [PATCH 1/3] follow change in lsp-types --- ghcide/ghcide.cabal | 6 +++--- ghcide/src/Development/IDE/Types/Location.hs | 5 +++++ hls-test-utils/hls-test-utils.cabal | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index b394f55cff..f2c8bae30d 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -60,7 +60,7 @@ library hls-plugin-api ^>= 1.1.0.0, lens, hiedb == 0.3.0.*, - lsp-types == 1.2.*, + lsp-types >= 1.2 < 1.4, lsp == 1.2.*, mtl, network-uri, @@ -343,7 +343,7 @@ test-suite ghcide-tests hls-plugin-api, network-uri, lens, - lsp-test == 0.14.0.0, + lsp-test ^>= 0.14, optparse-applicative, process, QuickCheck, @@ -403,7 +403,7 @@ executable ghcide-bench extra, filepath, ghcide, - lsp-test == 0.14.0.0, + lsp-test, optparse-applicative, process, safe-exceptions, diff --git a/ghcide/src/Development/IDE/Types/Location.hs b/ghcide/src/Development/IDE/Types/Location.hs index e196ba29e4..7176499ced 100644 --- a/ghcide/src/Development/IDE/Types/Location.hs +++ b/ghcide/src/Development/IDE/Types/Location.hs @@ -1,5 +1,6 @@ -- Copyright (c) 2019 The DAML Authors. All rights reserved. -- SPDX-License-Identifier: Apache-2.0 +{-# LANGUAGE CPP #-} -- | Types and functions for working with source code locations. @@ -43,7 +44,11 @@ toNormalizedFilePath' "" = emptyFilePath toNormalizedFilePath' fp = LSP.toNormalizedFilePath fp emptyFilePath :: LSP.NormalizedFilePath +#if MIN_VERSION_lsp_types(1,3,0) +emptyFilePath = LSP.normalizedFilePath emptyPathUri "" +#else emptyFilePath = LSP.NormalizedFilePath emptyPathUri "" +#endif -- | We use an empty string as a filepath when we don’t have a file. -- However, haskell-lsp doesn’t support that in uriToFilePath and given diff --git a/hls-test-utils/hls-test-utils.cabal b/hls-test-utils/hls-test-utils.cabal index a0152d3a61..43a4c63a81 100644 --- a/hls-test-utils/hls-test-utils.cabal +++ b/hls-test-utils/hls-test-utils.cabal @@ -48,8 +48,8 @@ library , hspec-core , lens , lsp ^>=1.2 - , lsp-test ==0.14.0.0 - , lsp-types ^>=1.2 + , lsp-test ^>=0.14 + , lsp-types >=1.2 && < 1.4 , tasty , tasty-expected-failure , tasty-golden From 9484fca694a9f7d0a3e195328b9fd0a8a94b6495 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Sun, 27 Jun 2021 16:13:30 +0100 Subject: [PATCH 2/3] fix version constraint --- ghcide/ghcide.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index f2c8bae30d..8f5cea2595 100644 --- a/ghcide/ghcide.cabal +++ b/ghcide/ghcide.cabal @@ -60,7 +60,7 @@ library hls-plugin-api ^>= 1.1.0.0, lens, hiedb == 0.3.0.*, - lsp-types >= 1.2 < 1.4, + lsp-types >= 1.2 && < 1.4, lsp == 1.2.*, mtl, network-uri, From 03e30dbcb75e7c5d09bb7a5e0c074cf84d7d6579 Mon Sep 17 00:00:00 2001 From: Pepe Iborra Date: Tue, 29 Jun 2021 08:51:57 +0100 Subject: [PATCH 3/3] Fix hlint --- ghcide/.hlint.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/ghcide/.hlint.yaml b/ghcide/.hlint.yaml index 2406c24949..2bb82f5a5a 100644 --- a/ghcide/.hlint.yaml +++ b/ghcide/.hlint.yaml @@ -106,6 +106,7 @@ - Development.IDE.Plugin.CodeAction - Development.IDE.Plugin.Completions - Development.IDE.Plugin.Completions.Logic + - Development.IDE.Types.Location - Main - flags: