Skip to content

Merge lsp-test into lsp repo #293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 390 commits into from
Feb 28, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
390 commits
Select commit Hold shift + click to select a range
d088cbe
Bump to 0.4.0.0
lukel97 Sep 8, 2018
56ac7d2
Increase cache timeout
lukel97 Sep 9, 2018
2e23e65
Update README.md
lukel97 Sep 9, 2018
470b22e
Fix haddock
Oct 30, 2018
7f2c64e
Merge pull request https://github.com/bubba/lsp-test/issues/22 from j…
lukel97 Oct 31, 2018
d141a93
Add MonadFail constraint for GHC 8.6.1
alanz Nov 11, 2018
536bbff
Merge pull request https://github.com/bubba/lsp-test/issues/25 from a…
lukel97 Nov 12, 2018
ec79c7b
Add lspConfig option
lukel97 Nov 12, 2018
c92e39d
Merge branch 'master' of https://github.com/Bubba/lsp-test
lukel97 Nov 12, 2018
a6aa43f
Fix redundant imports
lukel97 Nov 12, 2018
f1987ed
Fix tests on travis
lukel97 Nov 12, 2018
63ea52e
Fix 8.0.2 builds
lukel97 Nov 13, 2018
07ba0b9
Properly terminate server handler thread on exceptions
lukel97 Dec 5, 2018
18730c0
Make "fails a test" test more precise
lukel97 Dec 5, 2018
78677f8
Bump to 0.5.0.2
lukel97 Dec 5, 2018
72722ee
Bubble up exceptions thrown on server listener thread
lukel97 Dec 5, 2018
71c1e6c
Update hie
lukel97 Dec 6, 2018
7dc47a9
Fix hoogle not generating right ghc version
lukel97 Dec 6, 2018
c7f9690
Update README to include instructions on how to run tests
fendor Feb 26, 2019
1dbfc6e
Fix HIE build instruction
fendor Feb 26, 2019
86d4eb6
Add support for TypeDefinitionRequest
fendor Feb 26, 2019
a852538
Update HIE test version
lukel97 Mar 2, 2019
6561562
Comment out tests that are not working
fendor Mar 3, 2019
940eddc
Merge pull request https://github.com/bubba/lsp-test/issues/31 from f…
lukel97 Mar 4, 2019
c9a6a69
Bump hie version
lukel97 Mar 31, 2019
bf91145
Merge pull request https://github.com/bubba/lsp-test/issues/30 from f…
lukel97 Mar 31, 2019
365ed15
Execute getTypeDefinition test
fendor Apr 6, 2019
d31d58a
Update README.md
lukel97 Apr 6, 2019
c244663
Bump to 0.5.1.0
lukel97 Apr 7, 2019
23f7930
Update minimum base bounds
lukel97 Apr 11, 2019
346053b
Relax upper bound on haskell-lsp
alanz Apr 19, 2019
92d7b35
Merge pull request https://github.com/bubba/lsp-test/issues/33 from a…
lukel97 Apr 19, 2019
a9f2022
Bump to 0.5.1.1
lukel97 Apr 19, 2019
63a7015
Update .travis.yml
fendor Apr 20, 2019
381e135
Merge branch 'master' into tdr-test-impls
lukel97 Apr 20, 2019
7b7e5c6
Update bounds on haskell-lsp
lukel97 Apr 22, 2019
0e39c29
Merge branch 'master' of https://github.com/bubba/lsp-test
lukel97 Apr 22, 2019
b760f56
Bump to 0.5.1.2
lukel97 Apr 22, 2019
afcdb2c
Fix unhandle server notifications
lukel97 Apr 22, 2019
e0e9ac6
Update version bounds on tests
lukel97 Apr 23, 2019
717f39a
Update haskell-lsp bounds
lukel97 Apr 28, 2019
5b9b869
Update bounds for haskell-lsp
lukel97 Apr 28, 2019
3665c1d
Export satisfy
lukel97 Apr 28, 2019
5b749c7
Update haskell-lsp
lukel97 May 5, 2019
42ecb0d
Fix getTypeDefinitions test
lukel97 May 5, 2019
1ef711f
Adapt to new VirtualFile structure
alanz May 7, 2019
f42a08e
Update haskell-lsp bounds
lukel97 May 9, 2019
5506405
Update stack extra-deps
lukel97 May 9, 2019
a6a407d
Update stack.yaml
lukel97 May 9, 2019
a9c0510
Merge pull request https://github.com/bubba/lsp-test/issues/36 from a…
lukel97 May 9, 2019
2a30c58
Bump haskell-lsp to 0.13.0.0
alanz May 18, 2019
2098f42
Merge pull request https://github.com/bubba/lsp-test/issues/37 from a…
lukel97 May 18, 2019
2a9d114
Bump to 0.5.2.3
lukel97 May 18, 2019
9d46694
Support TextDocumentDidChange and add non-file based openDoc
cocreature Jun 4, 2019
d06a371
Merge pull request https://github.com/bubba/lsp-test/issues/38 from c…
lukel97 Jun 4, 2019
8f60892
Merge pull request https://github.com/bubba/lsp-test/issues/32 from f…
lukel97 Jun 4, 2019
5619efd
Fix various issues encountered on Windows
cocreature Jun 5, 2019
4f4d6c9
Merge pull request https://github.com/bubba/lsp-test/issues/39 from c…
lukel97 Jun 8, 2019
5a3e79c
Squashed commit of the following:
lukel97 Jun 13, 2019
b88530e
Adapt to custom methods changes in haskell-lsp
cocreature Jun 4, 2019
92349b0
Fix getDefinitions for SingleLoc and add getCodeLenses
cocreature Jun 11, 2019
9ecf167
Use haskell-lsp from hackage and bump
lukel97 Jun 13, 2019
97e3110
Merge pull request https://github.com/bubba/lsp-test/issues/41 from c…
lukel97 Jun 11, 2019
7ccefbd
Merge pull request https://github.com/bubba/lsp-test/issues/40 from c…
lukel97 Jun 13, 2019
a292aac
Bump to 0.5.4.0
lukel97 Jun 13, 2019
a56c0a0
Upgrading to haskell-lsp 0.15
lorenzo Jul 2, 2019
b6bb1ac
Remove allow newer
lukel97 Jul 4, 2019
3eda01a
Merge pull request https://github.com/bubba/lsp-test/issues/42 from l…
lukel97 Jul 4, 2019
35d66d1
Update hie in CI
lukel97 Jul 4, 2019
8de16f1
Bump to 0.6.0.0
lukel97 Jul 4, 2019
2aea85e
Add "rename suggestion" test
jneira Jul 8, 2019
cbaafa4
Shutdown the server before kill its thread
jneira Jul 9, 2019
8ab8929
Remove comment about IORef
jneira Jul 9, 2019
c553a16
Add server shutdown check to throw exception
jneira Jul 9, 2019
994ffda
Add new NoContentLengthHeader SessionException to replace raw error
jneira Jul 9, 2019
4b6787b
Use a SessionException instead an error, to ignore the error when ser…
jneira Jul 9, 2019
e5067a8
Remove test that already exists in hie
jneira Jul 9, 2019
4e76428
Exit the server and its listener properly
jneira Jul 10, 2019
a16eeeb
Add a finally and timeout to ensure the call to killThread
jneira Jul 10, 2019
3a89c2e
Use the same magnitude in session timeout and threadDelay
jneira Jul 11, 2019
7dfdde7
Use ProcessHandle in withServer to allow kill it by client code
jneira Jul 11, 2019
55f982f
Skip `manual javascript session passes a test` for now in windows
jneira Jul 11, 2019
94a9360
Avoid error when trying to shutdown manual js session
jneira Jul 11, 2019
f8b624a
Revert "Avoid error when trying to shutdown manual js session"
jneira Jul 11, 2019
29d8d85
Checkout lastest release version of hie in travis
jneira Jul 12, 2019
81b89c5
Skipping manual js session test
jneira Jul 12, 2019
50ac6ec
Checkout using commit instead a tag
jneira Jul 12, 2019
63d5f3c
Replace cleanupServer with functions avalilable in ghc <= 8.4
jneira Jul 16, 2019
a9c6bce
Use original hie commit
jneira Jul 16, 2019
794b313
Add cleanupRunningProcess to Compat module
jneira Jul 17, 2019
cd84919
Merge branch 'fix-win-tests-compat' into fix-win-tests
jneira Jul 18, 2019
13fdd39
Don't use exitServer in Replay
lukel97 Jul 20, 2019
3459874
Fix conditionals for process-1.6.3.0
jneira Jul 20, 2019
2f718ff
Merge branch 'fix-win-tests' of https://github.com/jneira/lsp-test in…
jneira Jul 21, 2019
43ce1b3
Hide cleanupProcess for process-1.6.3.0 with comment
jneira Jul 22, 2019
10cbfbb
Include ignoreSigPipe to avoid hangs
jneira Jul 22, 2019
58bb1b7
Add stack.yaml for last minor versions used in hie
jneira Jul 22, 2019
80ff330
Ignore 'permisision denied' error cleaning up processes
jneira Jul 23, 2019
daf411f
Use the correct errno and remove cleanupRunningProcess
jneira Jul 24, 2019
5676a9a
Remove extra stack files
lukel97 Aug 6, 2019
343650b
Merge pull request https://github.com/bubba/lsp-test/issues/44 from j…
lukel97 Aug 6, 2019
182ac89
Add a more general satisfyMaybe helper
cocreature Aug 10, 2019
98b6b8f
Merge pull request https://github.com/bubba/lsp-test/issues/45 from c…
lukel97 Aug 23, 2019
c065c71
Bump to 0.6.1.0
lukel97 Aug 24, 2019
4a640de
Try out GitHub actions
lukel97 Aug 24, 2019
7c6914e
Start working on support for GHC 8.8/haskell-lsp-0.17
lukel97 Sep 8, 2019
2c0b8f2
Bump to 0.7.0.0
lukel97 Sep 8, 2019
ba7a3eb
Squashed commit of the following:
lukel97 Oct 5, 2019
444b299
WIP in wrapping Session in a newtype
lukel97 Oct 2, 2019
8e520c0
Remove commented line
lukel97 Oct 5, 2019
4d469fc
Fix warning
lukel97 Oct 5, 2019
a4e8f5a
Add back parser namers
lukel97 Oct 5, 2019
517c039
Merge pull request https://github.com/bubba/lsp-test/issues/52 from b…
lukel97 Oct 5, 2019
5af40d5
Update changelog
lukel97 Oct 5, 2019
412e295
Update to current state of progress reporting in LSP
cocreature Oct 14, 2019
3a8ac78
Update to haskell-lsp-0.17
lukel97 Oct 18, 2019
8fbe313
Fix tests
lukel97 Oct 18, 2019
b572bde
Merge pull request https://github.com/bubba/lsp-test/issues/54 from c…
lukel97 Oct 18, 2019
cef2bcc
Bump to 0.8.0.0
lukel97 Oct 18, 2019
29ffad7
Add bounds for process
lukel97 Oct 18, 2019
9cc8c68
Track upstream
mpickering Nov 1, 2019
cefdf8a
Add bounds for containers
lukel97 Nov 10, 2019
7496876
Add troubleshooting for stack environment variables
lukel97 Nov 10, 2019
bf3f2c9
Match current haskell-lsp master
alanz Nov 10, 2019
168f075
Use initVFS to simplify runSession mechanics
alanz Nov 10, 2019
852966e
Remove no longer needed dependency
alanz Nov 11, 2019
70d51ef
Merge pull request https://github.com/bubba/lsp-test/issues/58 from a…
lukel97 Nov 12, 2019
e32f55a
Expose satisfyMaybe
cocreature Nov 17, 2019
ac7af7e
Update haskell-lsp and bump to 0.8.1.0
lukel97 Nov 17, 2019
67ae026
Merge pull request https://github.com/bubba/lsp-test/issues/59 from c…
lukel97 Nov 17, 2019
1f1590d
Prepare for 0.8.2.0
lukel97 Nov 17, 2019
c4a26ad
Remove stack.yaml.lock
lukel97 Nov 26, 2019
1eeaa60
Update stack.yaml
lukel97 Nov 26, 2019
afbede2
Print last received message in timeout exceptions
lukel97 Nov 26, 2019
db0a434
Add ignoreLogNotifications config option
lukel97 Nov 26, 2019
8f988a4
Pretty print last received messages
lukel97 Nov 26, 2019
99cf9fe
Track changes to haskell-lsp
mpickering Nov 26, 2019
6ec8064
Update stack.yaml
lukel97 Dec 8, 2019
f5664b1
Remove stability field
lukel97 Dec 8, 2019
abfd036
Fix Haddock formatting error
lukel97 Dec 8, 2019
fb702d2
Merge pull request https://github.com/bubba/lsp-test/issues/61 from m…
lukel97 Dec 15, 2019
677129e
Upgrade to haskell-lsp-0.19
lukel97 Dec 15, 2019
7a6ed92
Add ability to override some config via env vars
lukel97 Dec 15, 2019
1674c70
Handle env vars set to "0"
lukel97 Dec 15, 2019
8b25e87
Fix haddock markup
lukel97 Dec 15, 2019
c07513f
Bump to 0.9.0.0
lukel97 Dec 15, 2019
03514f8
Remove rope-utf16-splay dependency
lukel97 Dec 16, 2019
dbf14c0
Update stack.yaml
lukel97 Dec 16, 2019
5eb9f8a
Squashed commit of the following:
lukel97 Dec 20, 2019
72776ea
Turn on Haskell workflow for PRs
lukel97 Dec 20, 2019
ba47e54
Don't install globally via npm
lukel97 Dec 20, 2019
f07abd6
Update hie used in CI
lukel97 Dec 20, 2019
0892cb3
Disable CI on macOS 8.4.4
lukel97 Dec 20, 2019
a16930d
Handle receiving messages in between the initialize sequence
lukel97 Dec 29, 2019
fafbdd5
Bump to 0.10.0.0
lukel97 Dec 29, 2019
76a0ef3
Tidy up README.md
lukel97 Jan 3, 2020
2a59494
Squashed commit of the following:
lukel97 Jan 21, 2020
eb2080e
Bump constraints for new haskell-lsp
lukel97 Feb 4, 2020
ab27504
Bump verison of haskell-lsp
lukel97 Mar 21, 2020
a9829c1
Bump hie ci version
lukel97 Mar 21, 2020
4fe8d41
Support haskell-lsp-0.22
lukel97 May 4, 2020
0ef9104
Try new setup-haskell
lukel97 May 4, 2020
85af0bc
Fix curtimeoutid being reset in the server exit handler
lukel97 May 5, 2020
82db9e3
Use a dummy server for testing
lukel97 May 6, 2020
de52c86
Skip segfaulting windows ghc version
lukel97 May 6, 2020
92db52a
Add back some more tests
lukel97 May 6, 2020
18d17e0
Remove replay tests entirely
lukel97 May 6, 2020
e921ac7
Remove old testing servers from readme
lukel97 May 6, 2020
ec2b641
Update stack.yaml
lukel97 May 10, 2020
a4080c8
Handle [un]registerCapability and workspace/didChangeWatchedFiles
lukel97 May 14, 2020
6c7e6ab
Mention some useful debugging options
lukel97 May 14, 2020
cb82057
Try to make dummy server platform agnostic
lukel97 May 14, 2020
b7eb9b8
Upgrade actions/cache
lukel97 May 14, 2020
4129efa
Fix listener thread listening after the server process was stopped
lukel97 May 14, 2020
2817c53
Prepare for 0.11.0.0
lukel97 May 14, 2020
7221766
Bump cache key
lukel97 May 14, 2020
eacf944
Make URL absolute in workspace/didChangeWatchedFile
lukel97 May 15, 2020
2c82337
Loosen the bounds on Glob
lukel97 May 15, 2020
a0030c9
Update doc to show where to generate a capture file for replay
lukel97 May 25, 2020
d766b1f
Add blog post to README
lukel97 Jun 4, 2020
3ed9c5f
Mention LSP_TEST_LOG_STDERR in README
lukel97 Jun 4, 2020
3250513
Fix getTypeDefinitions
lukel97 Jun 8, 2020
265b603
Wait for the server to exit cleanly
lukel97 Jun 10, 2020
0603997
Fix cabal.project flags
lukel97 Jun 10, 2020
fe6d2eb
Prepare for 0.11.0.2
lukel97 Jun 10, 2020
809f2c8
Update some actions
lukel97 Jun 13, 2020
d5dc7d8
Remove unused javascript test data
lukel97 Jun 27, 2020
0c4bcb7
Fix formatting requests sending misversioned didChange notifications
lukel97 Jul 27, 2020
e884360
Start off on new version in didChanges from updateState
lukel97 Aug 7, 2020
d21cc27
Handle CustomClientMethod
pepeiborra Sep 5, 2020
cd602a8
Merge pull request https://github.com/bubba/lsp-test/issues/74 from p…
lukel97 Sep 6, 2020
c183fe3
Bump to 0.11.0.5
lukel97 Sep 6, 2020
c2207a7
Remove waitForProcess in finalizer for windows
jneira Sep 17, 2020
75435eb
Merge pull request https://github.com/bubba/lsp-test/issues/76 from j…
lukel97 Sep 17, 2020
9bdcf46
Bump to 0.11.0.6
lukel97 Sep 19, 2020
7b33dc2
Bump haskell-lsp bounds
lukel97 Oct 5, 2020
add1feb
Bump to 0.11.0.7
lukel97 Oct 9, 2020
fbfcaa5
Initial attempt at updating for singleton-methods
wz1000 Jun 4, 2020
37c02ad
Minor cleanup
wz1000 Jun 4, 2020
a7c7d56
update and fill in `message`
wz1000 Aug 24, 2020
c5d405e
Add runSessionWithHandles
lukel97 Aug 28, 2020
b5aa221
Update request map in listenServer
lukel97 Aug 28, 2020
2f21c53
Implement responseForId
lukel97 Sep 1, 2020
ca820fe
Add haddock to runSessionWithHandles
lukel97 Sep 1, 2020
96fdb07
Add initialWorkspaceFolders config option
lukel97 Sep 2, 2020
57584ef
Tidy up rebase
lukel97 Sep 2, 2020
66e3759
fix build
wz1000 Sep 29, 2020
a454711
add support for custom messages
wz1000 Sep 29, 2020
5248684
use senRequest instead of request_ in executeCommand to avoid gobblin…
wz1000 Oct 5, 2020
4aa81f6
Update tests for lsp-1.0.0.0
lukel97 Oct 12, 2020
525f629
Rename Language.Haskell.LSP.Test => Language.LSP.Test
lukel97 Oct 13, 2020
81bae96
Update version of lsp
lukel97 Oct 14, 2020
68211ed
Fix dodgy merge
lukel97 Oct 14, 2020
2172389
Use TypeInType for GHC 8.4.4 builds
lukel97 Oct 14, 2020
d53e422
Updating again for lsp
lukel97 Oct 15, 2020
f2f6f85
Use lsp/lsp-types from Hackage
lukel97 Oct 31, 2020
61f7d66
Use TypeInType
lukel97 Nov 1, 2020
49e3221
Update lsp bounds to include GHC 8.4.4 fix
lukel97 Nov 26, 2020
7eef156
Update setup-haskell
lukel97 Nov 26, 2020
68d9d00
Merge pull request https://github.com/bubba/lsp-test/issues/68 from w…
lukel97 Nov 26, 2020
3657750
Fix `swapUri` in Files.hs
banacorn Dec 11, 2020
cc06c31
Fix DocumentChange related stuff in Test.hs
banacorn Dec 11, 2020
8dec9d9
Fix DocumentChange related stuff in Session.hs
banacorn Dec 11, 2020
2170194
Abstracting documentChangeUri
banacorn Dec 11, 2020
2caeab7
Merge pull request https://github.com/bubba/lsp-test/issues/81 from b…
lukel97 Dec 11, 2020
f1bbd36
track progress sessions
wz1000 Jan 24, 2021
d684a07
Merge pull request https://github.com/bubba/lsp-test/issues/82 from w…
lukel97 Jan 30, 2021
9e67140
Use haskell/actions/setup
lukel97 Feb 3, 2021
98b279b
Upgrade to lsp master
lukel97 Feb 3, 2021
73a99ad
use Text instead of String
wz1000 Feb 3, 2021
2dfd1c5
Merge pull request https://github.com/bubba/lsp-test/issues/85 from w…
lukel97 Feb 3, 2021
5fa33f8
respond to progress create and apply edit
wz1000 Feb 9, 2021
d56ef59
Move responses to updateStateC
wz1000 Feb 9, 2021
f460bb9
Merge pull request https://github.com/bubba/lsp-test/issues/86 from w…
lukel97 Feb 11, 2021
3c4dbed
Bump lsp commit
lukel97 Feb 14, 2021
431d7e0
Move more String types to Text types
lukel97 Feb 14, 2021
ddf8f6d
Prepare for 0.13.0.0
lukel97 Feb 14, 2021
aef50ae
Merge pull request https://github.com/bubba/lsp-test/issues/87 from b…
lukel97 Feb 14, 2021
bb155cf
Kill timeout thread
wz1000 Feb 24, 2021
836d258
update equality function
wz1000 Feb 25, 2021
45de413
Remove source-repository-packages for lsp[-types]
lukel97 Feb 27, 2021
19d2882
Fix exception throwing test
lukel97 Feb 27, 2021
f90b002
Limit diagnostics by range in getCodeActions
aufarg Feb 26, 2021
58f8dc7
Merge pull request https://github.com/bubba/lsp-test/issues/91 from a…
lukel97 Feb 27, 2021
e514f2e
Merge pull request https://github.com/bubba/lsp-test/issues/88 from w…
lukel97 Feb 27, 2021
7bfb0b1
Merge pull request https://github.com/bubba/lsp-test/issues/89 from w…
lukel97 Feb 27, 2021
d70a41e
Merge remote-tracking branch 'lsp-test/master' into merge-lsp-test
lukel97 Feb 27, 2021
ba4c9fb
Fix ups for merging lsp-test
lukel97 Feb 27, 2021
7250d76
Switch to the non-deprecated haskell/actions/setup github action
lukel97 Feb 27, 2021
5753049
Fix build on 8.6.5
lukel97 Feb 27, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ jobs:
strategy:
fail-fast: false
matrix:
ghc: ['8.10.2', '8.8.3', '8.6.5', '8.4.4']
ghc: ['8.10.4', '8.8.3', '8.6.5', '8.4.4']
os: [ubuntu-latest, macOS-latest, windows-latest]
exclude:
- os: windows-latest
ghc: '8.8.3' # fails due to segfault

