Unable to connect to LSP from VisualStudioCode

Hello,

I have been looking for a solution for the better part of 6 hours now, so i’ve decided to ask for help.

I’ve migrated all of my old stuff (rules included) on a new machine running ona celeron j4100 from a raspberry pi- everything works (better) except…
Now my issue is with VSC and the LSP.
As far as i know as long as i use an openhabianpi image on the raspberry pi, the LSP provided correction works with default settings.

My new machine’s hostname is “openhabian” (as opposed to “openhabianpi”), it sits on a static ip within my lan (192.168.168.141)
all other settings are the same as they used to be on the raspberry, only more juice to run on.

currently my settings.json in VSC looks like this:
image
i’ve tried having “openhabian” as host name
i’ve tried swapping “LspEnabled” with "remoteLspEnabled "and LspPort with “remoteLspPort

basically the restAPI interaction works, i do get the suggestions for itemnames, values etc
the rules’syntax correction doesn’t kick in.

My reasoning is that the openhab.host setting addres resolving works either by name or IP, as otherwise items, things etc woluldn’t show, but somehow i don’t manage to get the connection to the LSP running.
image

I do not know if this is related: in the Log (Extension Host) output in VSC i get:

I do not know if this is related either, having on drive letter X the openhab-conf samba share, the Log(Window) Output in VSC says:

I’m on OH 2.5.0. #1642 Snapshot on Debian Stretch 9.9
VSC 1.36.1 on a windows 10 machine
Openhab extension 0.5.1

How could i debug and solve this, as in time i’ve become really dependant on the VSC extension for OH DSL correction function.?

further: i have uninstalled and reainstalled vscode, cleaned the system with CCleaner - no difference

Taking a hint from this post


I’ve tried to put in lower case “lsp_”
image

no change in behaviour, andthe 3 underlined configuration settings are stil marked as unknown…

as per this post i’ve put log:trace ont he lsp

I have noticed that within the openhab VSC extension there are 2 different settings.json referring to user and workspace, so i’ve copied over the openhab related settings to the workspace settings.json


but VSC still does not underline mistakes.

I’ve tried taking away the lines for the settings that should match the default ones.
leaving only openhab:host

by doing sowhen starting VSC, the logTail says


while in VSC the Output Log(Extension Host) window says

and right after it, the openHAB Server Output goes
image

i’ ve gone back to
image
again the log tail says a client connected tot he LSP but the connection in VSC errors up.

so back to
image
and no immediate erroring of the connection in VSC(it happened after 9minutes), and yet no underlining of syntax mistakes …

What am i doing wrong… PLEASE, any help? :frowning:

i can’t find any more pointers , not even in https://github.com/openhab/openhab-vscode/blob/master/README.md

@Confectrician, sorry to bother you
Would you be able to help me?
Should i just update to the next snapshot and maybe the issue will disapper?
Do OH snapshots have code validation trough the LSP?
Have I missed something blatantly obvious?

i haven’t had any feedback.
Atm i’m using a raspi with OH2.4 stable only for syntax correction through the lsp, and than moving my rules over to the new machine correcting mostly the item names…

I’m guessing snapshots don’t have the lsp enabled

Hey @lagging,

Sorry for the late response.
I have no time to dig into this at the moment.
Maybe i can get some time during froscon next weekend, but i am not sure, since we are not that much volunteers for our booth over there.

That said:
I have used the extension only with stable OH versions, so i can’t tell you anything for snapshot usage now.
Also i am not really an lsp expert and the others who had at least some knowledge seem to be a bit inactive as well those days.
I am trying to dig into that stuff, but thats not that easy with limited time.

1 Like

Thanks for the reply,
no worries, i understand you are busy :slight_smile:

I have since made a number of extra tests even with debian buster + gnome+ visual studio installed trying to connect to OH’s LSP in localhost:
i can connect to the LSP on OH 2.4 stable and OH 2.5 milestone1, but it doesn’t work for me on snapshots(1642 and 1625 tested).

I have deduced it might be a tradeoff for quicker compiles of snapshots…