Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ client/node_modules/**
!client/node_modules/vscode-languageclient/**
!client/node_modules/vscode-languageserver-protocol/**
!client/node_modules/vscode-languageserver-types/**
**/node_modules/*
!**/node_modules/semver
!**/node_modules/semver/**
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "oh-alignment-tool",
"displayName": "openHAB Alignment Tool",
"version": "2.1.6",
"version": "2.1.7",
"publisher": "max-beckenbauer",
"contributors": [
"Mark Hilbush"
Expand Down Expand Up @@ -125,7 +125,6 @@
"test": "node ./out/test/runTest.js"
},
"dependencies": {
"@types/semver": "^7.3.4",
"semver": "^7.3.5"
},
"devDependencies": {
Expand All @@ -136,7 +135,6 @@
"@types/vscode": "^1.55.0",
"glob": "^7.1.6",
"mocha": "^8.3.2",
"semver": "^7.3.5",
"tslint": "^5.20.1",
"typescript": "^4.2.4",
"vscode-test": "^1.5.2"
Expand Down
7 changes: 4 additions & 3 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@ const REGEX_ITEM_LABEL = /\".+?\"/;
const REGEX_ITEM_ICON = /<.+?>/;
const REGEX_ITEM_GROUP = /\(.+?\)/;
const REGEX_ITEM_TAG = /\[\s*(\".+?\")\s*(,\s*\".+?\"\s*)*\]/;
const REGEX_ITEM_CHANNEL_START = /\{\s*(\w*\s?=\s?"[^\}]*"?,?\s*)+\}?/;
const REGEX_ITEM_CHANNEL_END = /.*[\},]/;
const REGEX_ITEM_CHANNEL_SECTION = /(\w+\=\".*?\"\s*(\[.*?\])?)+/g;
// Updated regex to handle nested curly braces inside quoted strings
const REGEX_ITEM_CHANNEL_START = /\{.*\}$/;
const REGEX_ITEM_CHANNEL_END = /.*\}$/;
const REGEX_ITEM_CHANNEL_SECTION = /\w+="[^"]*"(\s*\[[^\]]*\])?/g;

const REGEX_SITEMAP_ELEMENTS = /\b(Frame|Default|Text|Group|Switch|Selection|Setpoint|Slider|Colorpicker|Webview|Mapview|Image|Video|Chart)\b/g;

Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function fillColumns(str: string, finalLength: number): string {
}

if (editor.options.insertSpaces) {
for (let e = 0; e < tabSize + finalLength - str.length; e++) {
for (let e = 0; e < tabSize - finalLength % tabSize + finalLength - str.length; e++) {
tab += " ";
}
str += tab;
Expand Down