effekt icon indicating copy to clipboard operation
effekt copied to clipboard

Add testing suite for LSP server

Open marvinborner opened this issue 1 year ago • 3 comments

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).

marvinborner avatar Dec 18 '23 17:12 marvinborner

Hey, looks great so far! :)

Just wondering, have you tried ScalablyTyped? It could save you lots of time spent on writing wrappers (it uses some advanced magic to get the types via TypeScript).

(I have great experience with it in my ScalaJS projects :))

jiribenes avatar Dec 18 '23 21:12 jiribenes

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.

marvinborner avatar Dec 18 '23 22:12 marvinborner

Can anyone reproduce the CI failure? It seems to think that hashTriple and main end at a different line/character and I can't find the reason (there also appears to be some general unreproducible symbol flakiness, probably related to #366).

Aside from that, this PR should be mergable soon, so I'm looking for some feedback.

marvinborner avatar Feb 07 '24 15:02 marvinborner