-
-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update autocompletion for ECMAScript2021 #1421
Conversation
This updates `addItem(...)` and `updateItem(...)` for the breaking changes from openhab/openhab-js#109. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
This adds the `things` namespace with the `Thing` class and the Thing getter methods. Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
…pt 2021+ openhab#1358 Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Signed-off-by: Florian Hotze <florianh_dev@icloud.com>
Job #450: Bundle Size — 10.75MB (-0.17%).Changed metrics (3/10)
|
Thanks!
I tried with the obvious: "addItem": {
"!doc": "Creates a new Item within openHAB (see JS Scripting docs/Standard Library/Items).",
"!type": "fn(itemConfig: ItemConfig) -> Item",
"!url": "https://openhab.org/addons/automation/jsscripting/#itemconfig"
}, and it seems to work? (however you shouldn't denote optional keys with '?' because they will be taken literally and added when you autocomplete). |
"TimeNamespace": { | ||
"toZDT": { | ||
"!doc": "Converts nearly any representation of a time to a time.ZonedDateTime (see JS Scripting Docs/Standard Library/Time)", | ||
"!type": "fn(time: any) -> time.ZonedDateTime" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please note that any
is a TypeScript keyword, here is should be ?
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay thanks.
I will do this ASAP.
Interesting, I was trying this yesterday evening and it did not work. I will recheck ASAP.
Okay, I‘ll fix that. |
Note that you do have to force the autocomplete with Ctrl-Space when inside the ItemConfig object's curly braces. Another keyboard action that is... not properly documented is Ctrl-Q which will open a tooltip with the description of the term where the cursor is (also the docs links don't work, this is a bug). |
Signed-off-by: Yannick Schaus <github@schaus.net>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@florian-h05 I addressed the points above in my last commit so that this PR is merged in time for 3.3.RC1. Thanks!
@ghys Thank you very much! FYI: I was planning to address your comments this evening when I am back home, as I was not at home this week and did not have access to my machine. |
@ghys
Fixes #1358
This PR updates the openhab-js tern definitions for the breaking changes and improvements of the latest openhab-js release (2.0.0) as well as some other improvements.
The
event
properties are fixed.The
time
and thethings
namespaces and the cloud notification actions are also added.I have tested the change, everything works but I was unable to use the ItemConfig as parameter type for
addItem
andreplaceItem
.Signed-off-by: Florian Hotze florianh_dev@icloud.com