Closed nojaf closed 2 years ago
hi, did you check the helpers in https://github.com/eclipse/lsp4j/blob/5605ca82252833777dbef82ca13a403dbfb9d906/org.eclipse.lsp4j.jsonrpc/src/main/java/org/eclipse/lsp4j/jsonrpc/Launcher.java and https://github.com/eclipse/lsp4j/blob/5605ca82252833777dbef82ca13a403dbfb9d906/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/launch/LSPLauncher.java https://github.com/eclipse/lsp4j/tree/main/documentation
Hey, that looks indeed like what I'm after. When seeing
return new Builder<T>()
.setLocalService(localService)
.setRemoteInterface(remoteInterface)
What should my local service be exactly? Same for remote interface?
My T
currently is
interface FantomasDaemon {
@JsonRequest("fantomas/version", useSegment = false)
fun version() : String
}
which matches what my server is implementing.
so localservice is you client instance, remote is the interface of the server. see also this tutorial https://www.eclipse.org/community/eclipse_newsletter/2017/may/article2.php https://github.com/TypeFox/lsp4j-chat-app
Figured it out, wonderful! Thanks for the pointers @cdietrich!
@cdietrich small follow-up question, what if I'm done with my client and I want to garbage collect it? Can I just kill the process and assume everything will be cleaned up from there on?
no idea. can you check the example i linked. you also may check https://github.com/eclipse/lsp4e
Hello,
This is more of a question on how to use the lsp4j instead of an actual bug report. If there is an alternative way of asking questions, please let me know.
I wish to create a client that can connect to an LSP server that runs in a .NET process. I've implemented this server in F# and I now want to connect to it and call these RPC functions. So, I imagine I need to start the process, capture stdin and stdout and then somehow send JSON messages to this.
I'm not really sure what I'm after, although the
EndpointProxy
looks like what I'm looking for. The code sample in the docs looks like this:but I'm not sure how to create an endpoint from the stdio streams.
Could someone provide me with a pointer on how to set this up?
Many thanks,
Florian