I only use vscode for openhab. If i move the items-files, rules-files and so on from left side (explorer-view) to the workbench, i can open all files in multiple tabs, only if i press the files on left side with the mouse-button (left or middle button) it only opens 1 single tab and every new items-file is opened in the same tab.
latest VSCode 1.18.1 on Win10 64bit Prof
Openhab 2.2 snapshot - latest build # 1138 from 15.12.2017 - running on debian server
openhab.log shows errors like this:
2017-12-15 07:49:22.853 [ERROR] [nrpc.json.ConcurrentMessageProcessor] - java.net.SocketException: Connection reset
java.lang.RuntimeException: java.net.SocketException: Connection reset
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:103) [102:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
at org.eclipse.lsp4j.jsonrpc.json.ConcurrentMessageProcessor.run(ConcurrentMessageProcessor.java:84) [102:org.eclipse.lsp4j.jsonrpc:0.2.1.v20170706-0855]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:?]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:?]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [?:?]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [?:?]
at java.lang.Thread.run(Thread.java:748) [?:?]
Caused by: java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(SocketInputStream.java:210) ~[?:?]
at java.net.SocketInputStream.read(SocketInputStream.java:141) ~[?:?]
at java.net.SocketInputStream.read(SocketInputStream.java:224) ~[?:?]
at org.eclipse.lsp4j.jsonrpc.json.StreamMessageProducer.listen(StreamMessageProducer.java:61) ~[?:?]
... 6 more
and
2017-12-15 07:51:06.412 [WARN ] [eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Unmatched cancel notification for request id 1
2017-12-15 07:51:06.768 [WARN ] [eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Unmatched cancel notification for request id 2
2017-12-15 07:51:22.871 [WARN ] [eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Unmatched cancel notification for request id 10
2017-12-15 07:51:33.999 [WARN ] [eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Unmatched cancel notification for request id 14
2017-12-15 07:51:35.651 [WARN ] [eclipse.lsp4j.jsonrpc.RemoteEndpoint] - Unmatched cancel notification for request id 16
My point is that there’s no single line of code in my extension that would affect tabs management.
Thus, I need you to double check it before I go further with investigating that.
Please disable the extension and try reproducing the bug again.
If opening a file, it will be loaded in a tab. Now, if loading the next file without changing anything, VSCode decides to load the new file in the same tab. But if you change something in the file, the Tab name changes from italics to normal and the tab gets ‘pinned’. Now the tab ins’t overloaded by a new opened file but instead a new tab is opened.
@kubawolanin Is there a way (in future releases) that clicking on an item inside of the code editor (i.e. while editing a *.rule file) to see it’s value?
Maybe by letting the item browser window automatically jump the the related entry, by showing a small hint or having it in the context menu somehow?
Right now the item browser is nice, but as there seems to be no search function it is partially very time consuming finding the related item.
I’m new to OpenHAB so I apology in advance as my knowledge about the platform is very limited although I’ve been reading a lot. Today I just upgraded to latest openhabian release (2.2.0-1) because I wanted to give a try to the integration with Visual Code.
So I installed Visual Code as well, and the extension for OpenHab (release 0.3.5). I also changed the configuration file to point to my openhabian IP server.
As soon as I open Visual code, I receive the message “internal error, please look at the server’s logs”.
And this is where my nightmare starts This is what I’ve done so far:
If I change the parameter openhab.lspEnabled from true to false, the error message disappears
Syntax checking seems to work properly
Server is listening to port 5007 and it seems it’s connecting with my desktop computer (see attached file)
But if I try to check openhabian logs, there is no errors to trace this. Nothing, void
Can someone help me to work it out?
Thank you!!
PD: I’m about to give up cause although I have a minimal installation to get used to this environment (only 2 wifi led controllers), it’s not so uncommon to see some error messages in my var log during the starting process and it’s very time consuming to debug them as openhab is a big, very big project. On the other hand, I’m really engaged as I love this project but it’s taking a huge amount of time to get a grasp.
I would love to be knowledgeable about openHab!!!
I have exactly the same problem. I am using openhab-2.2.0 release and VS Code Extension 0.3.5.
The error messages described in the reply above openHAB VS Code Extension 0.3.5 come from the openhab server (easily to spot using wireshark listening to port 5007).
I am migrating from OpenHAB1 and was hoping to have VS Code check my (existing) rules file for errors, but I am not sure if it will do that even with LSP working? I was expecting an error highlighting similar to the Openhab/Smarthome Designer.
openhab> bundle:list | grep Language
138 â Active â 80 â 0.10.0.b1 â Eclipse SmartHome Language Server
but there is no output in the openhab.log related to the Language Server, although it is responding (seen via Wireshark).
Can the loglevel be adjusted for the Language Server (how)?
If it would work properly, would VS Code validate the code and mark errors/warnings along with a description of what’s wrong just like the Designer did?
Been migrating from Openhab/Smarthome Designer to VSCode. So far it’s gone pretty well, but I’m left with a few questions after reading this thread and the README on github:
Integrated quick search of openHAB Docs page (Alt + Shift + O)
Alt + Shift + O does nothing on my system. I have the eclipse keybindings extensions installed, but I have disabled it and restarted, still nothing
Integrated quick search of openHAB Community
How to open this search?
Code snippets for openHAB, including Design Patterns by Rich Koshak
Great idea! How do I access these?
Quick Karaf console access
You guessed it… how do I trigger this? I have configured the ssh command in settings
PS I am more than happy to submit a PR for the README for these
I would recommend you to check out the VSCode usage docs to answer your basic questions.
You can reconfigure your keybindings to match virtually any command/action in VScode. I suspect that Eclipse keybindings overrode that setting, and that’s ok
Select any text in openHAB files (items/rules/sitemap/persist/script etc)
Ctrl + Shift + P
Type “Community” and choose the right option
These are stored here and in fact are not documented anywhere. If we want them to be in docs, we may need to create a bash script that would generate a table of them in some place in README file. PRs are welcome!
I’m running OH2.2 on RPI3 and suffer some performance issues while just typing in my code. VS Code seems to check each and every character I’ve typed in and hence creating quite a high load on my RPI3. Can I somehow fix this by myself?