lsp-test: Catch timeout on no message?
- Dominant language
- Haskell
- Stars
- 423
- Forks
- 105
- PR merge metrics
- No merged PRs in 30d
Description
In my program which uses lsp-test, I need to wait for either of the following conditions to be true:
* server sends a textDocument/publishDiagnostics notification
* 1 second elapses
How can I implement this with lsp-test?
---
I tried adding an API to lsp-test to make what I want possible. However, my implementation has problems. In short, it seems that conduit-parser is not well-suited for this task because alternatives can't "sleep"; calling `await` blocks all alternatives. Here's the code, including a failing test demonstrating some problems with my API: https://github.com/haskell/lsp/commit/06e222435c1423768c28de485044693a0f3ec68b
Contributor guide
Research direction
Start with the failing test and attempted lsp-test API in commit 06e222435c1423768c28de485044693a0f3ec68b. Investigate how conduit-parser handles alternatives and whether await blocks them; done means lsp-test can wait for a textDocument/publishDiagnostics notification or return after one second.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- testing-qa
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100