VSCode Extension - 0.6.0-beta for testing available

I have finished everything i wanted before a new release, so here it is.

You can get version 0.6.0-beta here:
https://dev.azure.com/openhab/vscode-openhab/_build/results?buildId=68&view=results

Just download the build artifact as shown in the screenshot below.
image

Happy testing and feedback welcome as usual.
If it runs well, i would like to push it to the marketplace by the end of this or the beginning of next week. :slight_smile:

Enjoy!

6 Likes

For the record:

I get a Notifcation, which seems to be caused by the internal language server on my live environment.
image
As far as i remember i hadnā€™t this while debugging.
Output is showing no relevant/useful information.

Same here:
grafik
Snapshot #1738 on Debian Buster

and

[Error - 18:49:48] Connection to server is erroring. Shutting down server.

Server Error as usual. :man_shrugging:
Hopefully the openHAB core pr will solve this.

Additionally I would guess that the notification is also a result of this.

1 Like

One question aside to all who have downloaded already:

I have fixed a bug with syntax highlighting.
Reference:

Would be nice if you check for flaws in syntax highlighting.
-> .persist-Files and .things-Files have a strange look now through this, but i was willed to accept that for now.
persist and things files have quite a different syntax compared to items/rules/sitemaps so they donā€™t fit into this really well anyway.
Long story short:
If you recognize strange highlighting in those two file types call it ā€œon purposeā€.

If you finde some strange highlighting in items/rules/sitemap files, please give me feedback here.

grafik

Not too bad:
grafik

I donā€™t use any :sunglasses:

Looks all good to me.

Very Interesting. I checked ALL_UPPERCASE with an underscore in regex 101 for this,
but it seems that vscode handles it different.
But we are on a good direction. :slight_smile:

ALLUPPERCASE is recognised but overwritten by a special commands pattern.
-> This is a wontfix from my side. Too much effort needed to catch this up well.

Thatā€™s fine. All uppercase looks ugly anyway :grinning:

1 Like

@Confectrician Iā€™ve been running 0.6.0 for a couple days. Looks pretty good so far, but Iā€™m seeing the following, which Iā€™ve never seen before.

When I have VS Code open, Iā€™m seeing some spurious messages in my openhab.log file.

2019-11-07 12:26:42.389 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/actionItem' for the unknown item 'actionItem'.
2019-11-07 12:26:42.898 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/Garage' for the unknown item 'Garage'.
2019-11-07 12:31:13.659 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/0' for the unknown item '0'.
2019-11-07 12:31:27.735 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/0' for the unknown item '0'.
2019-11-07 12:31:28.137 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/0' for the unknown item '0'.
2019-11-07 12:32:26.640 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/command' for the unknown item 'command'.
2019-11-07 12:32:27.670 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/command' for the unknown item 'command'.
2019-11-07 12:32:28.038 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/to' for the unknown item 'to'.
2019-11-07 12:32:29.515 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/Send' for the unknown item 'Send'.
2019-11-07 12:32:29.827 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/Send' for the unknown item 'Send'.
2019-11-07 12:33:01.335 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/door' for the unknown item 'door'.
2019-11-07 12:33:07.438 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/door' for the unknown item 'door'.
2019-11-07 12:33:07.740 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/door' for the unknown item 'door'.
2019-11-07 12:33:31.777 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/door' for the unknown item 'door'.
2019-11-07 12:33:43.995 [INFO ] [rest.core.internal.item.ItemResource] - Received HTTP GET request at 'items/when' for the unknown item 'when'.

Edit: It seems to happen editing a rule when I mouse over something thatā€™s not an item.

1 Like

Hey @mhilbush,

First: You won the game. :laughing:
I was curious how long it takes to report this behavior here.

This is indeed introduced by the new hover provider, which will display item informations on mouseover in the editor.
I have recognized those messages too in my logs.
I have already broken down the algorithm to just send a request to rest api, when a single word was hovered.

But apart from that it is currently a try and error approach.

  • If rest api responds with an item -> Do the hove effect
  • If not -> do nothing

I have not yet decided what is the best way of improving this.

We could do a ā€œbigā€ rest request on startup and fill some kind of storage to lookup all available items.
So we could decide if a hove is valid before making another http request.
I think this is my favourite idea so far.

Hey @sihui,

Do you still get this Notification with the beta and the latest snapshot including the lsp server fix?

Nope, all good now :+1:

The only issue I have: if an error is shown I cannot open the file by clicking on the error message:
grafik

I tried to open the conf folder directly through the share and also from a mapped drive, no difference.

Edit:
-rw-r--r-- 1 openhab openhab 1876 Dez 15 2018 daytimes.rules

Hi Jerome,

Thanks for your continuous work to improve the VSC extension. Just installed it and will keep a close eye on it and report results soon.

1 Like

I have added one really small feature, since i was annoyed from the current situation.


It just adds the already existing docs and insert item from channel commands,
which are usually available via command input or context menu.

Also i am working on a HoverProvider Class, which will load all existing item names from rest api on first need and then check those items for the hovered text.
We will then only ask the rest api for item values if a real item is hovered currently.

And since there are no bigger flaws so far i would then push a new release after a short testing period of this improvements. :slight_smile:

4 Likes

And done.

Artifact will be available soon here: (I have updated the first post already.)
https://dev.azure.com/openhab/vscode-openhab/_build/results?buildId=68&view=results

Feedback welcome as usual.
I would expect that those

Received HTTP GET request at 'foo' for the unknown item 'bar'

messages disappear completely.

1 Like

Time for complains is over. :stuck_out_tongue: (At least in this thread now^^)
I will prepare and push next release to marketplace now.

2 Likes