More Xbase style#2699
Conversation
✅ Thanks for your pull request to the openHAB documentation! The result can be previewed at the URL below (this comment and the preview will be updated if you add more commits).Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify project configuration. |
| var thingStatusInfo = getThingStatusInfo("zwave:device:c5155aa4:node2") | ||
|
|
||
| if ((thingStatusInfo !== null) && (thingStatusInfo.getStatus().toString() == "ONLINE")) { | ||
| if (thingStatusInfo?.status?.toString == "ONLINE") { |
There was a problem hiding this comment.
I am not aware that the null-safe navigation operator is available in Java, is it? So, either the code here or ```java is wrong.
There was a problem hiding this comment.
This is DSL Rules/Xbase/DSL Script syntax. java is used to force highlighting for DSL/XBase snippets, on many other places the same approach is used.
There was a problem hiding this comment.
@dilyanpalauzov is corerct. There isn't an xbase tag available to do syntax highlighting. The tag that comes closest to doing it well is java for Rules DSL blocks. I think this is handled inconsistently throughout the docs but we should standardize on using one tag for all Rules DSL and ```java is the best candidate. The only other alternative is to extend the upstream tools we use to add xtend as a formatting tag.
| ```javascript | ||
| val headers = newHashMap("Cache-control" -> "no-cache") | ||
| ```java | ||
| val headers = #{"Cache-control" -> "no-cache"} |
There was a problem hiding this comment.
I am not aware that #{...} is either java or javascript.
There was a problem hiding this comment.
val is neither Java nor JavaScript, too. newHashMap() without terminating semi-colon is neither Java, nor JavaScript, too.
5774c51 to
934a1f3
Compare
934a1f3 to
c916777
Compare
No description provided.