openhab / openhab-vscode

VS Code extension for openHAB configuration files
https://marketplace.visualstudio.com/items?itemName=openhab.openhab
Eclipse Public License 2.0
159 stars 47 forks source link

Refactor config usage #235

Closed Confectrician closed 3 years ago

Confectrician commented 3 years ago

Fixes #221

This will remove static properties from several locations and replace them with methods to get config values during execution. This way configuration changes should get reflected immediately.

Additionally this includes a watcher for config changes. Changes on openHAB connection related configuration parameters will lead to a refresh of the ItemExplorer and ThingsExplorer now.

It also introduces a bit more extended error handling with some more output, which should hopefully improve supporting.

Confectrician commented 3 years ago

@LinqLover

Could you do me a favor and check if it works in your environment? https://dev.azure.com/openhab/vscode-openhab/_build/results?buildId=159&view=artifacts&pathAsName=false&type=publishedArtifacts

I have tested it with an invalid host setting and after correcting and changing it, the item and thing views cam up immediately. If we should watch for another setting and do something right away after it has been changed, just give me a hint. Connection was the only usecase for me currently. (Besides LSP but i won't touch that currently.)

Confectrician commented 3 years ago

Merging a bit early, since i want to update some dependencies and package configs afterwards. If something occurs during test please use the corresponding issue and i will reopen that.