steps:
- uses: actions/checkout@v2
- uses: actions/setup-haskell@v1
- uses: haskell/actions/setup@v1
with:
ghc-version: ${{ matrix.ghc }}
cabal-version: '3.2'
Expand All @@ -38,5 +38,7 @@ jobs:
run: cabal build
- name: Test
run: cabal test
- name: Func tests
run: cabal run func-test
- name: Func test
run: cabal test func-test
- name: Test lsp-test
run: cabal test lsp-test
10 changes: 4 additions & 6 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
packages:
./
./lsp-types/
./func-test
./lsp-test/
./lsp-test/example
./func-test/
./bench/

package lsp
flags: +demo

source-repository-package
type: git
location: https://github.com/bubba/lsp-test.git
tag: 55ae6885312a90117aab35acdfc470790f30cfca

tests: True
test-show-details: direct
haddock-quickjump: True
4 changes: 4 additions & 0 deletions hie.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
# https://github.com/digital-asset/ghcide/issues/113
cradle:
cabal:
- path: "./lsp-test/test"
component: "lsp-test:test:tests"
- path: "./lsp-test"
component: "lsp-test"
- path: "./lsp-types"
component: "lsp-types"
- path: "./src"
Expand Down
22 changes: 22 additions & 0 deletions lsp-test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.stack-work
stack.yaml.lock
dist
.cabal-sandbox
cabal.sandbox.config
dist-newstyle
cabal.project.local*
.ghc.environment.*
**/.DS_Store
*.swp

