[Feature request] Communication over stdin stdout
JJK96 opened this issue · 6 comments
Some LSP clients communicate over stdin stdout, it would be nice to make this work with that.
@JJK96 - apologies for not responding sooner. There is a command-line version of LanguageTool available already. See https://languagetool.org/dev for details. I typically install it via HomeBrew (Mac) or LinuxBrew (Linux), but you can also install on Windows via Chocolatey. Is this what you're looking for, or am I misunderstanding what your goal is?
I have on my todo to convert this so the user must install LanguageTool separately instead of compiling it in to the extension as is done now, but it's low on my priority list.
I am already using the command line languagetool, however it does not integrate with my editor in showing the locations of errors, etc. This is the benefit of using it as a languageserver.
So, I do want to use it as a languageserver, but with input on stdin and output on stdout.
I've written a wrapper to accomplish this
#!/bin/bash
PORT=20000
nc -l -p $PORT <&0 >&1 &
~/git/languagetool-languageserver/build/install/languagetool-languageserver/bin/languagetool-languageserver $PORT > /dev/null
Okay - I've had a chance to refresh myself on LSP documentation, and I understand your question now. I think this requires an update of languagetool-languageserver to make a wrapper that can be configured to communicate over sockets, stdin/stdout, etc. I'm going to tinker around with it today to get a better idea of how this might work without also consumint a TCP port.
I have a highly experimental build on the stdin-stdout branch that you can use. I've converted to using Maven for build, so you'll need that. Just do a mvn clean compile package
, and you'll wind up with a fat jar at ./target/languagetool-lsp-0.0-EXPERIMENTAL.jar
that can be run without any arguments.