Skip to content

More Xbase style#2699

Open
dilyanpalauzov wants to merge 1 commit into
openhab:mainfrom
dilyanpalauzov:more_xbase_style
Open

More Xbase style#2699
dilyanpalauzov wants to merge 1 commit into
openhab:mainfrom
dilyanpalauzov:more_xbase_style

Conversation

@dilyanpalauzov

Copy link
Copy Markdown
Contributor

No description provided.

@netlify

netlify Bot commented Apr 11, 2026

Copy link
Copy Markdown

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

Name Link
🔨 Latest commit c916777
🔍 Latest deploy log https://app.netlify.com/projects/openhab-docs-preview/deploys/6a11b01d8bce54000869d881
😎 Deploy Preview https://deploy-preview-2699--openhab-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread configuration/actions.md
var thingStatusInfo = getThingStatusInfo("zwave:device:c5155aa4:node2")

if ((thingStatusInfo !== null) && (thingStatusInfo.getStatus().toString() == "ONLINE")) {
if (thingStatusInfo?.status?.toString == "ONLINE") {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

Comment thread configuration/actions.md
```javascript
val headers = newHashMap("Cache-control" -> "no-cache")
```java
val headers = #{"Cache-control" -> "no-cache"}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not aware that #{...} is either java or javascript.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

val is neither Java nor JavaScript, too. newHashMap() without terminating semi-colon is neither Java, nor JavaScript, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants