TypeFox / ls-api

MOVED TO
https://github.com/eclipse/lsp4j
20 stars 8 forks source link

Debugging timeouts #21

Closed mickaelistria closed 8 years ago

mickaelistria commented 8 years ago

I'm using the ls-api to connect to a few language server: CSS and JSon one from VSCode extensions, and https://github.com/OmniSharp/omnisharp-node-client/tree/master/languageserver . I connect to those servers using: https://github.com/eclipselabs/eclipse-language-service/blob/master/org.eclipse.languageserver/src/org/eclipse/languageserver/LanguageServerWrapper.java#L96 . Completion is implemented in

I get some mixed results:

So I'd like to debug these timeouts. Is there a way to monitor what gets sent/received by the ls-api? Some option to enable or some breakpoints to set at a particular place?

mickaelistria commented 8 years ago

Also, connecting to those servers, I don't manage to receive diagnostics. This could be related. My impression (didn't monitor the streams yet) is that some messages are received in a different format than the one supported by ls-api, resulting in timeouts or unreceived diagnostics.

svenefftinge commented 8 years ago

You can add listeners to the LanguageServerProtocol returned by JsonBasedLangaugeServer#getProtocol for in and out messages as well as errors. See https://github.com/TypeFox/ls-api/blob/master/io.typefox.lsapi.services/src/main/java/io/typefox/lsapi/services/json/LanguageServerProtocol.xtend#L61

mickaelistria commented 8 years ago

Thanks, that was very helpful.