Skip to content

Commit 3f978cb

Browse files
authored
Merge pull request bubba/lsp-test/#68 from wz1000/singleton-methods
WIP: Initial attempt at updating for singleton-methods
2 parents 791bb4f + bd47b86 commit 3f978cb

File tree

20 files changed

+916
-974
lines changed

20 files changed

+916
-974
lines changed

lsp-test/.github/workflows/haskell.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717

1818
steps:
1919
- uses: actions/checkout@v2
20-
- uses: actions/[email protected].1
20+
- uses: actions/[email protected].4
2121
with:
2222
ghc-version: ${{ matrix.ghc }}
2323
cabal-version: '3.2'

lsp-test/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
lsp-test is a functional testing framework for Language Server Protocol servers.
33

44
```haskell
5-
import Language.Haskell.LSP.Test
5+
import Language.LSP.Test
66
main = runSession "hie" fullCaps "proj/dir" $ do
77
doc <- openDoc "Foo.hs" "haskell"
88
skipMany anyNotification

lsp-test/cabal.project

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
packages: .
2+
./example
23
flags: +DummyServer
34
test-show-details: direct
45
haddock-quickjump: True

lsp-test/example/Test.hs

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import Control.Applicative.Combinators
22
import Control.Monad.IO.Class
3-
import Language.Haskell.LSP.Test
4-
import Language.Haskell.LSP.Types
3+
import Language.LSP.Test
4+
import Language.LSP.Types
55

6-
main = runSession "hie" fullCaps "../test/data/" $ do
7-
docItem <- openDoc "Rename.hs" "haskell"
6+
main = runSession "haskell-language-server" fullCaps "../test/data/" $ do
7+
doc <- openDoc "Rename.hs" "haskell"
88

99
-- Use your favourite favourite combinators.
1010
skipManyTill loggingNotification (count 2 publishDiagnosticsNotification)
1111

1212
-- Send requests and notifications and receive responses
13-
let params = DocumentSymbolParams docItem
14-
rsp <- request TextDocumentDocumentSymbol params :: Session DocumentSymbolsResponse
13+
rsp <- request STextDocumentDocumentSymbol $
14+
DocumentSymbolParams Nothing Nothing doc
1515
liftIO $ print rsp
1616

1717
-- Or use one of the helper functions
18-
getDocumentSymbols docItem >>= liftIO . print
18+
getDocumentSymbols doc >>= liftIO . print
1919

lsp-test/hie.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
cradle:
2+
multi:
3+
- path: "./test/data/"
4+
config: { cradle: { none: } }
5+
- path: "./example/"
6+
config: { cradle: { none: } }
7+
- path: "./"
8+
config:
9+
cradle:
10+
cabal:
11+
- path: "src"
12+
component: "lib:lsp-test"
13+
- path: "test/dummy-server"
14+
component: "exe:dummy-server"
15+
- path: "test"
16+
component: "test:tests"

lsp-test/lsp-test.cabal

+22-21
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ synopsis: Functional test framework for LSP servers.
44
description:
55
A test framework for writing tests against
66
<https://microsoft.github.io/language-server-protocol/ Language Server Protocol servers>.
7-
@Language.Haskell.LSP.Test@ launches your server as a subprocess and allows you to simulate a session
8-
down to the wire, and @Language.Haskell.LSP.Test@ can replay captured sessions from
7+
@Language.LSP.Test@ launches your server as a subprocess and allows you to simulate a session
8+
down to the wire, and @Language.LSP.Test@ can replay captured sessions from
99
<haskell-lsp https://hackage.haskell.org/package/haskell-lsp>.
1010
To see examples of it in action, check out <https://github.com/haskell/haskell-ide-engine haskell-ide-engine>,
1111
<https://github.com/haskell/haskell-language-server haskell-language-server> and
@@ -22,7 +22,7 @@ build-type: Simple
2222
cabal-version: 2.0
2323
extra-source-files: README.md
2424
, ChangeLog.md
25-
tested-with: GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.3, GHC == 8.10.1
25+
tested-with: GHC == 8.4.4, GHC == 8.6.5, GHC == 8.8.3, GHC == 8.10.1, GHC == 8.10.2
2626

2727
source-repository head
2828
type: git
@@ -35,15 +35,15 @@ Flag DummyServer
3535

3636
library
3737
hs-source-dirs: src
38-
exposed-modules: Language.Haskell.LSP.Test
39-
, Language.Haskell.LSP.Test.Replay
40-
reexported-modules: haskell-lsp:Language.Haskell.LSP.Types
41-
, haskell-lsp:Language.Haskell.LSP.Types.Capabilities
38+
exposed-modules: Language.LSP.Test
39+
reexported-modules: lsp-types:Language.LSP.Types
40+
, lsp-types:Language.LSP.Types.Capabilities
4241
, parser-combinators:Control.Applicative.Combinators
4342
default-language: Haskell2010
4443
build-depends: base >= 4.10 && < 5
45-
, haskell-lsp >= 0.22 && < 0.24
44+
, lsp-types >= 1.0.0.1 && < 1.1
4645
, aeson
46+
, time
4747
, aeson-pretty
4848
, ansi-terminal
4949
, async
@@ -63,31 +63,32 @@ library
6363
, text
6464
, transformers
6565
, unordered-containers
66+
, some
6667
if os(windows)
6768
build-depends: Win32
6869
else
6970
build-depends: unix
70-
other-modules: Language.Haskell.LSP.Test.Compat
71-
Language.Haskell.LSP.Test.Decoding
72-
Language.Haskell.LSP.Test.Exceptions
73-
Language.Haskell.LSP.Test.Files
74-
Language.Haskell.LSP.Test.Messages
75-
Language.Haskell.LSP.Test.Parsing
76-
Language.Haskell.LSP.Test.Server
77-
Language.Haskell.LSP.Test.Session
71+
other-modules: Language.LSP.Test.Compat
72+
Language.LSP.Test.Decoding
73+
Language.LSP.Test.Exceptions
74+
Language.LSP.Test.Files
75+
Language.LSP.Test.Parsing
76+
Language.LSP.Test.Server
77+
Language.LSP.Test.Session
7878
ghc-options: -W
7979

8080
executable dummy-server
8181
main-is: Main.hs
8282
hs-source-dirs: test/dummy-server
8383
ghc-options: -W
84-
build-depends: base >= 4.10 && < 5
85-
, haskell-lsp >= 0.23 && < 0.24
86-
, data-default
84+
build-depends: base >= 4.11 && < 5
85+
, lsp >= 1.0.0.1 && < 1.1
8786
, aeson
8887
, unordered-containers
8988
, directory
9089
, filepath
90+
, unliftio
91+
, mtl
9192
default-language: Haskell2010
9293
scope: private
9394
if !flag(DummyServer)
@@ -101,7 +102,7 @@ test-suite tests
101102
build-depends: base >= 4.10 && < 5
102103
, hspec
103104
, lens
104-
, haskell-lsp >= 0.22 && < 0.24
105+
, lsp-types >= 1.0.0.1 && < 1.1
105106
, lsp-test
106107
, data-default
107108
, aeson
@@ -110,4 +111,4 @@ test-suite tests
110111
, directory
111112
, filepath
112113
default-language: Haskell2010
113-
build-tool-depends: lsp-test:dummy-server
114+
build-tool-depends: lsp-test:dummy-server

lsp-test/src/Language/Haskell/LSP/Test/Decoding.hs

-157
This file was deleted.

0 commit comments

Comments
 (0)