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

Add human readable cron desciptions to the hover provider #237

Closed Confectrician closed 3 years ago

Confectrician commented 3 years ago

Describe the solution you'd like

It would be pretty nice to recognise hovering over a cron expression in a .rule or .persist file and describe the expression in a human readable way.

Additional context Possible ready to use library: https://github.com/bradymholt/cRonstrue It is i18n ready, so also prepared for a i18n'ified extension.

CWempe commented 3 years ago

Actually, I would not make this part of the openHAB addon.

Cron Explained does this already. The advantage of that addon is it works for everything. Not only openHAB files. And I do not know what happens if you have two addons for the same feature activated.

Confectrician commented 3 years ago

We then could recommend using cron explained in our extension instead.

Extensions can provide a extensions.json file and users then get recommendations to also use the configured extensions over there.

See: https://github.com/openhab/openhab-vscode/blob/main/.vscode/extensions.json

CWempe commented 3 years ago

Sounds like a good idea.

Confectrician commented 3 years ago

OK. Then we can add tumido.cron-explained over there.