example/dist
example/dist-newstyle
example/cabal.project.local
example/.ghc.environment.*

# used for rerunning failed hspec tests
.hspec-failures

# downloaded by .download-hie.sh on travis
hie
.hie
117 changes: 117 additions & 0 deletions lsp-test/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
# Revision history for lsp-test

## 0.13.0.0 -- 2021-02-14

* Add support for lsp-types-1.1 (@wz1000)
* Automatically respond to `workspace/applyEdit` and
`window/workDoneProgress/create` messages (@wz1000)

## 0.12.0.0 -- 2021-01-25
* Add `getIncompleteProgressSessions` to track ongoing progress sessions
(@wz1000)

## 0.11.0.0 -- 2020-05-14

* Replace `openDoc'` with `createDoc` which now sends
`workspace/didChangeWatchedFiles` notifications if the server has registered
for it
* Add `getRegisteredCapabilities`

## 0.10.3.0 -- 2020-05-04

* Build with new haskell-lsp-0.22

## 0.10.2.0 -- 2020-03-21

* Bump constraints for new haskell-lsp

## 0.10.1.0 -- 2020-02-04

* Bump constraints for new haskell-lsp

## 0.10.0.0 -- 2019-12-29

* Account for messages received between the initialize request and response.
(Though it will throw an exception if the message received is an illegal one)

