Skip to content

Commit 2fef041

Browse files
authored
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
1 parent 0e1e1a2 commit 2fef041

File tree

31 files changed

+144
-155
lines changed

31 files changed

+144
-155
lines changed

cabal-ghc901.project

Lines changed: 1 addition & 10 deletions
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

cabal.project

Lines changed: 1 addition & 18 deletions
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

ghcide/bench/lib/Experiments.hs

Lines changed: 4 additions & 1 deletion
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

ghcide/src/Development/IDE/Core/PositionMapping.hs

Lines changed: 2 additions & 1 deletion
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

ghcide/src/Development/IDE/LSP/Outline.hs

Lines changed: 7 additions & 1 deletion
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

ghcide/src/Development/IDE/Plugin/CodeAction.hs

Lines changed: 14 additions & 1 deletion
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

ghcide/src/Development/IDE/Plugin/CodeAction/PositionIndexed.hs

Lines changed: 2 additions & 1 deletion
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

ghcide/src/Development/IDE/Spans/AtPoint.hs

Lines changed: 1 addition & 1 deletion
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

ghcide/test/exe/Main.hs

Lines changed: 4 additions & 1 deletion
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,

ghcide/test/src/Development/IDE/Test.hs

Lines changed: 4 additions & 1 deletion
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

0 commit comments

Comments
 (0)