Skip to content

Commit 71fa432

Browse files
pepeiborramergify-bot
authored and
mergify-bot
committed
Build with lsp 1.2.0.1 (#2059)
* Fix lsp dependency in cabal * Fix lsp dependency in stack * Fix build with lsp-types 1.3.0.0 * fix tests (cherry picked from commit 2fef041)
1 parent e7c5e90 commit 71fa432

File tree

31 files changed

+144
-155
lines changed

31 files changed

+144
-155
lines changed

Diff for: cabal-ghc901.project

+1-10
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,6 @@ source-repository-package
6767
subdir: dependent-sum-template
6868
-- https://github.com/obsidiansystems/dependent-sum/pull/57
6969

70-
source-repository-package
71-
type: git
72-
location: https://github.com/anka-213/lsp
73-
tag: tag-ghc-9.0.1-without-pr-326
74-
subdir: lsp-types
75-
subdir: lsp
76-
subdir: lsp-test
77-
-- https://github.com/haskell/lsp/pull/312
78-
7970
-- benchmark dependency
8071
source-repository-package
8172
type: git
@@ -84,7 +75,7 @@ source-repository-package
8475

8576
write-ghc-environment-files: never
8677

87-
index-state: 2021-07-14T20:31:09Z
78+
index-state: 2021-08-01T00:00:00Z
8879

8980
constraints:
9081
-- These plugins doesn't work on GHC9 yet

Diff for: cabal.project

+1-18
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ source-repository-package
3737

3838
write-ghc-environment-files: never
3939

40-
index-state: 2021-07-14T20:31:09Z
40+
index-state: 2021-08-01T00:00:00Z
4141

4242
constraints:
4343
-- Diagrams doesn't support optparse-applicative >= 0.16 yet
@@ -85,20 +85,3 @@ allow-newer:
8585
these:base,
8686
time-compat:base
8787

88-
source-repository-package
89-
type: git
90-
location: https://github.com/haskell/lsp.git
91-
tag: ef59c28b41ed4c5775f0ab0c1e985839359cec96
92-
subdir: lsp-types
93-
94-
source-repository-package
95-
type: git
96-
location: https://github.com/haskell/lsp.git
97-
tag: ef59c28b41ed4c5775f0ab0c1e985839359cec96
98-
subdir: lsp-test
99-
100-
source-repository-package
101-
type: git
102-
location: https://github.com/haskell/lsp.git
103-
tag: ef59c28b41ed4c5775f0ab0c1e985839359cec96
104-
subdir: lsp

Diff for: ghcide/bench/lib/Experiments.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ import Development.Shake (CmdOption (Cwd, FileStdout),
3636
cmd_)
3737
import Experiments.Types
3838
import Language.LSP.Test
39-
import Language.LSP.Types
39+
import Language.LSP.Types hiding
40+
(SemanticTokenAbsolute (length, line),
41+
SemanticTokenRelative (length),
42+
SemanticTokensEdit (_start))
4043
import Language.LSP.Types.Capabilities
4144
import Numeric.Natural
4245
import Options.Applicative

Diff for: ghcide/src/Development/IDE/Core/PositionMapping.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ import Data.Bifunctor
3030
import Data.List
3131
import qualified Data.Text as T
3232
import qualified Data.Vector.Unboxed as V
33-
import Language.LSP.Types
33+
import Language.LSP.Types (Position (Position), Range (Range),
34+
TextDocumentContentChangeEvent (TextDocumentContentChangeEvent))
3435

3536
-- | Either an exact position, or the range of text that was substituted
3637
data PositionResult a

Diff for: ghcide/src/Development/IDE/LSP/Outline.hs

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@ import Development.IDE.GHC.Error (rangeToRealSrcSpan,
2222
realSrcSpanToRange)
2323
import Development.IDE.Types.Location
2424
import Language.LSP.Server (LspM)
25-
import Language.LSP.Types
25+
import Language.LSP.Types (DocumentSymbol (..),
26+
DocumentSymbolParams (DocumentSymbolParams, _textDocument),
27+
List (..), ResponseError,
28+
SymbolInformation,
29+
SymbolKind (SkConstructor, SkField, SkFile, SkFunction, SkInterface, SkMethod, SkModule, SkObject, SkStruct, SkTypeParameter, SkUnknown),
30+
TextDocumentIdentifier (TextDocumentIdentifier),
31+
type (|?) (InL), uriToFilePath)
2632
import Outputable (Outputable, ppr,
2733
showSDocUnsafe)
2834

Diff for: ghcide/src/Development/IDE/Plugin/CodeAction.hs

+14-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,20 @@ import HscTypes (ImportedMods
6262
import Ide.PluginUtils (subRange)
6363
import Ide.Types
6464
import qualified Language.LSP.Server as LSP
65-
import Language.LSP.Types
65+
import Language.LSP.Types (CodeAction (..),
66+
CodeActionContext (CodeActionContext, _diagnostics),
67+
CodeActionKind (CodeActionQuickFix, CodeActionUnknown),
68+
CodeActionParams (CodeActionParams),
69+
Command,
70+
Diagnostic (..),
71+
List (..),
72+
ResponseError,
73+
SMethod (STextDocumentCodeAction),
74+
TextDocumentIdentifier (TextDocumentIdentifier),
75+
TextEdit (TextEdit),
76+
WorkspaceEdit (WorkspaceEdit, _changeAnnotations, _changes, _documentChanges),
77+
type (|?) (InR),
78+
uriToFilePath)
6679
import Language.LSP.VFS
6780
import Module (moduleEnvElts)
6881
import OccName

Diff for: ghcide/src/Development/IDE/Plugin/CodeAction/PositionIndexed.hs

+2-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ where
1212

1313
import Data.Char
1414
import Data.List
15-
import Language.LSP.Types
15+
import Language.LSP.Types (Position (Position),
16+
Range (Range, _end, _start))
1617

1718
type PositionIndexed a = [(Position, a)]
1819

Diff for: ghcide/src/Development/IDE/Spans/AtPoint.hs

+1-1
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ atPoint IdeOptions{} (HAR _ hf _ _ kind) (DKMap dm km) df pos = listToMaybe $ po
206206
hoverInfo ast = (Just range, prettyNames ++ pTypes)
207207
where
208208
pTypes
209-
| length names == 1 = dropEnd1 $ map wrapHaskell prettyTypes
209+
| Prelude.length names == 1 = dropEnd1 $ map wrapHaskell prettyTypes
210210
| otherwise = map wrapHaskell prettyTypes
211211

212212
range = realSrcSpanToRange $ nodeSpan ast

Diff for: ghcide/test/exe/Main.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ import Development.Shake (getDirectoryFilesIO)
6060
import qualified Experiments as Bench
6161
import Ide.Plugin.Config
6262
import Language.LSP.Test
63-
import Language.LSP.Types hiding (mkRange)
63+
import Language.LSP.Types hiding
64+
(mkRange, SemanticTokenAbsolute (length, line),
65+
SemanticTokenRelative (length),
66+
SemanticTokensEdit (_start))
6467
import Language.LSP.Types.Capabilities
6568
import qualified Language.LSP.Types.Lens as Lsp (diagnostics,
6669
message,

Diff for: ghcide/test/src/Development/IDE/Test.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ import Development.IDE.Plugin.Test (TestRequest (..),
3636
import Development.IDE.Test.Diagnostic
3737
import Language.LSP.Test hiding (message)
3838
import qualified Language.LSP.Test as LspTest
39-
import Language.LSP.Types
39+
import Language.LSP.Types hiding
40+
(SemanticTokenAbsolute (length, line),
41+
SemanticTokenRelative (length),
42+
SemanticTokensEdit (_start))
4043
import Language.LSP.Types.Lens as Lsp
4144
import System.Directory (canonicalizePath)
4245
import System.Time.Extra

Diff for: hls-plugin-api/hls-plugin-api.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ library
4949
, hls-graph ^>=1.4
5050
, hslogger
5151
, lens
52-
, lsp ^>=1.2
52+
, lsp ^>=1.2.0.1
5353
, opentelemetry
5454
, optparse-applicative
5555
, process

Diff for: hls-plugin-api/src/Ide/PluginUtils.hs

+8-6
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,19 @@ where
3030

3131
import Data.Algorithm.Diff
3232
import Data.Algorithm.DiffOutput
33+
import Data.Containers.ListUtils (nubOrdOn)
3334
import qualified Data.HashMap.Strict as H
3435
import qualified Data.Text as T
35-
import Ide.Types
36-
import Language.LSP.Types
37-
import qualified Language.LSP.Types as J
38-
import Language.LSP.Types.Capabilities
39-
40-
import Data.Containers.ListUtils (nubOrdOn)
4136
import Ide.Plugin.Config
4237
import Ide.Plugin.Properties
38+
import Ide.Types
4339
import Language.LSP.Server
40+
import Language.LSP.Types hiding
41+
(SemanticTokenAbsolute (length, line),
42+
SemanticTokenRelative (length),
43+
SemanticTokensEdit (_start))
44+
import qualified Language.LSP.Types as J
45+
import Language.LSP.Types.Capabilities
4446

4547
-- ---------------------------------------------------------------------
4648

Diff for: hls-plugin-api/src/Ide/Types.hs

+32-20
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
{-# LANGUAGE BangPatterns #-}
2-
{-# LANGUAGE CPP #-}
3-
{-# LANGUAGE ConstraintKinds #-}
4-
{-# LANGUAGE DefaultSignatures #-}
5-
{-# LANGUAGE DeriveAnyClass #-}
6-
{-# LANGUAGE DeriveGeneric #-}
7-
{-# LANGUAGE DerivingStrategies #-}
8-
{-# LANGUAGE FlexibleContexts #-}
9-
{-# LANGUAGE FlexibleInstances #-}
10-
{-# LANGUAGE GADTs #-}
1+
{-# LANGUAGE BangPatterns #-}
2+
{-# LANGUAGE CPP #-}
3+
{-# LANGUAGE ConstraintKinds #-}
4+
{-# LANGUAGE DefaultSignatures #-}
5+
{-# LANGUAGE DeriveAnyClass #-}
6+
{-# LANGUAGE DeriveGeneric #-}
7+
{-# LANGUAGE DerivingStrategies #-}
8+
{-# LANGUAGE FlexibleContexts #-}
9+
{-# LANGUAGE FlexibleInstances #-}
10+
{-# LANGUAGE GADTs #-}
1111
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
12-
{-# LANGUAGE OverloadedStrings #-}
13-
{-# LANGUAGE PolyKinds #-}
14-
{-# LANGUAGE ScopedTypeVariables #-}
15-
{-# LANGUAGE TypeFamilies #-}
16-
{-# LANGUAGE UndecidableInstances #-}
17-
{-# LANGUAGE ViewPatterns #-}
12+
{-# LANGUAGE OverloadedStrings #-}
13+
{-# LANGUAGE PolyKinds #-}
14+
{-# LANGUAGE ScopedTypeVariables #-}
15+
{-# LANGUAGE TypeFamilies #-}
16+
{-# LANGUAGE UndecidableInstances #-}
17+
{-# LANGUAGE ViewPatterns #-}
1818

1919
module Ide.Types
2020
where
@@ -46,9 +46,21 @@ import GHC.Generics
4646
import Ide.Plugin.Config
4747
import Ide.Plugin.Properties
4848
import Language.LSP.Server (LspM, getVirtualFile)
49-
import Language.LSP.Types
50-
import Language.LSP.Types.Capabilities
51-
import Language.LSP.Types.Lens as J hiding (id)
49+
import Language.LSP.Types hiding (SemanticTokenAbsolute(length, line), SemanticTokenRelative(length), SemanticTokensEdit(_start))
50+
import Language.LSP.Types.Capabilities (ClientCapabilities (ClientCapabilities),
51+
TextDocumentClientCapabilities (_codeAction, _documentSymbol))
52+
import Language.LSP.Types.Lens as J (HasChildren (children),
53+
HasCommand (command),
54+
HasContents (contents),
55+
HasDeprecated (deprecated),
56+
HasEdit (edit),
57+
HasKind (kind),
58+
HasName (name),
59+
HasOptions (..),
60+
HasRange (range),
61+
HasTextDocument (..),
62+
HasTitle (title),
63+
HasUri (..))
5264
import Language.LSP.VFS
5365
import OpenTelemetry.Eventlog
5466
import Options.Applicative (ParserInfo)
@@ -467,7 +479,7 @@ instance HasTracing CallHierarchyOutgoingCallsParams
467479
-- ---------------------------------------------------------------------
468480

469481
{-# NOINLINE pROCESS_ID #-}
470-
{-# LANGUAGE DerivingStrategies #-}
482+
{-# LANGUAGE DerivingStrategies #-}
471483
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
472484
pROCESS_ID :: T.Text
473485
pROCESS_ID = unsafePerformIO getPid

Diff for: hls-test-utils/src/Test/Hls.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ import Ide.Plugin.Config (Config, formattingProvider)
4747
import Ide.PluginUtils (pluginDescToIdePlugins)
4848
import Ide.Types
4949
import Language.LSP.Test
50-
import Language.LSP.Types
50+
import Language.LSP.Types hiding
51+
(SemanticTokenAbsolute (length, line),
52+
SemanticTokenRelative (length),
53+
SemanticTokensEdit (_start))
5154
import Language.LSP.Types.Capabilities (ClientCapabilities)
5255
import System.Directory (getCurrentDirectory,
5356
setCurrentDirectory)

Diff for: plugins/hls-call-hierarchy-plugin/hls-call-hierarchy-plugin.cabal

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ library
3232
, hiedb
3333
, hls-plugin-api ^>=1.2
3434
, lens
35-
, lsp
35+
, lsp >=1.2.0.1
3636
, sqlite-simple
3737
, text
3838
, unordered-containers

Diff for: plugins/hls-eval-plugin/src/Ide/Plugin/Eval/CodeLens.hs

+8-5
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ import Ide.Plugin.Eval.Util (asS, gStrictTry,
141141
response', timed)
142142
import Ide.Types
143143
import Language.LSP.Server
144-
import Language.LSP.Types
144+
import Language.LSP.Types hiding
145+
(SemanticTokenAbsolute (length, line),
146+
SemanticTokenRelative (length))
145147
import Language.LSP.Types.Lens (end, line)
146148
import Language.LSP.VFS (virtualFileText)
147149
import Outputable (SDoc, empty, hang, nest,
@@ -153,14 +155,15 @@ import UnliftIO.Temporary (withSystemTempFile)
153155
import Util (OverridingBool (Never))
154156

155157
import IfaceSyn (showToHeader)
156-
import PprTyThing (pprTyThingInContext, pprTypeForUser)
158+
import PprTyThing (pprTyThingInContext,
159+
pprTypeForUser)
157160
#if MIN_VERSION_ghc(9,0,0)
158-
import GHC.Parser.Annotation (ApiAnns (apiAnnRogueComments))
159-
import GHC.Parser.Lexer (mkParserFlags)
160161
import GHC.Driver.Ways (hostFullWays,
161162
wayGeneralFlags,
162163
wayUnsetGeneralFlags)
163-
import GHC.Types.SrcLoc (UnhelpfulSpanReason(UnhelpfulInteractive))
164+
import GHC.Parser.Annotation (ApiAnns (apiAnnRogueComments))
165+
import GHC.Parser.Lexer (mkParserFlags)
166+
import GHC.Types.SrcLoc (UnhelpfulSpanReason (UnhelpfulInteractive))
164167
#else
165168
import GhcPlugins (interpWays, updateWays,
166169
wayGeneralFlags,

Diff for: plugins/hls-hlint-plugin/src/Ide/Plugin/Hlint.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,10 @@ import Language.Haskell.HLint as Hlint hid
9191
import Language.LSP.Server (ProgressCancellable (Cancellable),
9292
sendRequest,
9393
withIndefiniteProgress)
94-
import Language.LSP.Types
94+
import Language.LSP.Types hiding
95+
(SemanticTokenAbsolute (length, line),
96+
SemanticTokenRelative (length),
97+
SemanticTokensEdit (_start))
9598
import qualified Language.LSP.Types as LSP
9699
import qualified Language.LSP.Types.Lens as LSP
97100

Diff for: plugins/hls-module-name-plugin/src/Ide/Plugin/ModuleName.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ import Development.IDE.GHC.Compat (GenLocated (L), getSessionDynFlags,
3636
pm_parsed_source, unLoc)
3737
import Ide.Types
3838
import Language.LSP.Server
39-
import Language.LSP.Types
39+
import Language.LSP.Types hiding
40+
(SemanticTokenAbsolute (length, line),
41+
SemanticTokenRelative (length),
42+
SemanticTokensEdit (_start))
4043
import Language.LSP.VFS (virtualFileText)
4144
import System.Directory (canonicalizePath)
4245
import System.FilePath (dropExtension, splitDirectories,

Diff for: plugins/hls-retrie-plugin/src/Ide/Plugin/Retrie.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,10 @@ import Language.LSP.Server (LspM,
8686
sendNotification,
8787
sendRequest,
8888
withIndefiniteProgress)
89-
import Language.LSP.Types as J
89+
import Language.LSP.Types as J hiding
90+
(SemanticTokenAbsolute (length, line),
91+
SemanticTokenRelative (length),
92+
SemanticTokensEdit (_start))
9093
import Retrie.CPP (CPP (NoCPP), parseCPP)
9194
import Retrie.ExactPrint (fix, relativiseApiAnns,
9295
transformA, unsafeMkA)

Diff for: plugins/hls-tactics-plugin/src/Wingman/LanguageServer.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ import Ide.Types (PluginId)
5252
import Language.Haskell.GHC.ExactPrint (Transform)
5353
import Language.Haskell.GHC.ExactPrint (modifyAnnsT, addAnnotationsForPretty)
5454
import Language.LSP.Server (MonadLsp, sendNotification)
55-
import Language.LSP.Types
55+
import Language.LSP.Types hiding
56+
(SemanticTokenAbsolute (length, line),
57+
SemanticTokenRelative (length),
58+
SemanticTokensEdit (_start))
5659
import Language.LSP.Types.Capabilities
5760
import OccName
5861
import Prelude hiding (span)

Diff for: plugins/hls-tactics-plugin/src/Wingman/LanguageServer/TacticProviders.hs

+4-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ import GHC.Generics
2727
import GHC.LanguageExtensions.Type (Extension (LambdaCase))
2828
import Ide.PluginUtils
2929
import Ide.Types
30-
import Language.LSP.Types
30+
import Language.LSP.Types hiding
31+
(SemanticTokenAbsolute (length, line),
32+
SemanticTokenRelative (length),
33+
SemanticTokensEdit (_start))
3134
import OccName
3235
import Prelude hiding (span)
3336
import Wingman.Auto

0 commit comments

Comments
 (0)