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
Language Server Protocol support #31
Conversation
Wow, that was quicky! I guess it somehow backfired, the ball is in our field now 😄 |
I will try to test it out a bit during the next days. :) |
This is how it looks like right now: It's not connected anywhere, thus these errors :-) In order to display the Output tab simply hit Quick question to @SJKA - my current implementation assumes that LSP will be hosted on Cheers! |
You're way to quick for me 😄 I just finished eclipse-archived/smarthome#4100. Once it's merged I will look into how the LSP bindings can be generated and how we can expose them within the server. I will try to use 5007 port then. However, I'm not even sure if we will be able to use the same port for all DSLs, or if we will have to use different ones per language. |
Hey @SJKA 👋 Since OH distro 1048, there's your Language Server PR available. Thanks in advance! |
I struggle with getting any response from the LSP on my RPi3 environment (wrt openhab/openhab-distro#547 (comment)) Logs are telling me that I'm successfully connecting to the server:
And here's the proof that 5007 port is indeed open:
But I get no output on vscode whatsoever 🤔 My vscode workspace settings:
In Karaf I've also set lsp logging level to debug:
Thanks in advance! |
@kaikreuzer @SJKA I really need your help here in order to make it work :-) I have this very branch unchanged connecting to my remote OH instance (
VSCode throws an error after a while: On the OH side,
Am I missing something there? @SJKA I would really appreciate if you could test the scenario again like you did here: eclipse-archived/smarthome#4148 (comment). I'm really close to have this completed :) Cheers and thanks in advance! 👍 |
Hey @kubawolanin, I am sorry, but I myself have no clue about how the LSP stuff works - I very much hope that @SJKA will respond soon and help you out on it! |
I have no idea why I didn't receive these notifications, but nowI have seen it. Sorry! I'll follow your traces and try figuring out what's needed in order to make it work initially. Keep you posted! |
hmmm, looks like I somehow screwed up the OSGi service injection into the guice module 😩 . |
@kubawolanin Latest distro 1063 should already contain that fix! |
Thanks @kaikreuzer! @SJKA thank you so much for the quick fix! |
@SJKA sorry to tell you but it still doesn't work on distro 1063 :(
VSCode output after a while:
Do you have any specific environment that I can reproduce to successfully test it? Here's a zipped, packaged extension so you don't need to build it yourself. Just hit Thank you. |
Indeed, I have the following in the logs:
The xtext/xbase bundle versions are exactly the same as in the IDE. I will try to make sense of this... |
@maggu2810 could it be that the |
To answer my previous question: The build indeed drags in Now I "only" need to figure out how to nail this version down in the xtext-core gradle build. |
I found a way to solve the issue, but it might take a little to get it uploaded and run it through the build chain. So here is a quick workaround for you. Assuming you already have openHAB running with the Language Server extension installed. Via the Karaf OSGi console, run
and identify the "Xtext IDE Code" entry. Should be something like this:
Remember its number and stop & uninstall it (using the number it has in your system, of course):
Then download this file and unzip it somewhere (github doesn't allow JARs, but ZIPped JARs are okay 😉 ): org.eclipse.xtext.ide-2.12.0.sp1.jar.zip Install it from the Karaf OSGi console with
It gave me an error about the same singleton bundle already being used - a restart of openHAB will be sufficient to fix this. |
Hey @SJKA big thanks for helping me out with this! :) Just checked it on a fresh machine. Installed openhab-2.2.0-SNAPSHOT lastSuccessfulBuild from Cloudbees + LSP add-on along with JAR you provided. At first I had some weird issues:
But started again on a fresh OH instance and I've managed to get it work :-)
Thank you so much! |
Don't get confused by the error message in the log - maybe it is a normal case which happens when the client closes the connection and it is just a mistake to log it as an error. Fine tuning 😉 Glad to see it's working!!! I will take care to get the correctly patched xtext file into ESH and then into openHAB as quickly as possible (before the weekend in any case...). Let me know if there is anything else where I can help. |
LSP cleanup, final touches Signed-off-by: Kuba Wolanin <hi@kubawolanin.com>
Great improvement! |
@kubawolanin distro 1065 is ready for testing! |
@kaikreuzer much appreciated! :) |
@kaikreuzer @SJKA distro 1065 is giving me the following stack trace:
I've updated the distro and restarted my OH several times.
I'll stick with the previous build for the demo on Sunday ;-) Thank you! |
Xtext IDE Core version "2.12.0.v20171017-1700" is correct. However, I couldn't reproduce this error. I downloaded the distro from here, using the "demo" setup and installed the LSP extension. Works like a charm. As you said you updated your distro - did you delete the cache and tmp folders? In any case, good that you have a working setup for the weekend. |
…ived#4422) ...doing it in a similar way as in eclipse-archived#4278 relates to #openhab/openhab-vscode#31 Signed-off-by: Simon Kaufmann <simon.kfm@googlemail.com>
So here we go :-)
Currently don't have a way to test this since there's no Xtext with LSP available on ESH yet.
Closes #3
CC: @kaikreuzer @SJKA
Signed-off-by: Kuba Wolanin hi@kubawolanin.com (github: kubawolanin)