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: diff --git a/ghcide/ghcide.cabal b/ghcide/ghcide.cabal index b394f55cff..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.*, + 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