lsp icon indicating copy to clipboard operation
lsp copied to clipboard

lsp-test: add setIgnoringProgressNotifications

Open jhrcek opened this issue 1 year ago • 6 comments

Based on discussion on matrix: https://matrix.to/#/!caZLxGrrbiQktNWBbz:matrix.org/$UdbEDn7KYgUdGHo4rVHUeoGjtRBpm0q0XlRBBzpXTYg?via=matrix.org&via=envs.net&via=maralorn.de

jhrcek avatar Apr 07 '24 05:04 jhrcek

Did this achieve what you wanted in the tests?

michaelpj avatar Apr 09 '24 09:04 michaelpj

Not sure yet. I have a PR in hls repo with upgrade of hls to master version of lsp: https://github.com/haskell/haskell-language-server/pull/4166 I have a PR in my fork which uses this PR branch: https://github.com/jhrcek/haskell-language-server/pull/8

Both have test failures, but I didn't have time yet to look into those. Will check them later this week.

I'll probably just revert to your idea of rebasing the lsp PR on some commit before the metamodel update to make it easier for myself.

jhrcek avatar Apr 09 '24 11:04 jhrcek

It would be nice to know since I'll probably release the packages soon so that HLS can adapt to the changes you helpfully fixed :)

michaelpj avatar Apr 10 '24 14:04 michaelpj

@michaelpj Give me one more day. I'll try to fix up test failures in https://github.com/jhrcek/haskell-language-server/pull/9, which uses lsp patch applied before metamodel update to minimize the amount of breakage that other recent lsp changes seems to have introduced.

jhrcek avatar Apr 10 '24 15:04 jhrcek

To be clear, when I say "soon" I don't mean that soon. Maybe next week or something.

michaelpj avatar Apr 10 '24 15:04 michaelpj

Status update: we decided not to merge it yet, because it would require enabling progress notifications in many hls tests.

Here's a test PR that makes the hls tests pass by enabling listening to progress notifications within "waitForProgress" helper functions. But this strategy feels too brittle (e.g. it probably allows for races where notification is sent sooner than waitForProgress is called). Probably more robust approach would require enabling progress notifications in session config of all tests that actually need to wait for progress to be completed OR refactoring some of those tests not to rely on progress.

jhrcek avatar Apr 16 '24 04:04 jhrcek