VSCode doesn't validate my code

Hi There,

I’ve setup vscode for usage with openhab but it doesn’t work at all. When writing false code, there is no highlighting. And I can’t find any further information about it. Any idea how to debug this?


It does not “highlight” the rules text, you need to activate the “problems” tab.

Speaking of this, when did the behavior change? At one point, and I don’t remember exactly when, I seem to recall that it highlighted the broken bit of code. And, if you moused over the broken code, it displayed the error. Am I remembering this right? :confused:

Wasn’t that only the case for the Eclipse Smarthome Designer?

I dunno. I never really used Designer.

I’ve been using VSCode for a long time, and I don’t remember needing to use the Problems tab to see the errors until very recently.

Strange … I have never seen any highlighting outside the problems tab :sunglasses:

I have. :sunglasses:


This was from build 1250.

1 Like

And this is from build 1405.


I dunno if removing this functionality was intentional or not…

@Kai Can you clarify whether this change was intentional?

  • Even the problems tag stays empty
  • @mhilbush: Which tool do you use for creating this cool video / animations

I am not aware of any intentional changes, no. The only change wrt LSP was the Xtext upgrade that was done 1-2 months ago. Maybe this broke something in this regard?

I’ve just quickly tested it on 2.4.0.M5 and VS Code 1.28.2 and it all works as expected:

Hmm. I’m on build 1405 and VS Code 1.28.2. I wonder why it’s not working for me. I’ll continue to investigate. Thanks for checking.


@sihui It sounds like you’re seeing the same behavior as me (i.e. no inline display of problems as you type). What’s your config?

Could you clarify a couple more things about your config?

  • Are you running 0.4.0 of the openHAB VS Code extension?
  • Are you running VS Code on the same host as openHAB?
    "openhab.host": "",
    "openhab.port": 8080

openHAB Snapshot #1380 manual install in /opt/openhab2 on a RPi 3
VSC 1.28.2
openHAB VS Code Extension 0.4.0




I installed VS Code and the openHAb extension on the same Ubuntu 16.04 box that’s running openHAB build 1404. The inline error highlighting works!

So, the issue appears to be where VS Code is running on a separate box (both Windows and Mac in my case), which is accessing the openHAB conf directory via a share.

We can confirm…
@sihui Are you running VS Code on a separate host than openHAB?
@kai Are you running VS Code on the same host as openHAB?

@Kai Do you consider this a regression? Possibly related to the xtext upgrade, as that appears to be the primary difference relating to LSP?

Yes, Windows 10.

It’s running away from my question :smiley:

  • I’m running OH on a remote host
  • I’m not accessing config folder via share - I’m working with a local git repository
  • The problem occurs on 2 different Macs running the newest vscode and openHAB Plugin.
  • I don’t see any information - neither inline, nor in the problems tab.

Here’s my config:

"openhab.host": "",
"openhab.port": 8080

Sorry about that. :wink:

I’m not familiar with that type of config with respect to VS Code and openHAB.

LSP is installed and active, right?

openhab> list -s | grep lsp
 94 │ Active   │  80 │ 0.4.1.v20180515-1321   │ org.eclipse.lsp4j
 95 │ Active   │  80 │ 0.4.1.v20180515-1321   │ org.eclipse.lsp4j.jsonrpc
131 │ Active   │  80 │    │ org.eclipse.smarthome.model.lsp

Did you try adding this to your vscode config?

	"openhab.lspEnabled": true,
	"openhab.lspPort": 5007,

lsp is installed and active - checked via netstat. There’s a service listening on 5007

I’ve set the two options on my notebook - nothing changed.