## 0.9.0.0 -- 2019-12-1

* Add `ignoreLogNotifications` config option
* Add ability to override `logStdErr` and `logMessages` config options with
the `LSP_TEST_LOG_STDERR` and `LOG_TEST_LOG_MESSAGES` environment variables
* Update for haskell-lsp-0.19.0.0 (@mpickering)

## 0.8.2.0 -- 2019-11-17

* Expose `satisfyMaybe` (@cocreature)

## 0.8.1.0 -- 2019-11-17

* Update to haskell-lsp-0.18.0.0 (@mpickering, @alanz)
* Tests now require hie-bios based hie

## 0.8.0.0 -- 2019-10-18

* Make `Session` a newtype
* Update for haskell-lsp-0.17.0.0 (@cocreature)

## 0.7.0.0 -- 2019-09-08

* Update for haskell-lsp-0.16.0.0

## 0.6.1.0 -- 2019-08-24

* Add `satisfyMaybe` (@cocreature)

## 0.6.0.0 -- 2019-07-04

* Update to haskell-lsp-0.15.0.0 (@lorenzo)

## 0.5.4.0 -- 2019-06-13

* Fix `getDefinitions` for SingleLoc (@cocreature)
* Add `getCodeLenses` (@cocreature)

## 0.5.3.0 -- 2019-06-13

