maxbec / openHAB-Alignment-Tool

This extension adds support for formatting and indenting openHAB files. At the moment only the item-files are supported.
https://marketplace.visualstudio.com/items?itemName=max-beckenbauer.oh-alignment-tool
Eclipse Public License 2.0
21 stars 4 forks source link

Misformatting on certain characters inside strings #9

Closed pelerner closed 4 years ago

pelerner commented 4 years ago

Certain characters enclosed in "..." lead to misformatting and syntactical incorrect item-files.

Expected Behavior

The formatting should yield a working and syntactical correct item-file.

Current Behavior

On some "special characers" inside strings, the formatting fails to produce the correct syntax of an item file.

----before formatting----- Contact Wetter_Aussentemperatur_Grenze2 "AT2 <20° [MAP(de.map):%s]" (Wetter) {knx="<3/1/15"} ----after formatting----- Contact Wetter_Aussentemperatur_Grenze2 "AT2 <20° [MAP(de.map):%s]" <20° [MAP(de.map):%s]" <20° [MAP(de.map):%s]" {knx="<3/1/15"}

I suspect the less-than character "<" inside a string to fail the formatting.

Possible Solution

Improve special character handling.

Steps to Reproduce (for Bugs)

Format-Style "Column"

maxbec commented 4 years ago

Hello @pelerner

sorry i cannot reproduce the problem. In the newest version everything is formattting correctly.