VSC openHAB Alignment Tool

Works a treat. Thanks!

Another feature which is now also supported by the tool is the group formatting.
So the tool recognizes tabs in front of group designators and leaves them as they are. So that’s how you can generate group and sub-groups of that group. They are separated visually:

However for me it doesn’t work for multiline defined items :confused: It just inserts an empty line after the first line of each declaration

Like:

I have this:

Switch    ChromeCastOnline
          "Chromecast Online"
          { channel="network:pingdevice:10_0_0_119:online" }

And after that I get:

Switch    ChromeCastOnline

          "Chromecast Online"
          { channel="network:pingdevice:10_0_0_119:online" }

I get this. Tried uninstalling reinstalling without a success.

Hmm
 Strange. I tried it on my setup. Here it works:

May you send me your full file for testing, @rkrisi?

Ok, I have found the problem :slight_smile:

I had the other formatter installed, after removing that one, it works as it should!
I don’t know why it needs removing


1 Like

Thank you for the information. Maybe the other extension is formatting all the time, or on saving, entering a new line, etc.? I don’t use it so i actually don’t know how it works. :confused:

No it is not.
The thing I found and maybe suspicious:
In that extension you can reformat the file with shortcuts (like Ctrl + I and Ctrl + P or something like this). When I had both installed that combination also appered at your extension as well, but didn’t worked with the shortcuts or calling from the action menu.

It only formats on demand.

This likely is the culprit.

Just released version 1.0.7. Problem should be fixed, but it would be great if you can check it.
Thank you!

1 Like

Hey guys,

first of all thank you for over 400 installs on my extension in the last week. That’s incredible.
But now the real reason for my post
 If you have any feature wishes on the extension, please let me know an comment is this thread or even better open a pull request on github.

Thank you!

1 Like

@Max_Bec Max Beckenbauer
Thanks for your great work

2 Likes

Hi Max_Bec
Great Work looking out the same similar tool for Sitemap.
I am getting following error while installing ‘openHAB Alignment Tool’ from extension Marketplace.

“Unable to install ‘maximilian-beckenbauer.oh-alignment-tool’ extension because it is not compatible with the current version of VS Code (version 1.37.1).”

1 Like

Minimal supported Vscode Version is 1.38.
So you should if there is an Vscode update available for you. :slight_smile:

Good morning everyone,

due to installation problems of many users i had to delete the old extension.
You can find the new extension under the exact same name and link:

openHAB Alignment Tool

With this release (1.3.0) i also implemented the features of Mark Hilbush (@mhilbush) openHAB Formatter extension. I had a chat with Mark about our extensions and we came to the conclusion to join forces and - even in preparation for the implementation into the main openHAB VSC Extension - implement both formatting styles in one extension.

With the new version you now have the possibility to use the multiline formatting style of Marks extension as well. Just change it in the extension settings.

Thrilled to hear some feedback from you.

Kind Regards,
Max

7 Likes

Thanks very much @Max_Bec for incorporating my multi-line formatting into your extension. Very much appreciated!

3 Likes

The extension removes comments at the end of a line of code. The comment should be preserved.

1

Version 1.3.3. i reported them on github:
https://github.com/MaxBec/openHAB-Alignment-Tool/issues/5

1 Like

Hi, this sounds as a great extension. but Ive an issue when selecting the command, I get an error: 'extension.reformat-file' not found

I’ve the latest VSC version.

edit: I was trying it on laptop from work. on my home computer, everything works fine! thanks!!

Thank you for your feedback.
Version 1.3.4 should fix it for “//”-Comments. Please test it.

@wars: Strange. I double checked all the commands. Please try to uninstall and reinstall the extension.

@Max_Bec it works like a charm :slight_smile:
Really love this addon!

1 Like

Hello @wars,

i was able to reproduce your error.
The binding only works on *.item files at the moment. So in the active editor must be an item file opened.

1 Like