VS Code openHAB Extension!

syntax
ide
vscode
Tags: #<Tag:0x00007fd31691eda8> #<Tag:0x00007fd31691ebf0> #<Tag:0x00007fd31691e9e8>

(Josar) #243

@picarsqu3 Are you on Windows 10?
I use openSSH build in windows.

https://blogs.msdn.microsoft.com/powershell/2017/12/15/using-the-openssh-beta-in-windows-10-fall-creators-update-and-windows-server-1709

If not maybe this helps.


(Arno Pernozzoli) #244

Hi,

VS Code seems to send a request to openHAB REST API every time a new character is entered into the editor. Syntax checks slows down to unusable. I’m running openhabianpi. Am I missing any configuration settings to make it faster?

Cheers
Arno


(Kuba Wolanin) #245

@pernozzoli it’s not a REST call, but a JSON RPC-based communication of LSP (Language Server Protocol) for syntax validation with your OH.
You can disable it with "openhab.lspEnabled": true (hit Ctrl + , for settings) but ultimately I’d look through the log files and see if there are any stack traces regarding lsp.

Cheers,
Kuba


(SiHui) #246

Thx, would be great, I’m seeing

this too (RPi 3, openHAB snapshot #1268)


(c) #247

The MSDN URL worked for me, thank you!


(Chris) #248

My VSCode autocompletion / error checking is slow as hell as well. It rhymes, but its a pain.
For non-believers I have created a very short video in terrible quality (to reduce upload size and protect my precious “privacy”). Never mind the stuff I entered, its nonsense anyway, but what you can see is how painfully slow autosuggest works. The red “error” marker builds up letter by letter until it finally has “read” the entire word and then shows the autosuggest dropdown. Error handling thus is also painfully slow. openhab.log looks unsuspicious.
The upload will be available for 30 days / thus mid June.


(Holger OpenhabUser) #249

Same for me, the red error marker is creaping character by character…


(SiHui) #250

I just realized there is not even an issue for it, so I opened one:


(SiHui) #251

Issue got closed, similar issue exists already in the ESH tracker, added the slow autocompletion issue over there:


(Holger OpenhabUser) #252

Ha, thats interresting. I do not see any 100% CPU load, but I can see the CPU load on the raspi R3 goining up from 5% to 30…40% while I edit a rule file and the syntax check is checking a single character every 2 seconds. After checking finished it drops back to the normal value.
I run samba share on the raspi, VScode runs on a Core i5 with Win10, CPU load around 10…15%, so this can’t be the issue.


(Moxified) #253

Yeah, that’s my issue. Haven’t gotten much love. I long ago disabled the LSP as it renders editing impossible. I don’t make changes to my system all that often so it hasn’t been a big issue but is super annoying when I do make changes.

@HolgerL, is that 30-40% total or of a single core? I saw similar where the CPU on my debian server would jump to 100% of a single core while it was catching up and then would drop back off to normal low levels. I’m using an i7 macbook as my VSCode machine.


(Holger OpenhabUser) #254

That 30-40% is the CPU load of the RPi3 running Openhabian and samba share! The value is reported by the CPU Binding. It is not the CPU load of the PC running VSCode! This is low.


(Aaron) #255

Is there an alternative to vs code for android so I could develop my rules ect while out and about


(Michael Cumming) #256

I am seeing the same issue - were you able to solve it?

Mike


(Peter Ooms) #257

Hi, I just started via VSC & got the same (file not found while trying to peek for definition). Below my circumvention that works (for me).

What I’ve done is to create a local symbolic link for the “inaccessible” prime-directory which (now) redirects to the SMB mounted NAS path.

My openHAB configuration is stored and executes on a NAS location and I edit remotely via SMB access.
The openHAB config is physically store don the NAS in /share/openHAB/conf , I access/edit this through SMB //qnapsrv/rdisk that is locally mounted as/in /media/Rdisk . So flat editing are done via /media/Rdisk/openHAB/conf…"

For VSC, which couldn’t find “/share/…” , I’ve added a symbolic link “ln -s /share/ /media/Rdisk” which effectively will redirect the primary (not found) directory, to & by the accessible target location. Things are now working smoothly…

Note: to prevent all kinds of generic UNC path problems etc.etc., I access my remote SMB files via explicit cifs mounts.

In your case the openHAB is remotely stored in directly “/etc/openHAB”, you could create a local symbolic link “openHAB/” in your local “/etc” directory that will redirect to the SMB/cifs mounted //server/bla/bla/etc/openHAB location