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 Thread desciptions to the hover provider #240

Closed CWempe closed 3 years ago

CWempe commented 3 years ago

Just like the feature request for cron (#237) it would be great if there was a human readable description for the Thread.sleep() method in rules.

So lazy people like me do not have to calculate Thread::sleep(420000) to 7 minutes ourselves. 😄

Confectrician commented 3 years ago

I know i am overloading myself with work (🙃):

But what about a little calculator for this, that inserts it as a snippet? Probably there is already some kind of lib or api that could do the work. We could then add a small area to the sidebar for this ( and possible other comfort functions in future).

Confectrician commented 3 years ago

Hey @CWempe

What do you think about this presentation? (Hopefully no one uses hour long thread sleeps... Mabye i shoulld remove that one.)

image

CWempe commented 3 years ago

I would prefer a simpler design in one line, I guess.

And I would get rid of leading zeros and 0 values at all to make it quicker and easier to read..

I am not sure what the best format would be either. 😕

Some ideas:

Looks like the ISO 8601 is not the way to go: P3Y6M4DT12H30M17S 😆

Confectrician commented 3 years ago

I have changed to the one line version already, because of simplicity. I have also added a formatting that avoids displaying zero values. This way we are perfectly fine with using long words for the display.

image

image

image

When i am really bored some time i will also try to adapt hours to hour, when the number is exactly one.

CWempe commented 3 years ago

Great!

btw: You might want to list this feature in the README.md. :)

Confectrician commented 3 years ago

Still looking for voluunteers to add a nice documentation we could then fetch into the docs.

BUt thats a long term topic...

CWempe commented 3 years ago

btw: I still think we do not need a description in the hover pop up.

image

We do not have one for the Item state hover... 😉

image

Confectrician commented 3 years ago

Yep. I left that out because of the poor formatting options we have over there.

Can you open a small new issue to track that? I will bring it up before next release.