-
Notifications
You must be signed in to change notification settings - Fork 24
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
Add testing suite for LSP server #351
base: master
Are you sure you want to change the base?
Conversation
Hey, looks great so far! :) Just wondering, have you tried ScalablyTyped? (I have great experience with it in my ScalaJS projects :)) |
Ah yes, I wanted to mention this in the PR. I actually tried it (for a slightly different vscode package though) and it didn't work properly. It gave a lot of warnings about unresolvable/etc. types and the generated Scala files missed several relevant classes. Maybe I'll try again, it would really save a lot of time. |
I switched to utest instead of munit since it has better future and async support. For example, munit's FutureFixture is only available in the 1.0.0-M10 prerelease.
Apparently Scala can't infer the InitializeResult[js.Any], so it fails at runtime with a ClassCastException.
I'd suggest we first evaluate how much time this takes in practical use, then reconsider running the tests on every push.
This introduces several race condition fixes and improves check validation (JSON ordering is not determistic, for example)
This is a compromise between test speed and feature usage. I tried to write some specific tests but found myself rewriting already existing test code.
once again
Some requests send all diagnostics again and caused some logs (e.g. the exitClient request)
Can anyone reproduce the CI failure? It seems to think that Aside from that, this PR should be mergable soon, so I'm looking for some feedback. |
ee9d209
to
58c8510
Compare
This PR aims to add a test suite for Effekt's LSP server.
Apart from the obvious reasons, LSP testing could also be useful for finding reflection bugs (PR #329).
The implementation relies on ScalaJS and Microsoft's
vscode-languageserver-protocol
node module. The resulting facade bindings could also be useful if we wanted to replace LSP4J with a ScalaJS implementation (see here for more information on writing facade types).For now, this PR just consists of a basic proof-of-concept bindings/connection/initialization (I had a lot of trouble with ScalaJS and facade types).