* Update to haskell-lsp-0.14.0.0 (@cocreature)
* Support `TextDocumentDidChange` (@cocreature)
* Add non-file based `openDoc` (@cocreature)

## 0.5.2.0 -- 2019-04-28

* Add `satisfy` parser combinator

## 0.5.1.0 -- 2019-04-22

* Fix unhandled `window/progress` server notifications

## 0.5.1.0 -- 2019-04-07

* Add getTypeDefinitions (@fendor)

## 0.5.0.2 -- 2018-12-05

* Fix loose threads when exceptions are thrown

## 0.5.0.0 -- 2018-11-13

* Add lspConfig option in config
* GHC 8.6.2 support

## 0.4.0.0 -- 2018-09-08

* Update to haskell-lsp-0.8.0.0

## 0.3.0.0 -- 2018-09-0t

* Update to haskell-lsp-0.7.0.0

## 0.2.1.0 -- 2018-08-14

* Add getCodeActions
* Add getCurrentDiagnostics

## 0.2.0.0 -- 2018-08-06

* Update to haskell-lsp 0.6.0.0
29 changes: 29 additions & 0 deletions lsp-test/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
Copyright Luke Lau 2018-2020.
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.

* Neither the name of Luke Lau nor the names of other
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
53 changes: 53 additions & 0 deletions lsp-test/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# lsp-test [![Actions Status](https://github.com/bubba/lsp-test/workflows/Haskell%20CI/badge.svg)](https://github.com/bubba/lsp-test/actions) [![Hackage](https://img.shields.io/hackage/v/lsp-test.svg)](https://hackage.haskell.org/package/lsp-test)
lsp-test is a functional testing framework for Language Server Protocol servers.

