VSCode doesn't validate my code

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.

GIPHY CAPTURE on my Mac.

@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": "192.168.2.237",
    "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

Edit:

test

test1

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": "192.168.0.100",
"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 │ 0.10.0.201810290804    │ 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.

I can only assume it’s because of this.

Can you try running VS Code on the openHAB host, or try using a shared folder? I know those configs will work, and may more easily help to determine the cause of the issue.

FYI, I opened an issue for the inline validation issue.

1 Like

That’s the problem. Obviously it only works on shared folders. I’ll open a change request. But the inline validation works for me even on shared folder.

What build are you running? It worked up until around September 20.

I’m running with 2.3.0 Stable Release

Hi,

was starting yesterday with VS code. installed the version 0.4.1 from marketplace.

code validation is NOT working using \\openhabpi\openhab240\conf e.g.
code validation is working using X: for mentioned samba share.

https://github.com/eclipse/smarthome/pull/6463 seems to be merged into 0.4.1 …

Don’t know if


was about the my issue or about “never working via SMB share” ?!? :astonished:

BR/
Peter

The xtext upgrade from a while back broke samba shares, which had worked prior to the upgrade. My change fixed it for paths specified using a drive letter, but not for a UNC paths. I’m not sure how to fix it for UNC paths.

Hi Mark,
created


to help newbies to ease the start using VS code with OH
BR/
Peter

1 Like

…and closed issue again. :open_mouth:

there is already an issue:

even the docs for editors stating:

Attention Windows users: Directly accessing network shares (UNC paths) is often not supported. Please be sure to mount the network share to a drive letter

-> not easy for beginners and not hassle-free but everything okay now

1 Like