diff --git a/.github/workflows/github-actions-language-service.yml b/.github/workflows/github-actions-language-service.yml index 6b238062d5..97985bf2b4 100644 --- a/.github/workflows/github-actions-language-service.yml +++ b/.github/workflows/github-actions-language-service.yml @@ -20,7 +20,7 @@ jobs: uses: actions/checkout@v3 - name: 🏗 Set up NodeJS - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3.7.0 with: node-version: "16" diff --git a/.github/workflows/github-actions-vscode-extension.yml b/.github/workflows/github-actions-vscode-extension.yml index 82bea54a3f..9b6fee3366 100644 --- a/.github/workflows/github-actions-vscode-extension.yml +++ b/.github/workflows/github-actions-vscode-extension.yml @@ -12,7 +12,7 @@ jobs: uses: actions/checkout@v3 - name: 🏗 Set up NodeJS - uses: actions/setup-node@v3.6.0 + uses: actions/setup-node@v3.7.0 with: node-version: "16" diff --git a/package-lock.json b/package-lock.json index d4fd1a624f..e5ce6d96ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "vscode-home-assistant", - "version": "1.36.0", + "version": "1.37.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "vscode-home-assistant", - "version": "1.36.0", + "version": "1.37.0", "license": "MIT", "dependencies": { "axios": "^1.4.0", "bufferutil": "^4.0.7", - "home-assistant-js-websocket": "^8.0.1", + "home-assistant-js-websocket": "^8.2.0", "utf-8-validate": "^6.0.3", "vscode-extension-telemetry": "0.4.5", "vscode-json-languageservice": "3.9.1", @@ -26,22 +26,22 @@ }, "devDependencies": { "@types/mocha": "10.0.1", - "@types/node": "16.18.31", + "@types/node": "20.4.2", "@types/request": "2.48.8", "@types/vscode": "1.45.1", - "@types/ws": "8.5.4", + "@types/ws": "8.5.5", "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.8.0", "husky": "^8.0.3", "lint-staged": "^13.2.2", - "prettier": "^2.8.8", + "prettier": "^3.0.0", "rimraf": "5.0.1", - "ts-loader": "^9.4.2", + "ts-loader": "^9.4.3", "ts-node": "10.9.1", - "typescript": "^5.0.4", - "typescript-json-schema": "0.56.0" + "typescript": "^5.1.3", + "typescript-json-schema": "0.59.0" }, "engines": { "vscode": "^1.45.1" @@ -451,9 +451,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "16.18.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.31.tgz", - "integrity": "sha512-KPXltf4z4g517OlVJO9XQ2357CYw7fvuJ3ZuBynjXC5Jos9i+K7LvFb7bUIwtJXSZj0vTp9Q6NJBSQpkwwO8Zw==", + "version": "20.4.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.2.tgz", + "integrity": "sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==", "dev": true }, "node_modules/@types/request": { @@ -481,9 +481,9 @@ "dev": true }, "node_modules/@types/ws": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", - "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", + "integrity": "sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==", "dev": true, "dependencies": { "@types/node": "*" @@ -554,9 +554,9 @@ "dev": true }, "node_modules/@typescript-eslint/eslint-plugin/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -750,9 +750,9 @@ "dev": true }, "node_modules/@typescript-eslint/typescript-estree/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -1861,9 +1861,9 @@ "dev": true }, "node_modules/eslint/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -2331,9 +2331,9 @@ } }, "node_modules/home-assistant-js-websocket": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/home-assistant-js-websocket/-/home-assistant-js-websocket-8.0.1.tgz", - "integrity": "sha512-CVi1yu4+hj3m3+ZxgzEYiP+UYFmjf/iAsUKVyCmhVm9T8Pn7ZCeW16O3pniC4h1DOmTuXW+z4v373UwKxVOMAg==" + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/home-assistant-js-websocket/-/home-assistant-js-websocket-8.2.0.tgz", + "integrity": "sha512-B163iuvC1hsObkbSXm89JfjjOguyQXSQeQsGf6KQblUj9QwMgFkQt13TiCYjeFFTMzhQ8Qj3/gKx/6MnSeYUqA==" }, "node_modules/http-proxy-agent": { "version": "2.1.0", @@ -3123,9 +3123,9 @@ } }, "node_modules/path-equal": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.1.2.tgz", - "integrity": "sha512-p5kxPPwCdbf5AdXzT1bUBJomhgBlEjRBavYNr1XUpMFIE4Hnf2roueCMXudZK5tnaAu1tTmp3GPzqwJK45IHEA==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.2.5.tgz", + "integrity": "sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g==", "dev": true }, "node_modules/path-is-absolute": { @@ -3212,15 +3212,15 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", + "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -3487,9 +3487,9 @@ } }, "node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", "bin": { "semver": "bin/semver.js" } @@ -3872,9 +3872,9 @@ } }, "node_modules/ts-loader": { - "version": "9.4.2", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", - "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", + "version": "9.4.3", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.3.tgz", + "integrity": "sha512-n3hBnm6ozJYzwiwt5YRiJZkzktftRpMiBApHaJPoWLA+qetQBAXkHqCLM6nwSdRDimqVtA5ocIkcTRLMTt7yzA==", "dev": true, "dependencies": { "chalk": "^4.1.0", @@ -3949,9 +3949,9 @@ } }, "node_modules/ts-loader/node_modules/semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "dependencies": { "lru-cache": "^6.0.0" @@ -4076,28 +4076,28 @@ } }, "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=12.20" + "node": ">=14.17" } }, "node_modules/typescript-json-schema": { - "version": "0.56.0", - "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.56.0.tgz", - "integrity": "sha512-k/aSEqx89YR2z/f2y3VwoOGzlKTWern0EIey2qqEpMRP7HL4CI8udPElzJs4eFVkPowCLJ1yVBSzuIWIUF+mMA==", + "version": "0.59.0", + "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.59.0.tgz", + "integrity": "sha512-eYB9RO8p4PntznWUukdDQHckNfxzjEFCJUgsWeCE43mcFioE0wXGTSECGk1uhty9XQMxkpuI4pKAqqnb62ln3Q==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@types/node": "^16.9.2", "glob": "^7.1.7", - "path-equal": "^1.1.2", + "path-equal": "^1.2.5", "safe-stable-stringify": "^2.2.0", "ts-node": "^10.9.1", "typescript": "~4.9.5", @@ -4107,6 +4107,12 @@ "typescript-json-schema": "bin/typescript-json-schema" } }, + "node_modules/typescript-json-schema/node_modules/@types/node": { + "version": "16.18.38", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.38.tgz", + "integrity": "sha512-6sfo1qTulpVbkxECP+AVrHV9OoJqhzCsfTNp5NIG+enM4HyM3HvZCO798WShIXBN0+QtDIcutJCjsVYnQP5rIQ==", + "dev": true + }, "node_modules/typescript-json-schema/node_modules/glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -4380,9 +4386,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -5014,9 +5020,9 @@ "dev": true }, "@types/node": { - "version": "16.18.31", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.31.tgz", - "integrity": "sha512-KPXltf4z4g517OlVJO9XQ2357CYw7fvuJ3ZuBynjXC5Jos9i+K7LvFb7bUIwtJXSZj0vTp9Q6NJBSQpkwwO8Zw==", + "version": "20.4.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.2.tgz", + "integrity": "sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==", "dev": true }, "@types/request": { @@ -5044,9 +5050,9 @@ "dev": true }, "@types/ws": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", - "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", + "integrity": "sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==", "dev": true, "requires": { "@types/node": "*" @@ -5090,9 +5096,9 @@ "dev": true }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -5207,9 +5213,9 @@ "dev": true }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -6048,9 +6054,9 @@ "dev": true }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -6426,9 +6432,9 @@ "dev": true }, "home-assistant-js-websocket": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/home-assistant-js-websocket/-/home-assistant-js-websocket-8.0.1.tgz", - "integrity": "sha512-CVi1yu4+hj3m3+ZxgzEYiP+UYFmjf/iAsUKVyCmhVm9T8Pn7ZCeW16O3pniC4h1DOmTuXW+z4v373UwKxVOMAg==" + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/home-assistant-js-websocket/-/home-assistant-js-websocket-8.2.0.tgz", + "integrity": "sha512-B163iuvC1hsObkbSXm89JfjjOguyQXSQeQsGf6KQblUj9QwMgFkQt13TiCYjeFFTMzhQ8Qj3/gKx/6MnSeYUqA==" }, "http-proxy-agent": { "version": "2.1.0", @@ -7007,9 +7013,9 @@ } }, "path-equal": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.1.2.tgz", - "integrity": "sha512-p5kxPPwCdbf5AdXzT1bUBJomhgBlEjRBavYNr1XUpMFIE4Hnf2roueCMXudZK5tnaAu1tTmp3GPzqwJK45IHEA==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.2.5.tgz", + "integrity": "sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g==", "dev": true }, "path-is-absolute": { @@ -7068,9 +7074,9 @@ "dev": true }, "prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", + "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", "dev": true }, "progress": { @@ -7240,9 +7246,9 @@ } }, "semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==" }, "serialize-javascript": { "version": "6.0.0", @@ -7524,9 +7530,9 @@ } }, "ts-loader": { - "version": "9.4.2", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", - "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", + "version": "9.4.3", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.3.tgz", + "integrity": "sha512-n3hBnm6ozJYzwiwt5YRiJZkzktftRpMiBApHaJPoWLA+qetQBAXkHqCLM6nwSdRDimqVtA5ocIkcTRLMTt7yzA==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -7576,9 +7582,9 @@ "dev": true }, "semver": { - "version": "7.3.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", - "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "version": "7.5.4", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz", + "integrity": "sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==", "dev": true, "requires": { "lru-cache": "^6.0.0" @@ -7655,27 +7661,33 @@ "dev": true }, "typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", + "integrity": "sha512-XH627E9vkeqhlZFQuL+UsyAXEnibT0kWR2FWONlr4sTjvxyJYnyefgrkyECLzM5NenmKzRAy2rR/OlYLA1HkZw==", "dev": true }, "typescript-json-schema": { - "version": "0.56.0", - "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.56.0.tgz", - "integrity": "sha512-k/aSEqx89YR2z/f2y3VwoOGzlKTWern0EIey2qqEpMRP7HL4CI8udPElzJs4eFVkPowCLJ1yVBSzuIWIUF+mMA==", + "version": "0.59.0", + "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.59.0.tgz", + "integrity": "sha512-eYB9RO8p4PntznWUukdDQHckNfxzjEFCJUgsWeCE43mcFioE0wXGTSECGk1uhty9XQMxkpuI4pKAqqnb62ln3Q==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@types/node": "^16.9.2", "glob": "^7.1.7", - "path-equal": "^1.1.2", + "path-equal": "^1.2.5", "safe-stable-stringify": "^2.2.0", "ts-node": "^10.9.1", "typescript": "~4.9.5", "yargs": "^17.1.1" }, "dependencies": { + "@types/node": { + "version": "16.18.38", + "resolved": "https://registry.npmjs.org/@types/node/-/node-16.18.38.tgz", + "integrity": "sha512-6sfo1qTulpVbkxECP+AVrHV9OoJqhzCsfTNp5NIG+enM4HyM3HvZCO798WShIXBN0+QtDIcutJCjsVYnQP5rIQ==", + "dev": true + }, "glob": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", @@ -7890,9 +7902,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true }, "wrap-ansi": { diff --git a/package.json b/package.json index caa4795d82..0233e8839c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-home-assistant", "displayName": "Home Assistant Config Helper", "description": " Completion for entity-id's in Home Assistant Configurations", - "version": "1.36.0", + "version": "1.37.0", "preview": false, "engines": { "vscode": "^1.45.1" @@ -427,27 +427,27 @@ }, "devDependencies": { "@types/mocha": "10.0.1", - "@types/node": "16.18.31", + "@types/node": "20.4.2", "@types/request": "2.48.8", "@types/vscode": "1.45.1", - "@types/ws": "8.5.4", + "@types/ws": "8.5.5", "@typescript-eslint/eslint-plugin": "^4.33.0", "@typescript-eslint/parser": "^4.33.0", "eslint": "^7.32.0", "eslint-config-prettier": "^8.8.0", "husky": "^8.0.3", "lint-staged": "^13.2.2", - "prettier": "^2.8.8", + "prettier": "^3.0.0", "rimraf": "5.0.1", - "ts-loader": "^9.4.2", + "ts-loader": "^9.4.3", "ts-node": "10.9.1", - "typescript": "^5.0.4", - "typescript-json-schema": "0.56.0" + "typescript": "^5.1.3", + "typescript-json-schema": "0.59.0" }, "dependencies": { "axios": "^1.4.0", "bufferutil": "^4.0.7", - "home-assistant-js-websocket": "^8.0.1", + "home-assistant-js-websocket": "^8.2.0", "utf-8-validate": "^6.0.3", "vscode-extension-telemetry": "0.4.5", "vscode-json-languageservice": "3.9.1", diff --git a/src/extension.ts b/src/extension.ts index bb84f7abac..a366fee75a 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -11,7 +11,7 @@ import TelemetryReporter from "vscode-extension-telemetry"; const extensionId = "vscode-home-assistant"; const telemetryVersion = generateVersionString( - vscode.extensions.getExtension(`keesschollaart.${extensionId}`) + vscode.extensions.getExtension(`keesschollaart.${extensionId}`), ); let reporter: TelemetryReporter; @@ -22,14 +22,14 @@ const documentSelector = [ ]; export async function activate( - context: vscode.ExtensionContext + context: vscode.ExtensionContext, ): Promise { console.log("Home Assistant Extension has been activated!"); reporter = new TelemetryReporter( extensionId, telemetryVersion, - "ff172110-5bb2-4041-9f31-e157f1efda56" + "ff172110-5bb2-4041-9f31-e157f1efda56", ); try { @@ -43,7 +43,7 @@ export async function activate( context.extensionPath, "out", "server", - "server.js" + "server.js", ); const debugOptions = { execArgv: ["--nolazy", "--inspect=6003"] }; @@ -69,7 +69,7 @@ export async function activate( "home-assistant", "Home Assistant Language Server", serverOptions, - clientOptions + clientOptions, ); // is this really needed? @@ -87,22 +87,22 @@ export async function activate( const goToSettings = "Go to Settings (UI)"; const optionClicked = await vscode.window.showInformationMessage( "Please configure Home Assistant (search for 'Home Assistant' in settings).", - goToSettings + goToSettings, ); if (optionClicked === goToSettings) { await vscode.commands.executeCommand( - "workbench.action.openSettings2" + "workbench.action.openSettings2", ); } }); client.onNotification("configuration_check_completed", async (result) => { if (result && result.result === "valid") { await vscode.window.showInformationMessage( - "Home Assistant Configuration Checked, result: 'Valid'!" + "Home Assistant Configuration Checked, result: 'Valid'!", ); } else { await vscode.window.showErrorMessage( - `Home Assistant Configuration check resulted in an error: ${result.error}` + `Home Assistant Configuration check resulted in an error: ${result.error}`, ); } }); @@ -110,7 +110,7 @@ export async function activate( client.onNotification("get_eror_log_completed", (result) => { if (!haOutputChannel) { haOutputChannel = vscode.window.createOutputChannel( - "Home Assistant Error Log" + "Home Assistant Error Log", ); } haOutputChannel.appendLine(result); @@ -121,7 +121,7 @@ export async function activate( client.onNotification("render_template_completed", (result) => { if (!haTemplateRendererChannel) { haTemplateRendererChannel = vscode.window.createOutputChannel( - "Home Assistant Template Renderer" + "Home Assistant Template Renderer", ); } haTemplateRendererChannel.clear(); @@ -140,131 +140,131 @@ export async function activate( new CommandMappings( "vscode-home-assistant.reloadAll", "homeassistant", - "reload_all" + "reload_all", ), new CommandMappings( "vscode-home-assistant.scriptReload", "script", - "reload" + "reload", ), new CommandMappings("vscode-home-assistant.groupReload", "group", "reload"), new CommandMappings( "vscode-home-assistant.homeassistantReloadCoreConfig", "homeassistant", - "reload_core_config" + "reload_core_config", ), new CommandMappings( "vscode-home-assistant.homeassistantRestart", "homeassistant", - "restart" + "restart", ), new CommandMappings( "vscode-home-assistant.automationReload", "automation", - "reload" + "reload", ), new CommandMappings( "vscode-home-assistant.conversationReload", "conversation", - "reload" + "reload", ), new CommandMappings("vscode-home-assistant.sceneReload", "scene", "reload"), new CommandMappings( "vscode-home-assistant.themeReload", "frontend", - "reload_themes" + "reload_themes", ), new CommandMappings( "vscode-home-assistant.homekitReload", "homekit", - "reload" + "reload", ), new CommandMappings( "vscode-home-assistant.filesizeReload", "filesize", - "reload" + "reload", ), new CommandMappings( "vscode-home-assistant.minMaxReload", "min_max", - "reload" + "reload", ), new CommandMappings( "vscode-home-assistant.genericThermostatReload", "generic_thermostat", - "reload" + "reload", ), new CommandMappings( "vscode-home-assistant.genericCameraReload", "generic", - "reload" + "reload", ), new CommandMappings("vscode-home-assistant.pingReload", "ping", "reload"), new CommandMappings("vscode-home-assistant.trendReload", "trend", "reload"), new CommandMappings( "vscode-home-assistant.historyStatsReload", "history_stats", - "reload" + "reload", ), new CommandMappings( "vscode-home-assistant.universalReload", "universal", - "reload" + "reload", ), new CommandMappings( "vscode-home-assistant.statisticsReload", "statistics", - "reload" + "reload", ), new CommandMappings( "vscode-home-assistant.filterReload", "filter", - "reload" + "reload", ), new CommandMappings("vscode-home-assistant.restReload", "rest", "reload"), new CommandMappings( "vscode-home-assistant.commandLineReload", "command_line", - "reload" + "reload", ), new CommandMappings( "vscode-home-assistant.bayesianReload", "bayesian", - "reload" + "reload", ), new CommandMappings( "vscode-home-assistant.telegramReload", "telegram", - "reload" + "reload", ), new CommandMappings("vscode-home-assistant.smtpReload", "smtp", "reload"), new CommandMappings("vscode-home-assistant.mqttReload", "mqtt", "reload"), new CommandMappings( "vscode-home-assistant.rpioGpioReload", "rpi_gpio", - "reload" + "reload", ), new CommandMappings("vscode-home-assistant.knxReload", "knx", "reload"), new CommandMappings( "vscode-home-assistant.templateReload", "template", - "reload" + "reload", ), new CommandMappings( "vscode-home-assistant.customTemplatesReload", "homeassistant", - "reload_custom_templates" + "reload_custom_templates", ), new CommandMappings( "vscode-home-assistant.hassioAddonRestartGitPull", "hassio", "addon_restart", - { addon: "core_git_pull" } + { addon: "core_git_pull" }, ), new CommandMappings( "vscode-home-assistant.hassioHostReboot", "hassio", - "host_reboot" + "host_reboot", ), ]; @@ -277,9 +277,9 @@ export async function activate( serviceData: mapping.serviceData, }); await vscode.window.showInformationMessage( - `Home Assistant service ${mapping.domain}.${mapping.service} called!` + `Home Assistant service ${mapping.domain}.${mapping.service} called!`, ); - }) + }), ); }); @@ -302,13 +302,13 @@ export async function activate( domain, service: "reload", }); - }) + }), ); await vscode.window.showInformationMessage( - "Home Assistant inputs reload called!" + "Home Assistant inputs reload called!", ); - } - ) + }, + ), ); context.subscriptions.push( @@ -316,16 +316,16 @@ export async function activate( "vscode-home-assistant.homeassistantCheckConfig", async () => { await client.sendRequest("checkConfig"); - } - ) + }, + ), ); context.subscriptions.push( vscode.commands.registerCommand( "vscode-home-assistant.getErrorLog", async () => { await client.sendRequest("getErrorLog"); - } - ) + }, + ), ); context.subscriptions.push( @@ -335,8 +335,8 @@ export async function activate( const editor = vscode.window.activeTextEditor; const selectedText = editor.document.getText(editor.selection); await client.sendRequest("renderTemplate", { template: selectedText }); - } - ) + }, + ), ); const fileAssociations = vscode.workspace @@ -375,6 +375,6 @@ export class CommandMappings { public service: string, public serviceData?: { [key: string]: any; - } + }, ) {} } diff --git a/src/language-service/package-lock.json b/src/language-service/package-lock.json index 6ca919a726..55835500c1 100644 --- a/src/language-service/package-lock.json +++ b/src/language-service/package-lock.json @@ -1,12 +1,12 @@ { "name": "home-assistant-language-service", - "version": "1.36.0", + "version": "1.37.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "home-assistant-language-service", - "version": "1.36.0", + "version": "1.37.0", "license": "MIT", "dependencies": { "axios": "^1.2.1", @@ -20,20 +20,20 @@ }, "devDependencies": { "@types/mocha": "10.0.1", - "@types/node": "18.16.3", + "@types/node": "20.4.2", "@types/vscode": "1.48.0", - "@types/ws": "8.5.4", + "@types/ws": "8.5.5", "@types/yaml": "1.9.7", "@typescript-eslint/eslint-plugin": "^4.16.1", "@typescript-eslint/parser": "^4.16.1", "eslint": "^7.4.0", "eslint-config-prettier": "^8.1.0", - "prettier": "^2.0.5", + "prettier": "^3.0.0", "rimraf": "5.0.1", "ts-loader": "^9.2.8", "ts-node": "10.9.1", - "typescript": "5.0.4", - "typescript-json-schema": "0.56.0", + "typescript": "5.1.6", + "typescript-json-schema": "0.59.0", "vscode-test": "^1.4.0" } }, @@ -444,9 +444,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "18.16.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.3.tgz", - "integrity": "sha512-OPs5WnnT1xkCBiuQrZA4+YAV4HEJejmHneyraIaxsbev5yCEr6KMwINNFP9wQeFIw8FWcoTqF3vQsa5CDaI+8Q==", + "version": "20.4.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.2.tgz", + "integrity": "sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==", "dev": true }, "node_modules/@types/vscode": { @@ -456,9 +456,9 @@ "dev": true }, "node_modules/@types/ws": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", - "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", + "integrity": "sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==", "dev": true, "dependencies": { "@types/node": "*" @@ -2132,9 +2132,9 @@ } }, "node_modules/home-assistant-js-websocket": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/home-assistant-js-websocket/-/home-assistant-js-websocket-8.0.1.tgz", - "integrity": "sha512-CVi1yu4+hj3m3+ZxgzEYiP+UYFmjf/iAsUKVyCmhVm9T8Pn7ZCeW16O3pniC4h1DOmTuXW+z4v373UwKxVOMAg==" + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/home-assistant-js-websocket/-/home-assistant-js-websocket-8.2.0.tgz", + "integrity": "sha512-B163iuvC1hsObkbSXm89JfjjOguyQXSQeQsGf6KQblUj9QwMgFkQt13TiCYjeFFTMzhQ8Qj3/gKx/6MnSeYUqA==" }, "node_modules/http-proxy-agent": { "version": "2.1.0", @@ -2578,9 +2578,9 @@ } }, "node_modules/path-equal": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.1.2.tgz", - "integrity": "sha512-p5kxPPwCdbf5AdXzT1bUBJomhgBlEjRBavYNr1XUpMFIE4Hnf2roueCMXudZK5tnaAu1tTmp3GPzqwJK45IHEA==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.2.5.tgz", + "integrity": "sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g==", "dev": true }, "node_modules/path-is-absolute": { @@ -2655,15 +2655,15 @@ } }, "node_modules/prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", + "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", "dev": true, "bin": { - "prettier": "bin-prettier.js" + "prettier": "bin/prettier.cjs" }, "engines": { - "node": ">=10.13.0" + "node": ">=14" }, "funding": { "url": "https://github.com/prettier/prettier?sponsor=1" @@ -3287,9 +3287,9 @@ } }, "node_modules/ts-loader": { - "version": "9.4.2", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", - "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", + "version": "9.4.4", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.4.tgz", + "integrity": "sha512-MLukxDHBl8OJ5Dk3y69IsKVFRA/6MwzEqBgh+OXMPB/OD01KQuWPFd1WAQP8a5PeSCAxfnkhiuWqfmFJzJQt9w==", "dev": true, "dependencies": { "chalk": "^4.1.0", @@ -3491,28 +3491,28 @@ } }, "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=12.20" + "node": ">=14.17" } }, "node_modules/typescript-json-schema": { - "version": "0.56.0", - "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.56.0.tgz", - "integrity": "sha512-k/aSEqx89YR2z/f2y3VwoOGzlKTWern0EIey2qqEpMRP7HL4CI8udPElzJs4eFVkPowCLJ1yVBSzuIWIUF+mMA==", + "version": "0.59.0", + "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.59.0.tgz", + "integrity": "sha512-eYB9RO8p4PntznWUukdDQHckNfxzjEFCJUgsWeCE43mcFioE0wXGTSECGk1uhty9XQMxkpuI4pKAqqnb62ln3Q==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@types/node": "^16.9.2", "glob": "^7.1.7", - "path-equal": "^1.1.2", + "path-equal": "^1.2.5", "safe-stable-stringify": "^2.2.0", "ts-node": "^10.9.1", "typescript": "~4.9.5", @@ -3913,9 +3913,9 @@ } }, "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true, "engines": { "node": ">=0.10.0" @@ -4522,9 +4522,9 @@ "dev": true }, "@types/node": { - "version": "18.16.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.16.3.tgz", - "integrity": "sha512-OPs5WnnT1xkCBiuQrZA4+YAV4HEJejmHneyraIaxsbev5yCEr6KMwINNFP9wQeFIw8FWcoTqF3vQsa5CDaI+8Q==", + "version": "20.4.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.4.2.tgz", + "integrity": "sha512-Dd0BYtWgnWJKwO1jkmTrzofjK2QXXcai0dmtzvIBhcA+RsG5h8R3xlyta0kGOZRNfL9GuRtb1knmPEhQrePCEw==", "dev": true }, "@types/vscode": { @@ -4534,9 +4534,9 @@ "dev": true }, "@types/ws": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", - "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", + "version": "8.5.5", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.5.tgz", + "integrity": "sha512-lwhs8hktwxSjf9UaZ9tG5M03PGogvFaH8gUgLNbN9HKIg0dvv6q+gkSuJ8HN4/VbyxkuLzCjlN7GquQ0gUJfIg==", "dev": true, "requires": { "@types/node": "*" @@ -5809,9 +5809,9 @@ "dev": true }, "home-assistant-js-websocket": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/home-assistant-js-websocket/-/home-assistant-js-websocket-8.0.1.tgz", - "integrity": "sha512-CVi1yu4+hj3m3+ZxgzEYiP+UYFmjf/iAsUKVyCmhVm9T8Pn7ZCeW16O3pniC4h1DOmTuXW+z4v373UwKxVOMAg==" + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/home-assistant-js-websocket/-/home-assistant-js-websocket-8.2.0.tgz", + "integrity": "sha512-B163iuvC1hsObkbSXm89JfjjOguyQXSQeQsGf6KQblUj9QwMgFkQt13TiCYjeFFTMzhQ8Qj3/gKx/6MnSeYUqA==" }, "http-proxy-agent": { "version": "2.1.0", @@ -6168,9 +6168,9 @@ } }, "path-equal": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.1.2.tgz", - "integrity": "sha512-p5kxPPwCdbf5AdXzT1bUBJomhgBlEjRBavYNr1XUpMFIE4Hnf2roueCMXudZK5tnaAu1tTmp3GPzqwJK45IHEA==", + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/path-equal/-/path-equal-1.2.5.tgz", + "integrity": "sha512-i73IctDr3F2W+bsOWDyyVm/lqsXO47aY9nsFZUjTT/aljSbkxHxxCoyZ9UUrM8jK0JVod+An+rl48RCsvWM+9g==", "dev": true }, "path-is-absolute": { @@ -6223,9 +6223,9 @@ "dev": true }, "prettier": { - "version": "2.8.8", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", - "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.0.tgz", + "integrity": "sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==", "dev": true }, "process-nextick-args": { @@ -6662,9 +6662,9 @@ "dev": true }, "ts-loader": { - "version": "9.4.2", - "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.2.tgz", - "integrity": "sha512-OmlC4WVmFv5I0PpaxYb+qGeGOdm5giHU7HwDDUjw59emP2UYMHy9fFSDcYgSNoH8sXcj4hGCSEhlDZ9ULeDraA==", + "version": "9.4.4", + "resolved": "https://registry.npmjs.org/ts-loader/-/ts-loader-9.4.4.tgz", + "integrity": "sha512-MLukxDHBl8OJ5Dk3y69IsKVFRA/6MwzEqBgh+OXMPB/OD01KQuWPFd1WAQP8a5PeSCAxfnkhiuWqfmFJzJQt9w==", "dev": true, "requires": { "chalk": "^4.1.0", @@ -6793,21 +6793,21 @@ "dev": true }, "typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true }, "typescript-json-schema": { - "version": "0.56.0", - "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.56.0.tgz", - "integrity": "sha512-k/aSEqx89YR2z/f2y3VwoOGzlKTWern0EIey2qqEpMRP7HL4CI8udPElzJs4eFVkPowCLJ1yVBSzuIWIUF+mMA==", + "version": "0.59.0", + "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.59.0.tgz", + "integrity": "sha512-eYB9RO8p4PntznWUukdDQHckNfxzjEFCJUgsWeCE43mcFioE0wXGTSECGk1uhty9XQMxkpuI4pKAqqnb62ln3Q==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@types/node": "^16.9.2", "glob": "^7.1.7", - "path-equal": "^1.1.2", + "path-equal": "^1.2.5", "safe-stable-stringify": "^2.2.0", "ts-node": "^10.9.1", "typescript": "~4.9.5", @@ -7131,9 +7131,9 @@ } }, "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz", + "integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==", "dev": true }, "wrap-ansi": { diff --git a/src/language-service/package.json b/src/language-service/package.json index 03fa1c5994..4432be9368 100644 --- a/src/language-service/package.json +++ b/src/language-service/package.json @@ -1,6 +1,6 @@ { "name": "home-assistant-language-service", - "version": "1.36.0", + "version": "1.37.0", "description": "Home Assistant Language Service", "source": "src/haLanguageService.ts", "main": "dist/haLanguageService.js", @@ -39,20 +39,20 @@ }, "devDependencies": { "@types/mocha": "10.0.1", - "@types/node": "18.16.3", + "@types/node": "20.4.2", "@types/vscode": "1.48.0", - "@types/ws": "8.5.4", + "@types/ws": "8.5.5", "@types/yaml": "1.9.7", "@typescript-eslint/eslint-plugin": "^4.16.1", "@typescript-eslint/parser": "^4.16.1", "eslint": "^7.4.0", "eslint-config-prettier": "^8.1.0", - "prettier": "^2.0.5", + "prettier": "^3.0.0", "rimraf": "5.0.1", "ts-loader": "^9.2.8", "ts-node": "10.9.1", - "typescript": "5.0.4", - "typescript-json-schema": "0.56.0", + "typescript": "5.1.6", + "typescript-json-schema": "0.59.0", "vscode-test": "^1.4.0" }, "dependencies": { diff --git a/src/language-service/src/completionHelpers/domains.ts b/src/language-service/src/completionHelpers/domains.ts index f20ea3da62..9e3581e978 100644 --- a/src/language-service/src/completionHelpers/domains.ts +++ b/src/language-service/src/completionHelpers/domains.ts @@ -19,7 +19,7 @@ export class DomainCompletionContribution implements JSONWorkerContribution { public collectDefaultCompletions( resource: string, - result: CompletionsCollector + result: CompletionsCollector, ): Thenable { return Promise.resolve(null); } @@ -30,7 +30,7 @@ export class DomainCompletionContribution implements JSONWorkerContribution { currentWord: string, addValue: boolean, isLast: boolean, - result: CompletionsCollector + result: CompletionsCollector, ): Promise => { if (location.length < 2) { return; @@ -40,7 +40,8 @@ export class DomainCompletionContribution implements JSONWorkerContribution { if ( !DomainCompletionContribution.propertyMatches.some( (x) => - x === currentNode || (!Number.isNaN(+currentNode) && x === parentNode) + x === currentNode || + (!Number.isNaN(+currentNode) && x === parentNode), ) ) { return; @@ -53,11 +54,11 @@ export class DomainCompletionContribution implements JSONWorkerContribution { resource: string, location: JSONPath, currentKey: string, - result: CompletionsCollector + result: CompletionsCollector, ): Promise => { if ( !DomainCompletionContribution.propertyMatches.some( - (x) => x === currentKey + (x) => x === currentKey, ) ) { return; @@ -69,7 +70,7 @@ export class DomainCompletionContribution implements JSONWorkerContribution { public getInfoContribution( resource: string, - location: JSONPath + location: JSONPath, ): Thenable { return Promise.resolve([]); } diff --git a/src/language-service/src/completionHelpers/entityIds.ts b/src/language-service/src/completionHelpers/entityIds.ts index fe82d2ab26..0ad7bcbe7e 100644 --- a/src/language-service/src/completionHelpers/entityIds.ts +++ b/src/language-service/src/completionHelpers/entityIds.ts @@ -29,7 +29,7 @@ export class EntityIdCompletionContribution implements JSONWorkerContribution { public collectDefaultCompletions( resource: string, - result: CompletionsCollector + result: CompletionsCollector, ): Thenable { return Promise.resolve(null); } @@ -40,7 +40,7 @@ export class EntityIdCompletionContribution implements JSONWorkerContribution { currentWord: string, addValue: boolean, isLast: boolean, - result: CompletionsCollector + result: CompletionsCollector, ): Promise => { if (location.length < 2) { return; @@ -50,7 +50,8 @@ export class EntityIdCompletionContribution implements JSONWorkerContribution { if ( !EntityIdCompletionContribution.propertyMatches.some( (x) => - x === currentNode || (!Number.isNaN(+currentNode) && x === parentNode) + x === currentNode || + (!Number.isNaN(+currentNode) && x === parentNode), ) ) { return; @@ -63,11 +64,11 @@ export class EntityIdCompletionContribution implements JSONWorkerContribution { resource: string, location: JSONPath, currentKey: string, - result: CompletionsCollector + result: CompletionsCollector, ): Promise => { if ( !EntityIdCompletionContribution.propertyMatches.some( - (x) => x === currentKey + (x) => x === currentKey, ) ) { return; @@ -79,7 +80,7 @@ export class EntityIdCompletionContribution implements JSONWorkerContribution { public getInfoContribution( resource: string, - location: JSONPath + location: JSONPath, ): Thenable { return Promise.resolve([]); } diff --git a/src/language-service/src/completionHelpers/services.ts b/src/language-service/src/completionHelpers/services.ts index 687002e0ab..2451d47740 100644 --- a/src/language-service/src/completionHelpers/services.ts +++ b/src/language-service/src/completionHelpers/services.ts @@ -14,7 +14,7 @@ export class ServicesCompletionContribution implements JSONWorkerContribution { public collectDefaultCompletions( resource: string, - result: CompletionsCollector + result: CompletionsCollector, ): Thenable { return Promise.reject(); } @@ -25,7 +25,7 @@ export class ServicesCompletionContribution implements JSONWorkerContribution { currentWord: string, addValue: boolean, isLast: boolean, - result: CompletionsCollector + result: CompletionsCollector, ): Promise => { if (location.length < 2) { return; @@ -34,7 +34,7 @@ export class ServicesCompletionContribution implements JSONWorkerContribution { const parentNode = location[location.length - 2]; // in case or arrays, currentNode is the indexer for the array position if ( !ServicesCompletionContribution.propertyMatches.some( - (x) => x === currentNode || x === parentNode + (x) => x === currentNode || x === parentNode, ) ) { return; @@ -47,11 +47,11 @@ export class ServicesCompletionContribution implements JSONWorkerContribution { resource: string, location: JSONPath, currentKey: string, - result: CompletionsCollector + result: CompletionsCollector, ): Promise => { if ( !ServicesCompletionContribution.propertyMatches.some( - (x) => x === currentKey + (x) => x === currentKey, ) ) { return; @@ -62,7 +62,7 @@ export class ServicesCompletionContribution implements JSONWorkerContribution { public getInfoContribution( resource: string, - location: JSONPath + location: JSONPath, ): Thenable { return Promise.resolve([]); } diff --git a/src/language-service/src/definition/includes.ts b/src/language-service/src/definition/includes.ts index 437079a6fa..746ddb50ce 100644 --- a/src/language-service/src/definition/includes.ts +++ b/src/language-service/src/definition/includes.ts @@ -8,7 +8,7 @@ export class IncludeDefinitionProvider implements DefinitionProvider { public onDefinition = async ( line: string, - uri: string + uri: string, // eslint-disable-next-line @typescript-eslint/require-await ): Promise => { const matches = /(.*)(!include\S*)\s+(["'])?(.+)\3/.exec(line); @@ -22,7 +22,7 @@ export class IncludeDefinitionProvider implements DefinitionProvider { // eslint-disable-next-line no-case-declarations const destination = this.fileAccessor.getRelativePathAsFileUri( uri, - whatToInclude + whatToInclude, ); return [ Location.create(destination, { @@ -37,19 +37,19 @@ export class IncludeDefinitionProvider implements DefinitionProvider { // eslint-disable-next-line no-case-declarations let files = this.fileAccessor.getFilesInFolderRelativeFromAsFileUri( whatToInclude, - uri + uri, ); files = files.filter((f) => path.extname(f) === ".yaml"); if (files.length === 0) { console.warn( - `There were no files found in folder '${whatToInclude}' referenced with '${includeType}' from '${uri}'` + `There were no files found in folder '${whatToInclude}' referenced with '${includeType}' from '${uri}'`, ); } return files.map((f) => Location.create(f, { start: { line: 0, character: 0 }, end: { line: 0, character: 0 }, - }) + }), ); default: return []; diff --git a/src/language-service/src/definition/scripts.ts b/src/language-service/src/definition/scripts.ts index 0de0bd8c6f..bf161e7e92 100644 --- a/src/language-service/src/definition/scripts.ts +++ b/src/language-service/src/definition/scripts.ts @@ -7,7 +7,7 @@ export class ScriptDefinitionProvider implements DefinitionProvider { public onDefinition = async ( line: string, - uri: string + uri: string, ): Promise => { const matches = /(.*)(script\.([\S]*))([\s]*)*(.*)/.exec(line); if (!matches || matches.length !== 6) { diff --git a/src/language-service/src/fileAccessor.ts b/src/language-service/src/fileAccessor.ts index 141f2e9928..badd4504f0 100644 --- a/src/language-service/src/fileAccessor.ts +++ b/src/language-service/src/fileAccessor.ts @@ -3,11 +3,11 @@ export interface FileAccessor { getFilesInFolder(subFolder: string): string[]; getFilesInFolderRelativeFrom( subFolder: string, - relativeFrom: string + relativeFrom: string, ): string[]; getFilesInFolderRelativeFromAsFileUri( subFolder: string, - relativeFrom: string + relativeFrom: string, ): string[]; getRelativePath(relativeFrom: string, filename: string): string; getRelativePathAsFileUri(relativeFrom: string, filename: string): string; diff --git a/src/language-service/src/haConfig/haConfig.ts b/src/language-service/src/haConfig/haConfig.ts index b47607b9cd..e7d36d22cc 100644 --- a/src/language-service/src/haConfig/haConfig.ts +++ b/src/language-service/src/haConfig/haConfig.ts @@ -37,7 +37,7 @@ export class HomeAssistantConfiguration { const homeAssistantYamlFile = new HomeAssistantYamlFile( this.fileAccessor, filename, - ourFile.path + ourFile.path, ); this.files[filename] = homeAssistantYamlFile; @@ -114,18 +114,18 @@ export class HomeAssistantConfiguration { const rootFiles = ourFiles.filter((f) => filesInRoot.some((y) => y === f)); const subfolderFiles = filesInRoot.filter((f) => - ourFolders.some((y) => f.startsWith(y)) + ourFolders.some((y) => f.startsWith(y)), ); const files = [...rootFiles, ...subfolderFiles]; if (files.length === 0) { const areOurFilesSomehwere = filesInRoot.filter((f) => - ourFiles.some((ourFile) => f.endsWith(ourFile)) + ourFiles.some((ourFile) => f.endsWith(ourFile)), ); if (areOurFilesSomehwere.length > 0) { this.subFolder = areOurFilesSomehwere[0].substr( 0, - areOurFilesSomehwere[0].lastIndexOf("/") + areOurFilesSomehwere[0].lastIndexOf("/"), ); return areOurFilesSomehwere; } @@ -143,8 +143,8 @@ export class HomeAssistantConfiguration { this.discoverCore( rootFile, rootFile.substring(this.subFolder.length), - this.files - ) + this.files, + ), ); } results = await Promise.all(results); @@ -158,7 +158,7 @@ export class HomeAssistantConfiguration { filename: string, // eslint-disable-next-line no-shadow, @typescript-eslint/no-shadow path: string, - files: FilesCollection + files: FilesCollection, ): Promise => { if (path.startsWith("/")) { path = path.substring(1); @@ -167,7 +167,7 @@ export class HomeAssistantConfiguration { const homeAssistantYamlFile = new HomeAssistantYamlFile( this.fileAccessor, filename, - path + path, ); files[filename] = homeAssistantYamlFile; diff --git a/src/language-service/src/haConfig/haYamlFile.ts b/src/language-service/src/haConfig/haYamlFile.ts index 0126bfeae4..3ce6637ea0 100644 --- a/src/language-service/src/haConfig/haYamlFile.ts +++ b/src/language-service/src/haConfig/haYamlFile.ts @@ -20,7 +20,7 @@ export class HomeAssistantYamlFile { private fileAccessor: FileAccessor, private filename: string, // eslint-disable-next-line no-shadow, @typescript-eslint/no-shadow - public path: string + public path: string, ) {} private async parse(): Promise { @@ -108,13 +108,13 @@ export class HomeAssistantYamlFile { { tag: `!${x}`, resolve: (_doc: any, cst: any) => Symbol.for(cst.strValue), - } + }, ); } private parseAstRecursive = async ( node: Collection | Node | null, - currentPath: string + currentPath: string, ): Promise => { if (!node) { // null object like 'frontend:' @@ -148,8 +148,8 @@ export class HomeAssistantYamlFile { results.push( this.parseAstRecursive( item.value, - `${currentPath}/${this.getKeyName(item.key)}` - ) + `${currentPath}/${this.getKeyName(item.key)}`, + ), ); break; case Type.BLOCK_FOLDED: @@ -231,7 +231,7 @@ export class HomeAssistantYamlFile { if (includeType === Includetype.include) { const relativeFilePath = this.fileAccessor.getRelativePath( this.filename, - String(value) + String(value), ); // single file include files.push(relativeFilePath); @@ -239,14 +239,14 @@ export class HomeAssistantYamlFile { // multiple file include const filesInThisFolder = this.fileAccessor.getFilesInFolderRelativeFrom( String(value), - this.filename + this.filename, ); files = filesInThisFolder.filter((f) => path.extname(f) === ".yaml"); } if (files.length === 0) { console.log( - `The include could not be resolved because no file(s) found in '${value}' included with '${Includetype[includeType]}' from '${this.filename}'` + `The include could not be resolved because no file(s) found in '${value}' included with '${Includetype[includeType]}' from '${this.filename}'`, ); } @@ -344,7 +344,7 @@ export class HomeAssistantYamlFile { */ private getLinePos( offset: number, - cst: string | ParsedCST | undefined + cst: string | ParsedCST | undefined, ): LinePos | null { if (typeof offset !== "number" || offset < 0) { return null; diff --git a/src/language-service/src/haLanguageService.ts b/src/language-service/src/haLanguageService.ts index a592bcaf79..c8bc0243c4 100644 --- a/src/language-service/src/haLanguageService.ts +++ b/src/language-service/src/haLanguageService.ts @@ -36,9 +36,9 @@ export class HomeAssistantLanguageService { private schemaServiceForIncludes: SchemaServiceForIncludes, private sendDiagnostics: ( fileUri: string, - diagnostics: Diagnostic[] + diagnostics: Diagnostic[], ) => void, - private diagnoseAllFiles: () => void + private diagnoseAllFiles: () => void, ) {} public findAndApplySchemas = (): void => { @@ -46,7 +46,7 @@ export class HomeAssistantLanguageService { const haFiles = this.haConfig.getAllFiles(); if (haFiles && haFiles.length > 0) { console.log( - `Applying schemas to ${haFiles.length} of your configuration files...` + `Applying schemas to ${haFiles.length} of your configuration files...`, ); } @@ -65,7 +65,7 @@ export class HomeAssistantLanguageService { const message: string = error.message; console.error( `Unexpected error updating the schemas, message: ${message}`, - error + error, ); } console.log(`Schemas updated!`); @@ -88,7 +88,7 @@ export class HomeAssistantLanguageService { private onDocumentChangeDebounce: NodeJS.Timer | undefined; public onDocumentChange = ( - textDocumentChangeEvent: TextDocumentChangeEvent + textDocumentChangeEvent: TextDocumentChangeEvent, ): void => { if (this.onDocumentChangeDebounce !== undefined) { clearTimeout(this.onDocumentChangeDebounce); @@ -96,18 +96,18 @@ export class HomeAssistantLanguageService { this.onDocumentChangeDebounce = setTimeout(async (): Promise => { const singleFileUpdate = await this.haConfig.updateFile( - textDocumentChangeEvent.document.uri + textDocumentChangeEvent.document.uri, ); if (singleFileUpdate.isValidYaml && singleFileUpdate.newFilesFound) { console.log( - `Discover all configuration files because ${textDocumentChangeEvent.document.uri} got updated and new files were found...` + `Discover all configuration files because ${textDocumentChangeEvent.document.uri} got updated and new files were found...`, ); await this.haConfig.discoverFiles(); this.findAndApplySchemas(); } const diagnostics = await this.getDiagnostics( - textDocumentChangeEvent.document + textDocumentChangeEvent.document, ); this.sendDiagnostics(textDocumentChangeEvent.document.uri, diagnostics); @@ -115,17 +115,17 @@ export class HomeAssistantLanguageService { }; public onDocumentOpen = async ( - textDocumentChangeEvent: TextDocumentChangeEvent + textDocumentChangeEvent: TextDocumentChangeEvent, ): Promise => { const diagnostics = await this.getDiagnostics( - textDocumentChangeEvent.document + textDocumentChangeEvent.document, ); this.sendDiagnostics(textDocumentChangeEvent.document.uri, diagnostics); }; public getDiagnostics = async ( - document: TextDocument + document: TextDocument, ): Promise => { if (!document || document.getText().length === 0) { return []; @@ -133,7 +133,7 @@ export class HomeAssistantLanguageService { const diagnosticResults = await this.yamlLanguageService.doValidation( document, - false + false, ); if (!diagnosticResults) { @@ -147,8 +147,8 @@ export class HomeAssistantLanguageService { diagnosticItem.range.start.line, diagnosticItem.range.start.character - 8, diagnosticItem.range.end.line, - diagnosticItem.range.start.character - 1 - ) + diagnosticItem.range.start.character - 1, + ), ); // Skip errors about secrets, we simply have no idea what is in them @@ -160,8 +160,8 @@ export class HomeAssistantLanguageService { diagnosticItem.range.start.line, diagnosticItem.range.start.character - 7, diagnosticItem.range.end.line, - diagnosticItem.range.start.character - 1 - ) + diagnosticItem.range.start.character - 1, + ), ); // Skip errors about input, that is up to the Blueprint creator @@ -173,8 +173,8 @@ export class HomeAssistantLanguageService { diagnosticItem.range.start.line, diagnosticItem.range.start.character - 9, diagnosticItem.range.end.line, - diagnosticItem.range.start.character - 1 - ) + diagnosticItem.range.start.character - 1, + ), ); // Skip errors about include, everything can be included @@ -196,7 +196,7 @@ export class HomeAssistantLanguageService { public onDocumentFormatting = ( document: TextDocument, - options: FormattingOptions + options: FormattingOptions, ): TextEdit[] => { if (!document) { return []; @@ -217,7 +217,7 @@ export class HomeAssistantLanguageService { public onCompletion = async ( textDocument: TextDocument, - position: Position + position: Position, ): Promise => { const result: CompletionList = { items: [], @@ -234,7 +234,7 @@ export class HomeAssistantLanguageService { const additionalCompletions = await this.getServiceAndEntityCompletions( textDocument, position, - currentCompletions + currentCompletions, ); if (additionalCompletions.length === 0) { @@ -245,13 +245,13 @@ export class HomeAssistantLanguageService { }; public onCompletionResolve = async ( - completionItem: CompletionItem + completionItem: CompletionItem, ): Promise => this.yamlLanguageService.doResolve(completionItem); public onHover = async ( document: TextDocument, - position: Position + position: Position, ): Promise => { if (!document) { return null; @@ -262,7 +262,7 @@ export class HomeAssistantLanguageService { public onDefinition = async ( textDocument: TextDocument, - position: Position + position: Position, ): Promise => { if (!textDocument) { return undefined; @@ -292,7 +292,7 @@ export class HomeAssistantLanguageService { private getServiceAndEntityCompletions = async ( document: TextDocument, textDocumentPosition: Position, - currentCompletions: CompletionList + currentCompletions: CompletionList, ): Promise => { // sadly this is needed here. // the normal completion engine cannot provide completions for type `string | string[]` @@ -308,7 +308,7 @@ export class HomeAssistantLanguageService { const additionalCompletionProvider = this.findAutoCompletionProperty( document, textDocumentPosition, - properties + properties, ); let additionalCompletion: CompletionItem[] = []; switch (additionalCompletionProvider) { @@ -340,7 +340,7 @@ export class HomeAssistantLanguageService { private findAutoCompletionProperty = ( document: TextDocument, textDocumentPosition: Position, - properties: { [provider: string]: string[] } + properties: { [provider: string]: string[] }, ): string | null => { let currentLine = textDocumentPosition.line; while (currentLine >= 0) { @@ -356,7 +356,7 @@ export class HomeAssistantLanguageService { // eslint-disable-next-line @typescript-eslint/prefer-regexp-exec const isOtherItemInList = thisLine.match( - /-\s*([-"\w]+)?(\.)?([-"\w]+?)?\s*$/ + /-\s*([-"\w]+)?(\.)?([-"\w]+?)?\s*$/, ); if (isOtherItemInList) { currentLine -= 1; @@ -367,8 +367,8 @@ export class HomeAssistantLanguageService { properties[key].some((propertyName) => // eslint-disable-next-line no-useless-escape new RegExp(`(.*)${propertyName}(:)([\s]*)([\w]*)(\s*)`).test( - thisLine - ) + thisLine, + ), ) ) { return key; diff --git a/src/language-service/src/home-assistant/haConnection.ts b/src/language-service/src/home-assistant/haConnection.ts index fc3e009b3c..1ff3f51177 100644 --- a/src/language-service/src/home-assistant/haConnection.ts +++ b/src/language-service/src/home-assistant/haConnection.ts @@ -87,7 +87,7 @@ export class HaConnection implements IHaConnection { this.connection = undefined; const tokenIndication = `${this.configurationService.token}`.substring( 0, - 5 + 5, ); let errorText = error; switch (error) { @@ -131,11 +131,11 @@ export class HaConnection implements IHaConnection { } ha.subscribeEntities(this.connection, (entities) => { console.log( - `Got ${Object.keys(entities).length} entities from Home Assistant` + `Got ${Object.keys(entities).length} entities from Home Assistant`, ); return resolve(entities); }); - } + }, ); return this.hassEntities; }; @@ -213,11 +213,13 @@ export class HaConnection implements IHaConnection { } ha.subscribeServices(this.connection, (services) => { console.log( - `Got ${Object.keys(services).length} services from Home Assistant` + `Got ${ + Object.keys(services).length + } services from Home Assistant`, ); return resolve(services); }); - } + }, ); } return this.hassServices; @@ -235,7 +237,7 @@ export class HaConnection implements IHaConnection { for (const [domainKey, domainValue] of Object.entries(services)) { for (const [serviceKey, serviceValue] of Object.entries(domainValue)) { const completionItem = CompletionItem.create( - `${domainKey}.${serviceKey}` + `${domainKey}.${serviceKey}`, ); completionItem.kind = CompletionItemKind.EnumMember; completionItem.filterText = `${domainKey}.${serviceKey}`; @@ -278,7 +280,7 @@ export class HaConnection implements IHaConnection { method: Method, api: string, // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types - requestBody?: any + requestBody?: any, ): Promise => { try { const resp = await axios.request({ @@ -301,7 +303,7 @@ export class HaConnection implements IHaConnection { domain: string, service: string, // eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types - serviceData: any + serviceData: any, ): Promise => { try { const resp = await axios.request({ @@ -314,7 +316,7 @@ export class HaConnection implements IHaConnection { }); // eslint-disable-next-line @typescript-eslint/no-unsafe-return console.log( - `Service Call ${domain}.${service} made succesfully, response:` + `Service Call ${domain}.${service} made succesfully, response:`, ); console.log(JSON.stringify(resp.data, null, 1)); } catch (error) { diff --git a/src/language-service/src/home-assistant/socket.ts b/src/language-service/src/home-assistant/socket.ts index 5e0343f417..060e7cafa9 100644 --- a/src/language-service/src/home-assistant/socket.ts +++ b/src/language-service/src/home-assistant/socket.ts @@ -21,24 +21,24 @@ interface HaWebSocket extends WebSocket { export function createSocket( auth: Auth, - ignoreCertificates: boolean + ignoreCertificates: boolean, ): Promise { // Convert from http:// -> ws://, https:// -> wss:// const url = auth.wsUrl; console.log( "[Auth phase] Initializing WebSocket connection to Home Assistant", - url + url, ); function connect( triesLeft: number, promResolve: (socket: any) => void, - promReject: (err: number) => void + promReject: (err: number) => void, ) { console.log( `[Auth Phase] Connecting to Home Assistant... Tries left: ${triesLeft}`, - url + url, ); const socket = new WebSocket(url, { @@ -80,7 +80,7 @@ export function createSocket( const closeOrError = (errorText?: string) => { if (errorText) { console.log( - `WebSocket Connection to Home Assistant closed with an error: ${errorText}` + `WebSocket Connection to Home Assistant closed with an error: ${errorText}`, ); } if (invalidAuth) { @@ -110,7 +110,7 @@ export function createSocket( JSON.stringify({ type: "auth", access_token: auth.accessToken, - }) + }), ); } catch (err) { // Refresh token failed @@ -128,7 +128,7 @@ export function createSocket( console.log( `[Auth phase] Received a message of type ${message.type}`, - message + message, ); switch (message.type) { diff --git a/src/language-service/src/schemas/generateSchemas.ts b/src/language-service/src/schemas/generateSchemas.ts index b2314f9142..feca689972 100644 --- a/src/language-service/src/schemas/generateSchemas.ts +++ b/src/language-service/src/schemas/generateSchemas.ts @@ -25,7 +25,7 @@ if (!fs.existsSync(outputFolder)) { if (fs.readdirSync(outputFolder).length > 0 && process.argv[2] === "--quick") { console.debug( - "Skipping schema generation because there already schema files" + "Skipping schema generation because there already schema files", ); } else { console.log("Generating schemas..."); @@ -34,7 +34,7 @@ if (fs.readdirSync(outputFolder).length > 0 && process.argv[2] === "--quick") { console.log(mapping.path); const program = TJS.getProgramFromFiles( [resolve(path.join(__dirname, mapping.tsFile))], - compilerOptions + compilerOptions, ); const schema = TJS.generateSchema(program, mapping.fromType, settings); if (schema === null) { @@ -43,7 +43,7 @@ if (fs.readdirSync(outputFolder).length > 0 && process.argv[2] === "--quick") { } fs.writeFileSync( path.join(outputFolder, mapping.file), - JSON.stringify(schema) + JSON.stringify(schema), ); }); } diff --git a/src/language-service/src/schemas/integrations/core/tod.ts b/src/language-service/src/schemas/integrations/core/tod.ts index 01f30598bb..ace8481bb1 100644 --- a/src/language-service/src/schemas/integrations/core/tod.ts +++ b/src/language-service/src/schemas/integrations/core/tod.ts @@ -43,4 +43,10 @@ export interface BinarySensorPlatformSchema extends PlatformSchema { * https://www.home-assistant.io/integrations/tod/#after_offset */ after_offset?: TimePeriod; + + /** + * The unique ID for this config block. This will be prefixed to all unique IDs of all entities in this block. + * https://www.home-assistant.io/integrations/tod/#unique_id + */ + unique_id?: string; } diff --git a/src/language-service/src/schemas/integrations/selectors.ts b/src/language-service/src/schemas/integrations/selectors.ts index 7c9a0a94f3..3c4bd69230 100644 --- a/src/language-service/src/schemas/integrations/selectors.ts +++ b/src/language-service/src/schemas/integrations/selectors.ts @@ -2,7 +2,13 @@ * Selectors * Source: https://github.com/home-assistant/core/blob/dev/homeassistant/helpers/selector.py */ -import { Domain, DeviceClasses, Entity, PositiveInteger } from "../types"; +import { + Domain, + DeviceClasses, + Entity, + PositiveInteger, + Deprecated, +} from "../types"; export type Selector = | ActionSelector @@ -12,6 +18,7 @@ export type Selector = | BooleanSelector | ColorRGBSelector | ColorTempSelector + | ConditionSelector | DateSelector | DateTimeSelector | DeviceSelector @@ -55,49 +62,13 @@ export interface AreaSelector { * When device options are provided, the list of areas is filtered by areas that at least provide one device that matches the given conditions. * https://www.home-assistant.io/docs/blueprint/selectors/#area-selector */ - device?: { - /** - * Can be set to an integration domain. Limits the list of areas that provide devices by the set integration domain. - * https://www.home-assistant.io/docs/blueprint/selectors/#area-selector - */ - integration?: Domain; - - /** - * When set, it limits the list of areas that provide devices by the set manufacturer name. - * https://www.home-assistant.io/docs/blueprint/selectors/#area-selector - */ - manufacturer?: string; - - /** - * When set, it limits the list of areas that provide devices that have the set model. - * https://www.home-assistant.io/docs/blueprint/selectors/#area-selector - */ - model?: string; - }; + device?: DeviceSelectorFilter | DeviceSelectorFilter[]; /** * When entity options are provided, the list of areas is filtered by areas that at least provide one entity that matches the given conditions. * https://www.home-assistant.io/docs/blueprint/selectors/#area-selector */ - entity?: { - /** - * Limits the list of areas that provide entities of a certain domain, for example, light or binary_sensor. - * https://www.home-assistant.io/docs/blueprint/selectors/#area-selector - */ - domain?: Domain | Domain[]; - - /** - * Limits the list of areas to areas that have entities with a certain device class, for example, motion or window. - * https://www.home-assistant.io/docs/blueprint/selectors/#area-selector - */ - device_class?: DeviceClasses; - - /** - * Can be set to an integration domain. Limits the list of areas that provide entities by the set integration domain. - * https://www.home-assistant.io/docs/blueprint/selectors/#area-selector - */ - integration?: Domain; - }; + entity?: EntitySelectorFilter | EntitySelectorFilter[]; /** * Allows selecting multiple areas. If set to `true`, the resulting value of this selector will be a list instead of a single string value. @@ -157,6 +128,14 @@ export interface ColorTempSelector { } | null; } +export interface ConditionSelector { + /** + * The condition selector allows the user to input one or more conditions.. + * https://www.home-assistant.io/docs/blueprint/selectors/#condition-selector + */ + condition: null | Record; +} + export interface DateSelector { /** * The date selector shows a date input that allows the user to specify a date. @@ -173,6 +152,26 @@ export interface DateTimeSelector { datetime: null | Record; } +interface DeviceSelectorFilter { + /** + * Can be set to an integration domain. Limits the list of devices to devices provided by the set integration domain. + * https://www.home-assistant.io/docs/blueprint/selectors/#device-selector + */ + integration?: Domain; + + /** + * When set, it limits the list of devices to devices provided by the set manufacturer name. + * https://www.home-assistant.io/docs/blueprint/selectors/#device-selector + */ + manufacturer?: string; + + /** + * When set, it limits the list of devices to devices that have the set model. + * https://www.home-assistant.io/docs/blueprint/selectors/#device-selector + */ + model?: string; +} + export interface DeviceSelector { /** * The device selector shows a device finder that can pick a single device. @@ -183,41 +182,31 @@ export interface DeviceSelector { * When entity options are provided, the list of devices is filtered by devices that at least provide one entity that matches the given conditions. * https://www.home-assistant.io/docs/blueprint/selectors/#device-selector */ - entity?: { - /** - * Can be set to an integration domain. Limits the list of devices that provide entities by the set integration domain. - * https://www.home-assistant.io/docs/blueprint/selectors/#device-selector - */ - integration?: Domain; - /** - * Limits the list of devices that provide entities of a certain domain. - * https://www.home-assistant.io/docs/blueprint/selectors/#device-selector - */ - domain?: Domain | Domain[]; - /** - * Limits the list of entities to entities that have a certain device class. - * https://www.home-assistant.io/docs/blueprint/selectors/#device-selector - */ - device_class?: DeviceClasses; - }; - - /** - * Can be set to an integration domain. Limits the list of devices to devices provided by the set integration domain. + entity?: EntitySelectorFilter | EntitySelectorFilter[]; + + /** + * When filter options are provided, the list of devices is filtered by devices that at least provide one entity that matches the given conditions. * https://www.home-assistant.io/docs/blueprint/selectors/#device-selector */ - integration?: Domain; + filter?: DeviceSelectorFilter | DeviceSelectorFilter[]; /** - * When set, it limits the list of devices to devices provided by the set manufacturer name. - * https://www.home-assistant.io/docs/blueprint/selectors/#device-selector + * DEPRECATED. + * You can use filter parameter to filter devices". */ - manufacturer?: string; + integration?: Deprecated; /** - * When set, it limits the list of devices to devices that have the set model. - * https://www.home-assistant.io/docs/blueprint/selectors/#device-selector + * DEPRECATED. + * You can use filter parameter to filter devices". + */ + manufacturer?: Deprecated; + + /** + * DEPRECATED. + * You can use filter parameter to filter devices". */ - model?: string; + model?: Deprecated; /** * Allows selecting multiple devices. If set to `true`, the resulting value of this selector will be a list instead of a single string value. @@ -241,6 +230,29 @@ export interface DurationSelector { } | null; } +interface EntitySelectorFilter { + /** + * Can be set to an integration domain. Limits the list of devices that provide entities by the set integration domain. + * https://www.home-assistant.io/docs/blueprint/selectors/#entity-selector + */ + integration?: Domain; + /** + * Limits the list of devices that provide entities of a certain domain. + * https://www.home-assistant.io/docs/blueprint/selectors/#entity-selector + */ + domain?: Domain | Domain[]; + /** + * Limits the list of entities to entities that have a certain device class. + * https://www.home-assistant.io/docs/blueprint/selectors/#entity-selector + */ + device_class?: DeviceClasses | DeviceClasses[]; + /** + * Limits the list of entities to entities that have a certain supported feature. + * https://www.home-assistant.io/docs/blueprint/selectors/#entity-selector + */ + supported_features?: number | number[]; +} + export interface EntitySelector { /** * The entity selector shows an entity finder that can pick a single entity. @@ -260,23 +272,28 @@ export interface EntitySelector { include_entities?: Entity[]; /** - * Can be set to an integration domain. Limits the list of devices that provide entities by the set integration domain. - * https://www.home-assistant.io/docs/blueprint/selectors/#entity-selector + * DEPRECATED. + * You can use filter parameter to filter entities". */ - integration?: Domain; + integration?: Deprecated; /** - * Limits the list of devices that provide entities of a certain domain. - * https://www.home-assistant.io/docs/blueprint/selectors/#entity-selector + * DEPRECATED. + * You can use filter parameter to filter entities". */ - domain?: Domain | Domain[]; + domain?: Deprecated; /** - * Limits the list of entities to entities that have a certain device class. - * https://www.home-assistant.io/docs/blueprint/selectors/#entity-selector + * DEPRECATED. + * You can use filter parameter to filter entities". */ - device_class?: DeviceClasses; + device_class?: Deprecated; + /** + * When filter options are provided, the entities are limited by entities that at least match the given conditions. + * https://www.home-assistant.io/docs/blueprint/selectors/#entity-selector + */ + filter?: EntitySelectorFilter | EntitySelectorFilter[]; /** * Allows selecting multiple devices. If set to `true`, the resulting value of this selector will be a list instead of a single string value. * https://www.home-assistant.io/docs/blueprint/selectors/#entity-selector @@ -429,49 +446,13 @@ export interface TargetSelector { * When device options are provided, the targets are limited by devices that at least match the given conditions. * https://www.home-assistant.io/docs/blueprint/selectors/#target-selector */ - device?: { - /** - * Can be set to an integration domain. Limits the device targets that are provided devices by the set integration domain. - * https://www.home-assistant.io/docs/blueprint/selectors/#target-selector - */ - integration?: Domain; - - /** - * When set, it limits the targets to devices provided by the set manufacturer name. - * https://www.home-assistant.io/docs/blueprint/selectors/#target-selector - */ - manufacturer?: string; - - /** - * When set, it limits the targets to devices by the set model. - * https://www.home-assistant.io/docs/blueprint/selectors/#target-selector - */ - model?: string; - }; + device?: DeviceSelectorFilter | DeviceSelectorFilter[]; /** * When entity options are provided, the targets are limited by entities that at least match the given conditions. * https://www.home-assistant.io/docs/blueprint/selectors/#target-selector */ - entity?: { - /** - * Limits the targets to entities of a certain domain, for example, light or binary_sensor. - * https://www.home-assistant.io/docs/blueprint/selectors/#target-selector - */ - domain?: Domain | Domain[]; - - /** - * Limits the targets to entities with a certain device class, for example, motion or window. - * https://www.home-assistant.io/docs/blueprint/selectors/#target-selector - */ - device_class?: DeviceClasses; - - /** - * Can be set to an integration domain. Limits targets to entities provided by the set integration domain. - * https://www.home-assistant.io/docs/blueprint/selectors/#target-selector - */ - integration?: Domain; - }; + entity?: EntitySelectorFilter | EntitySelectorFilter[]; } | null; } @@ -496,7 +477,13 @@ export interface TextSelector { multiline?: boolean; /** - * Set to true to display the input as a multi-line text box on the user interface. + * Allows adding a prefix to the input field. + * https://www.home-assistant.io/docs/blueprint/selectors/#text-selector + */ + prefix?: string; + + /** + * Allows adding a suffix to the input field. * https://www.home-assistant.io/docs/blueprint/selectors/#text-selector */ suffix?: string; diff --git a/src/language-service/src/schemas/integrations/triggers.ts b/src/language-service/src/schemas/integrations/triggers.ts index fdac4018f1..b86c1542ed 100644 --- a/src/language-service/src/schemas/integrations/triggers.ts +++ b/src/language-service/src/schemas/integrations/triggers.ts @@ -28,6 +28,7 @@ export type Trigger = | HomeAssistantTrigger | MqttTrigger | NumericStateTrigger + | PersistentNotificationTrigger | StateTrigger | SunTrigger | TagTrigger @@ -59,6 +60,9 @@ type EventType = | "user_removed" | "zha_event"; +type AllowedMethods = "POST" | "PUT" | "GET" | "HEAD"; +type PersistentNotificationUpdateType = "added" | "removed"; + interface CalendarTrigger { /** * Alias for the calendar trigger. @@ -444,6 +448,37 @@ interface NumericStateTrigger { variables?: Data; } +interface PersistentNotificationTrigger { + /** + * Alias for the persistent notification trigger. + */ + alias?: string; + + /** + * Persistent notification triggers are fired when a persistent_notification is added or removed that matches the configuration options. + * https://www.home-assistant.io/docs/automation/trigger/#persistent-notification-trigger + */ + platform: "persistent_notification"; + + /** + * Every individual trigger in an automation can be disabled, without removing it. + * https://www.home-assistant.io/docs/automation/trigger/#disabling-a-trigger + */ + enabled?: boolean; + + /** + * Define the type of persistent notification to trigger on. + * https://www.home-assistant.io/docs/automation/trigger/#persistent-notification-trigger + */ + update_type?: PersistentNotificationUpdateType[]; + + /** + * The notification ID to trigger on. + * https://www.home-assistant.io/docs/automation/trigger/#persistent-notification-trigger + */ + notification_id?: string; +} + interface StateTrigger { /** * Alias for the state trigger. @@ -748,6 +783,18 @@ interface WebhookTrigger { * https://www.home-assistant.io/docs/automation/trigger#trigger-variables */ variables?: Data; + + /** + * Controls to only allow local requests to trigger the webhook. + * https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger + */ + local_only?: boolean; + + /** + * Controls to only allow requests with a valid API password to trigger the webhook. + * https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger + */ + allowed_methods: AllowedMethods[]; } interface ZoneTrigger { diff --git a/src/language-service/src/schemas/schemaService.ts b/src/language-service/src/schemas/schemaService.ts index 3243a72419..5dbf2978a0 100644 --- a/src/language-service/src/schemas/schemaService.ts +++ b/src/language-service/src/schemas/schemaService.ts @@ -28,11 +28,11 @@ export class SchemaServiceForIncludes { for (const [sourceFile, sourceFileMapping] of haFiles.entries()) { let sourceFileMappingPath = sourceFileMapping.path.replace( "homeassistant/packages/", - "" + "", ); sourceFileMappingPath = sourceFileMappingPath.replace( /cards\/cards/g, - "cards" + "cards", ); if (sourceFileMappingPath.startsWith("blueprints/automation/")) { @@ -55,20 +55,20 @@ export class SchemaServiceForIncludes { } const relatedPathToSchemaMapping = this.mappings.find( - (x) => x.path === sourceFileMappingPath + (x) => x.path === sourceFileMappingPath, ); if (relatedPathToSchemaMapping) { const id = `http://schemas.home-assistant.io/${relatedPathToSchemaMapping.key}`; let absolutePath = path.resolve( process.cwd(), - haFiles[sourceFile].filename + haFiles[sourceFile].filename, ); absolutePath = absolutePath.replace("\\", "/"); const fileass = encodeURI(absolutePath); let resultEntry = results.find((x) => x.uri === id); console.log( - `Assigning ${fileass} the ${relatedPathToSchemaMapping.path} schema` + `Assigning ${fileass} the ${relatedPathToSchemaMapping.path} schema`, ); if (!resultEntry) { diff --git a/src/server/fileAccessor.ts b/src/server/fileAccessor.ts index f788440461..9e1d0f58e7 100644 --- a/src/server/fileAccessor.ts +++ b/src/server/fileAccessor.ts @@ -9,11 +9,11 @@ export interface FileAccessor { getFilesInFolder(subFolder: string): string[]; getFilesInFolderRelativeFrom( subFolder: string, - relativeFrom: string + relativeFrom: string, ): string[]; getFilesInFolderRelativeFromAsFileUri( subFolder: string, - relativeFrom: string + relativeFrom: string, ): string[]; getRelativePath(relativeFrom: string, filename: string): string; getRelativePathAsFileUri(relativeFrom: string, filename: string): string; @@ -25,7 +25,7 @@ export class VsCodeFileAccessor implements FileAccessor { constructor( private workspaceFolder: string, - private documents: TextDocuments + private documents: TextDocuments, ) { this.ourRoot = path.resolve(); } @@ -55,7 +55,7 @@ export class VsCodeFileAccessor implements FileAccessor { public getFilesInFolder( subFolder: string, - filelist: string[] = [] + filelist: string[] = [], ): string[] { subFolder = path.normalize(subFolder); @@ -91,7 +91,7 @@ export class VsCodeFileAccessor implements FileAccessor { public getFilesInFolderRelativeFrom( subFolder: string, - relativeFrom: string + relativeFrom: string, ): string[] { relativeFrom = this.dealtWithRelativeFrom(relativeFrom); @@ -102,7 +102,7 @@ export class VsCodeFileAccessor implements FileAccessor { public getFilesInFolderRelativeFromAsFileUri( subFolder: string, - relativeFrom: string + relativeFrom: string, ): string[] { const files = this.getFilesInFolderRelativeFrom(subFolder, relativeFrom); return files.map((f) => vscodeUri.URI.file(f).toString()); @@ -119,7 +119,7 @@ export class VsCodeFileAccessor implements FileAccessor { public getRelativePathAsFileUri = ( relativeFrom: string, - filename: string + filename: string, ): string => vscodeUri.URI.file(this.getRelativePath(relativeFrom, filename)).toString(); diff --git a/src/server/server.ts b/src/server/server.ts index 4cd7a13577..d7a866c25c 100644 --- a/src/server/server.ts +++ b/src/server/server.ts @@ -30,7 +30,7 @@ documents.listen(connection); connection.onInitialize((params) => { connection.console.log( - `[Home Assistant Language Server(${process.pid})] Started and initialize received` + `[Home Assistant Language Server(${process.pid})] Started and initialize received`, ); const configurationService = new ConfigurationService(); @@ -54,7 +54,7 @@ connection.onInitialize((params) => { // eslint-disable-next-line @typescript-eslint/require-await async () => "", null, - jsonWorkerContributions + jsonWorkerContributions, ); const sendDiagnostics = (uri: string, diagnostics: Diagnostic[]) => { @@ -70,7 +70,7 @@ connection.onInitialize((params) => { homeAsisstantLanguageService.findAndApplySchemas(); } catch (e) { console.error( - `Unexpected error during file discovery / schema configuration: ${e}` + `Unexpected error during file discovery / schema configuration: ${e}`, ); } }; @@ -85,15 +85,15 @@ connection.onInitialize((params) => { () => { documents.all().forEach(async (d) => { const diagnostics = await homeAsisstantLanguageService.getDiagnostics( - d + d, ); sendDiagnostics(d.uri, diagnostics); }); - } + }, ); documents.onDidChangeContent((e) => - homeAsisstantLanguageService.onDocumentChange(e) + homeAsisstantLanguageService.onDocumentChange(e), ); documents.onDidOpen((e) => homeAsisstantLanguageService.onDocumentOpen(e)); @@ -105,35 +105,35 @@ connection.onInitialize((params) => { connection.onDocumentSymbol((p) => homeAsisstantLanguageService.onDocumentSymbol( - documents.get(p.textDocument.uri) - ) + documents.get(p.textDocument.uri), + ), ); connection.onDocumentFormatting((p) => homeAsisstantLanguageService.onDocumentFormatting( documents.get(p.textDocument.uri), - p.options - ) + p.options, + ), ); connection.onCompletion((p) => homeAsisstantLanguageService.onCompletion( documents.get(p.textDocument.uri), - p.position - ) + p.position, + ), ); connection.onCompletionResolve((p) => - homeAsisstantLanguageService.onCompletionResolve(p) + homeAsisstantLanguageService.onCompletionResolve(p), ); connection.onHover((p) => homeAsisstantLanguageService.onHover( documents.get(p.textDocument.uri), - p.position - ) + p.position, + ), ); connection.onDefinition((p) => homeAsisstantLanguageService.onDefinition( documents.get(p.textDocument.uri), - p.position - ) + p.position, + ), ); connection.onDidChangeConfiguration(async (config) => { @@ -151,15 +151,15 @@ connection.onInitialize((params) => { void haConnection.callService( args.domain, args.service, - args.serviceData + args.serviceData, ); - } + }, ); connection.onRequest("checkConfig", async (_) => { const result = await haConnection.callApi( "post", - "config/core/check_config" + "config/core/check_config", ); connection.sendNotification("configuration_check_completed", result); });