```haskell
import Language.LSP.Test
main = runSession "hie" fullCaps "proj/dir" $ do
doc <- openDoc "Foo.hs" "haskell"
skipMany anyNotification
symbols <- getDocumentSymbols doc
```

## Examples

### Unit tests with HSpec
```haskell
describe "diagnostics" $
it "report errors" $ runSession "hie" fullCaps "test/data" $ do
openDoc "Error.hs" "haskell"
[diag] <- waitForDiagnosticsSource "ghcmod"
liftIO $ do
diag ^. severity `shouldBe` Just DsError
diag ^. source `shouldBe` Just "ghcmod"
```

### Replaying captured session
```haskell
replaySession "hie" "test/data/renamePass"
```

### Parsing with combinators
```haskell
skipManyTill loggingNotification publishDiagnosticsNotification
count 4 (message :: Session ApplyWorkspaceEditRequest)
anyRequest <|> anyResponse
```

Try out the example tests in the `example` directory with `cabal test`.
For more examples check the [Wiki](https://github.com/bubba/lsp-test/wiki/Introduction), or see this [introductory blog post](https://lukelau.me/haskell/posts/lsp-test/).

Whilst writing your tests you may want to debug them to see what's going wrong.
You can set the `logMessages` and `logStdErr` options in `SessionConfig` to see what the server is up to.
There are also corresponding environment variables so you can turn them on from the command line:
```
LSP_TEST_LOG_MESSAGES=1 LSP_TEST_LOG_STDERR=1 cabal test
```

## Developing
The tests for lsp-test use a dummy server found in `test/dummy-server/`.
Run the tests with `cabal test` or `stack test`.
Tip: If you want to filter the tests, use `cabal run test:tests -- -m "foo"`

## Troubleshooting
Seeing funny stuff when running lsp-test via stack? If your server is built upon Haskell tooling, [keep in mind that stack sets some environment variables related to GHC, and you may want to unset them.](https://github.com/alanz/haskell-ide-engine/blob/bfb16324d396da71000ef81d51acbebbdaa854ab/test/utils/TestUtils.hs#L290-L298)
19 changes: 19 additions & 0 deletions lsp-test/example/Test.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import Control.Applicative.Combinators
import Control.Monad.IO.Class
import Language.LSP.Test
import Language.LSP.Types

main = runSession "haskell-language-server" fullCaps "../test/data/" $ do
doc <- openDoc "Rename.hs" "haskell"

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

-- Send requests and notifications and receive responses
rsp <- request STextDocumentDocumentSymbol $
DocumentSymbolParams Nothing Nothing doc
liftIO $ print rsp

-- Or use one of the helper functions
getDocumentSymbols doc >>= liftIO . print

2 changes: 2 additions & 0 deletions lsp-test/example/cabal.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
packages: .
../
11 changes: 11 additions & 0 deletions lsp-test/example/example.cabal
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: example
version: 0.0.0.0
cabal-version: >= 1.22
build-type: Simple

test-suite tests
type: exitcode-stdio-1.0
main-is: Test.hs
build-depends: base
, lsp-test
, parser-combinators
16 changes: 16 additions & 0 deletions lsp-test/hie.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
cradle:
multi:
- path: "./test/data/"
config: { cradle: { none: } }
- path: "./example/"
config: { cradle: { none: } }
- path: "./"
config:
cradle:
cabal:
- path: "src"
component: "lib:lsp-test"
- path: "test/dummy-server"
component: "exe:dummy-server"
- path: "test"
component: "test:tests"
Loading