diff --git a/package-lock.json b/package-lock.json index 0aba0de..a186750 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,13 +1,13 @@ { "name": "vscode-basex", - "version": "0.0.44", + "version": "0.0.27", "lockfileVersion": 1, "requires": true, "dependencies": { "@eslint/eslintrc": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.2.0.tgz", - "integrity": "sha512-igm9SjJHNEJRiUnecP/1R5T3wKLEJ7pL6e2P+GUSfCd0dGjPYYZve08uzw8L2J8foVHFz+NGu12JxRcU2gGo6w==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.1.0.tgz", + "integrity": "sha512-C1DfL7XX4nPqGd6jcP01W9pVM1HYCuUkFk1432D7F0v3JSlUIeOYn9oCoi3eoLZ+iwBSb29BMFxxny0YrrEZqg==", "dev": true, "requires": { "ajv": "^6.12.4", @@ -36,9 +36,9 @@ } }, "@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.9.3", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.3.tgz", + "integrity": "sha512-3xSMlXHh03hCcCmFc0rbKp3Ivt2PFEJnQUJDDMTJQ2wkECZWdq4GePs2ctc5H8zV+cHPaq8k2vU8mrQjA6iHdQ==", "dev": true, "requires": { "@humanwhocodes/object-schema": "^1.2.1", @@ -79,9 +79,9 @@ } }, "@quodatum/xqlint": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/@quodatum/xqlint/-/xqlint-0.0.11.tgz", - "integrity": "sha512-G+pOGhrPRvCrgh3yE+U3lIavQrhPymdS1ILqd1bqgsWthF55c78D2lNDxwBn03PCpB6svh08UefkBBlm1hw3GA==", + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/@quodatum/xqlint/-/xqlint-0.0.8.tgz", + "integrity": "sha512-3tTyu5PNjSh8fIxHcFJYIn0dQY3cSYbCcVl6q3hjdHwh8TNr1PiPEnoHMHFWQ9cR5ftIi6+47/h4t6qflKfYnw==", "requires": { "colors": "1.4.0", "commander": "~2.3.0", @@ -144,9 +144,9 @@ "dev": true }, "@types/vscode": { - "version": "1.65.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.65.0.tgz", - "integrity": "sha512-wQhExnh2nEzpjDMSKhUvnNmz3ucpd3E+R7wJkOhBNK3No6fG3VUdmVmMOKD0A8NDZDDDiQcLNxe3oGmX5SjJ5w==", + "version": "1.64.0", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.64.0.tgz", + "integrity": "sha512-bSlAWz5WtcSL3cO9tAT/KpEH9rv5OBnm93OIIFwdCshaAiqr2bp1AUyEwW9MWeCvZBHEXc3V0fTYVdVyzDNwHA==", "dev": true }, "@types/xmldom": { @@ -156,14 +156,14 @@ "dev": true }, "@typescript-eslint/eslint-plugin": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.13.0.tgz", - "integrity": "sha512-vLktb2Uec81fxm/cfz2Hd6QaWOs8qdmVAZXLdOBX6JFJDhf6oDZpMzZ4/LZ6SFM/5DgDcxIMIvy3F+O9yZBuiQ==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.0.tgz", + "integrity": "sha512-fwCMkDimwHVeIOKeBHiZhRUfJXU8n6xW1FL9diDxAyGAFvKcH4csy0v7twivOQdQdA0KC8TDr7GGRd3L4Lv0rQ==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.13.0", - "@typescript-eslint/type-utils": "5.13.0", - "@typescript-eslint/utils": "5.13.0", + "@typescript-eslint/scope-manager": "5.12.0", + "@typescript-eslint/type-utils": "5.12.0", + "@typescript-eslint/utils": "5.12.0", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", @@ -173,52 +173,52 @@ } }, "@typescript-eslint/parser": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.13.0.tgz", - "integrity": "sha512-GdrU4GvBE29tm2RqWOM0P5QfCtgCyN4hXICj/X9ibKED16136l9ZpoJvCL5pSKtmJzA+NRDzQ312wWMejCVVfg==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.12.0.tgz", + "integrity": "sha512-MfSwg9JMBojMUoGjUmX+D2stoQj1CBYTCP0qnnVtu9A+YQXVKNtLjasYh+jozOcrb/wau8TCfWOkQTiOAruBog==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.13.0", - "@typescript-eslint/types": "5.13.0", - "@typescript-eslint/typescript-estree": "5.13.0", + "@typescript-eslint/scope-manager": "5.12.0", + "@typescript-eslint/types": "5.12.0", + "@typescript-eslint/typescript-estree": "5.12.0", "debug": "^4.3.2" } }, "@typescript-eslint/scope-manager": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.13.0.tgz", - "integrity": "sha512-T4N8UvKYDSfVYdmJq7g2IPJYCRzwtp74KyDZytkR4OL3NRupvswvmJQJ4CX5tDSurW2cvCc1Ia1qM7d0jpa7IA==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.12.0.tgz", + "integrity": "sha512-GAMobtIJI8FGf1sLlUWNUm2IOkIjvn7laFWyRx7CLrv6nLBI7su+B7lbStqVlK5NdLvHRFiJo2HhiDF7Ki01WQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.13.0", - "@typescript-eslint/visitor-keys": "5.13.0" + "@typescript-eslint/types": "5.12.0", + "@typescript-eslint/visitor-keys": "5.12.0" } }, "@typescript-eslint/type-utils": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.13.0.tgz", - "integrity": "sha512-/nz7qFizaBM1SuqAKb7GLkcNn2buRdDgZraXlkhz+vUGiN1NZ9LzkA595tHHeduAiS2MsHqMNhE2zNzGdw43Yg==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.12.0.tgz", + "integrity": "sha512-9j9rli3zEBV+ae7rlbBOotJcI6zfc6SHFMdKI9M3Nc0sy458LJ79Os+TPWeBBL96J9/e36rdJOfCuyRSgFAA0Q==", "dev": true, "requires": { - "@typescript-eslint/utils": "5.13.0", + "@typescript-eslint/utils": "5.12.0", "debug": "^4.3.2", "tsutils": "^3.21.0" } }, "@typescript-eslint/types": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.13.0.tgz", - "integrity": "sha512-LmE/KO6DUy0nFY/OoQU0XelnmDt+V8lPQhh8MOVa7Y5k2gGRd6U9Kp3wAjhB4OHg57tUO0nOnwYQhRRyEAyOyg==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.12.0.tgz", + "integrity": "sha512-JowqbwPf93nvf8fZn5XrPGFBdIK8+yx5UEGs2QFAYFI8IWYfrzz+6zqlurGr2ctShMaJxqwsqmra3WXWjH1nRQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.13.0.tgz", - "integrity": "sha512-Q9cQow0DeLjnp5DuEDjLZ6JIkwGx3oYZe+BfcNuw/POhtpcxMTy18Icl6BJqTSd+3ftsrfuVb7mNHRZf7xiaNA==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.12.0.tgz", + "integrity": "sha512-Dd9gVeOqt38QHR0BEA8oRaT65WYqPYbIc5tRFQPkfLquVEFPD1HAtbZT98TLBkEcCkvwDYOAvuSvAD9DnQhMfQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.13.0", - "@typescript-eslint/visitor-keys": "5.13.0", + "@typescript-eslint/types": "5.12.0", + "@typescript-eslint/visitor-keys": "5.12.0", "debug": "^4.3.2", "globby": "^11.0.4", "is-glob": "^4.0.3", @@ -227,26 +227,26 @@ } }, "@typescript-eslint/utils": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.13.0.tgz", - "integrity": "sha512-+9oHlPWYNl6AwwoEt5TQryEHwiKRVjz7Vk6kaBeD3/kwHE5YqTGHtm/JZY8Bo9ITOeKutFaXnBlMgSATMJALUQ==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.12.0.tgz", + "integrity": "sha512-k4J2WovnMPGI4PzKgDtQdNrCnmBHpMUFy21qjX2CoPdoBcSBIMvVBr9P2YDP8jOqZOeK3ThOL6VO/sy6jtnvzw==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.13.0", - "@typescript-eslint/types": "5.13.0", - "@typescript-eslint/typescript-estree": "5.13.0", + "@typescript-eslint/scope-manager": "5.12.0", + "@typescript-eslint/types": "5.12.0", + "@typescript-eslint/typescript-estree": "5.12.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/visitor-keys": { - "version": "5.13.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.13.0.tgz", - "integrity": "sha512-HLKEAS/qA1V7d9EzcpLFykTePmOQqOFim8oCvhY3pZgQ8Hi38hYpHd9e5GN6nQBFQNecNhws5wkS9Y5XIO0s/g==", + "version": "5.12.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.12.0.tgz", + "integrity": "sha512-cFwTlgnMV6TgezQynx2c/4/tx9Tufbuo9LPzmWqyRC3QC4qTGkAG1C6pBr0/4I10PAI/FlYunI3vJjIcu+ZHMg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.13.0", + "@typescript-eslint/types": "5.12.0", "eslint-visitor-keys": "^3.0.0" } }, @@ -257,9 +257,9 @@ "dev": true }, "@vscode/test-electron": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.1.3.tgz", - "integrity": "sha512-ps/yJ/9ToUZtR1dHfWi1mDXtep1VoyyrmGKC3UnIbScToRQvbUjyy1VMqnMEW3EpMmC3g7+pyThIPtPyCLHyow==", + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@vscode/test-electron/-/test-electron-2.1.2.tgz", + "integrity": "sha512-INjJ0YA9RgR1B/xBl8P4sxww4Dy2996f4Xn5oGTFfC0c2Mm45y/1Id8xmfuoba6tR5i8zZaUIHfEYWe7Rt4uZA==", "dev": true, "requires": { "http-proxy-agent": "^4.0.1", @@ -707,170 +707,162 @@ } }, "esbuild": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.25.tgz", - "integrity": "sha512-4JHEIOMNFvK09ziiL+iVmldIhLbn49V4NAVo888tcGFKedEZY/Y8YapfStJ6zSE23tzYPKxqKwQBnQoIO0BI/Q==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.14.23.tgz", + "integrity": "sha512-XjnIcZ9KB6lfonCa+jRguXyRYcldmkyZ99ieDksqW/C8bnyEX299yA4QH2XcgijCgaddEZePPTgvx/2imsq7Ig==", "dev": true, "requires": { - "esbuild-android-64": "0.14.25", - "esbuild-android-arm64": "0.14.25", - "esbuild-darwin-64": "0.14.25", - "esbuild-darwin-arm64": "0.14.25", - "esbuild-freebsd-64": "0.14.25", - "esbuild-freebsd-arm64": "0.14.25", - "esbuild-linux-32": "0.14.25", - "esbuild-linux-64": "0.14.25", - "esbuild-linux-arm": "0.14.25", - "esbuild-linux-arm64": "0.14.25", - "esbuild-linux-mips64le": "0.14.25", - "esbuild-linux-ppc64le": "0.14.25", - "esbuild-linux-riscv64": "0.14.25", - "esbuild-linux-s390x": "0.14.25", - "esbuild-netbsd-64": "0.14.25", - "esbuild-openbsd-64": "0.14.25", - "esbuild-sunos-64": "0.14.25", - "esbuild-windows-32": "0.14.25", - "esbuild-windows-64": "0.14.25", - "esbuild-windows-arm64": "0.14.25" + "esbuild-android-arm64": "0.14.23", + "esbuild-darwin-64": "0.14.23", + "esbuild-darwin-arm64": "0.14.23", + "esbuild-freebsd-64": "0.14.23", + "esbuild-freebsd-arm64": "0.14.23", + "esbuild-linux-32": "0.14.23", + "esbuild-linux-64": "0.14.23", + "esbuild-linux-arm": "0.14.23", + "esbuild-linux-arm64": "0.14.23", + "esbuild-linux-mips64le": "0.14.23", + "esbuild-linux-ppc64le": "0.14.23", + "esbuild-linux-riscv64": "0.14.23", + "esbuild-linux-s390x": "0.14.23", + "esbuild-netbsd-64": "0.14.23", + "esbuild-openbsd-64": "0.14.23", + "esbuild-sunos-64": "0.14.23", + "esbuild-windows-32": "0.14.23", + "esbuild-windows-64": "0.14.23", + "esbuild-windows-arm64": "0.14.23" } }, - "esbuild-android-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-android-64/-/esbuild-android-64-0.14.25.tgz", - "integrity": "sha512-L5vCUk7TzFbBnoESNoXjU3x9+/+7TDIE/1mTfy/erAfvZAqC+S3sp/Qa9wkypFMcFvN9FzvESkTlpeQDolREtQ==", - "dev": true, - "optional": true - }, "esbuild-android-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.25.tgz", - "integrity": "sha512-4jv5xPjM/qNm27T5j3ZEck0PvjgQtoMHnz4FzwF5zNP56PvY2CT0WStcAIl6jNlsuDdN63rk2HRBIsO6xFbcFw==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-android-arm64/-/esbuild-android-arm64-0.14.23.tgz", + "integrity": "sha512-k9sXem++mINrZty1v4FVt6nC5BQCFG4K2geCIUUqHNlTdFnuvcqsY7prcKZLFhqVC1rbcJAr9VSUGFL/vD4vsw==", "dev": true, "optional": true }, "esbuild-darwin-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.25.tgz", - "integrity": "sha512-TGp8tuudIxOyWd1+8aYPxQmC1ZQyvij/AfNBa35RubixD0zJ1vkKHVAzo0Zao1zcG6pNqiSyzfPto8vmg0s7oA==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-darwin-64/-/esbuild-darwin-64-0.14.23.tgz", + "integrity": "sha512-lB0XRbtOYYL1tLcYw8BoBaYsFYiR48RPrA0KfA/7RFTr4MV7Bwy/J4+7nLsVnv9FGuQummM3uJ93J3ptaTqFug==", "dev": true, "optional": true }, "esbuild-darwin-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.25.tgz", - "integrity": "sha512-oTcDgdm0MDVEmw2DWu8BV68pYuImpFgvWREPErBZmNA4MYKGuBRaCiJqq6jZmBR1x+3y1DWCjez+5uLtuAm6mw==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.14.23.tgz", + "integrity": "sha512-yat73Z/uJ5tRcfRiI4CCTv0FSnwErm3BJQeZAh+1tIP0TUNh6o+mXg338Zl5EKChD+YGp6PN+Dbhs7qa34RxSw==", "dev": true, "optional": true }, "esbuild-freebsd-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.25.tgz", - "integrity": "sha512-ueAqbnMZ8arnuLH8tHwTCQYeptnHOUV7vA6px6j4zjjQwDx7TdP7kACPf3TLZLdJQ3CAD1XCvQ2sPhX+8tacvQ==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-64/-/esbuild-freebsd-64-0.14.23.tgz", + "integrity": "sha512-/1xiTjoLuQ+LlbfjJdKkX45qK/M7ARrbLmyf7x3JhyQGMjcxRYVR6Dw81uH3qlMHwT4cfLW4aEVBhP1aNV7VsA==", "dev": true, "optional": true }, "esbuild-freebsd-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.25.tgz", - "integrity": "sha512-+ZVWud2HKh+Ob6k/qiJWjBtUg4KmJGGmbvEXXW1SNKS7hW7HU+Zq2ZCcE1akFxOPkVB+EhOty/sSek30tkCYug==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.14.23.tgz", + "integrity": "sha512-uyPqBU/Zcp6yEAZS4LKj5jEE0q2s4HmlMBIPzbW6cTunZ8cyvjG6YWpIZXb1KK3KTJDe62ltCrk3VzmWHp+iLg==", "dev": true, "optional": true }, "esbuild-linux-32": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.25.tgz", - "integrity": "sha512-3OP/lwV3kCzEz45tobH9nj+uE4ubhGsfx+tn0L26WAGtUbmmcRpqy7XRG/qK7h1mClZ+eguIANcQntYMdYklfw==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-32/-/esbuild-linux-32-0.14.23.tgz", + "integrity": "sha512-37R/WMkQyUfNhbH7aJrr1uCjDVdnPeTHGeDhZPUNhfoHV0lQuZNCKuNnDvlH/u/nwIYZNdVvz1Igv5rY/zfrzQ==", "dev": true, "optional": true }, "esbuild-linux-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.25.tgz", - "integrity": "sha512-+aKHdHZmX9qwVlQmu5xYXh7GsBFf4TWrePgeJTalhXHOG7NNuUwoHmketGiZEoNsWyyqwH9rE5BC+iwcLY30Ug==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.14.23.tgz", + "integrity": "sha512-H0gztDP60qqr8zoFhAO64waoN5yBXkmYCElFklpd6LPoobtNGNnDe99xOQm28+fuD75YJ7GKHzp/MLCLhw2+vQ==", "dev": true, "optional": true }, "esbuild-linux-arm": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.25.tgz", - "integrity": "sha512-aTLcE2VBoLydL943REcAcgnDi3bHtmULSXWLbjtBdtykRatJVSxKMjK9YlBXUZC4/YcNQfH7AxwVeQr9fNxPhw==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm/-/esbuild-linux-arm-0.14.23.tgz", + "integrity": "sha512-x64CEUxi8+EzOAIpCUeuni0bZfzPw/65r8tC5cy5zOq9dY7ysOi5EVQHnzaxS+1NmV+/RVRpmrzGw1QgY2Xpmw==", "dev": true, "optional": true }, "esbuild-linux-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.25.tgz", - "integrity": "sha512-UxfenPx/wSZx55gScCImPtXekvZQLI2GW3qe5dtlmU7luiqhp5GWPzGeQEbD3yN3xg/pHc671m5bma5Ns7lBHw==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-arm64/-/esbuild-linux-arm64-0.14.23.tgz", + "integrity": "sha512-c4MLOIByNHR55n3KoYf9hYDfBRghMjOiHLaoYLhkQkIabb452RWi+HsNgB41sUpSlOAqfpqKPFNg7VrxL3UX9g==", "dev": true, "optional": true }, "esbuild-linux-mips64le": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.25.tgz", - "integrity": "sha512-wLWYyqVfYx9Ur6eU5RT92yJVsaBGi5RdkoWqRHOqcJ38Kn60QMlcghsKeWfe9jcYut8LangYZ98xO1LxIoSXrQ==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.14.23.tgz", + "integrity": "sha512-kHKyKRIAedYhKug2EJpyJxOUj3VYuamOVA1pY7EimoFPzaF3NeY7e4cFBAISC/Av0/tiV0xlFCt9q0HJ68IBIw==", "dev": true, "optional": true }, "esbuild-linux-ppc64le": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.25.tgz", - "integrity": "sha512-0dR6Csl6Zas3g4p9ULckEl8Mo8IInJh33VCJ3eaV1hj9+MHGdmDOakYMN8MZP9/5nl+NU/0ygpd14cWgy8uqRw==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.14.23.tgz", + "integrity": "sha512-7ilAiJEPuJJnJp/LiDO0oJm5ygbBPzhchJJh9HsHZzeqO+3PUzItXi+8PuicY08r0AaaOe25LA7sGJ0MzbfBag==", "dev": true, "optional": true }, "esbuild-linux-riscv64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.25.tgz", - "integrity": "sha512-J4d20HDmTrgvhR0bdkDhvvJGaikH3LzXQnNaseo8rcw9Yqby9A90gKUmWpfwqLVNRILvNnAmKLfBjCKU9ajg8w==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.14.23.tgz", + "integrity": "sha512-fbL3ggK2wY0D8I5raPIMPhpCvODFE+Bhb5QGtNP3r5aUsRR6TQV+ZBXIaw84iyvKC8vlXiA4fWLGhghAd/h/Zg==", "dev": true, "optional": true }, "esbuild-linux-s390x": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.25.tgz", - "integrity": "sha512-YI2d5V6nTE73ZnhEKQD7MtsPs1EtUZJ3obS21oxQxGbbRw1G+PtJKjNyur+3t6nzHP9oTg6GHQ3S3hOLLmbDIQ==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-linux-s390x/-/esbuild-linux-s390x-0.14.23.tgz", + "integrity": "sha512-GHMDCyfy7+FaNSO8RJ8KCFsnax8fLUsOrj9q5Gi2JmZMY0Zhp75keb5abTFCq2/Oy6KVcT0Dcbyo/bFb4rIFJA==", "dev": true, "optional": true }, "esbuild-netbsd-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.25.tgz", - "integrity": "sha512-TKIVgNWLUOkr+Exrye70XTEE1lJjdQXdM4tAXRzfHE9iBA7LXWcNtVIuSnphTqpanPzTDFarF0yqq4kpbC6miA==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-netbsd-64/-/esbuild-netbsd-64-0.14.23.tgz", + "integrity": "sha512-ovk2EX+3rrO1M2lowJfgMb/JPN1VwVYrx0QPUyudxkxLYrWeBxDKQvc6ffO+kB4QlDyTfdtAURrVzu3JeNdA2g==", "dev": true, "optional": true }, "esbuild-openbsd-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.25.tgz", - "integrity": "sha512-QgFJ37A15D7NIXBTYEqz29+uw3nNBOIyog+3kFidANn6kjw0GHZ0lEYQn+cwjyzu94WobR+fes7cTl/ZYlHb1A==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-openbsd-64/-/esbuild-openbsd-64-0.14.23.tgz", + "integrity": "sha512-uYYNqbVR+i7k8ojP/oIROAHO9lATLN7H2QeXKt2H310Fc8FJj4y3Wce6hx0VgnJ4k1JDrgbbiXM8rbEgQyg8KA==", "dev": true, "optional": true }, "esbuild-sunos-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.25.tgz", - "integrity": "sha512-rmWfjUItYIVlqr5EnTH1+GCxXiBOC42WBZ3w++qh7n2cS9Xo0lO5pGSG2N+huOU2fX5L+6YUuJ78/vOYvefeFw==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-sunos-64/-/esbuild-sunos-64-0.14.23.tgz", + "integrity": "sha512-hAzeBeET0+SbScknPzS2LBY6FVDpgE+CsHSpe6CEoR51PApdn2IB0SyJX7vGelXzlyrnorM4CAsRyb9Qev4h9g==", "dev": true, "optional": true }, "esbuild-windows-32": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.25.tgz", - "integrity": "sha512-HGAxVUofl3iUIz9W10Y9XKtD0bNsK9fBXv1D55N/ljNvkrAYcGB8YCm0v7DjlwtyS6ws3dkdQyXadbxkbzaKOA==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-windows-32/-/esbuild-windows-32-0.14.23.tgz", + "integrity": "sha512-Kttmi3JnohdaREbk6o9e25kieJR379TsEWF0l39PQVHXq3FR6sFKtVPgY8wk055o6IB+rllrzLnbqOw/UV60EA==", "dev": true, "optional": true }, "esbuild-windows-64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.25.tgz", - "integrity": "sha512-TirEohRkfWU9hXLgoDxzhMQD1g8I2mOqvdQF2RS9E/wbkORTAqJHyh7wqGRCQAwNzdNXdg3JAyhQ9/177AadWA==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.14.23.tgz", + "integrity": "sha512-JtIT0t8ymkpl6YlmOl6zoSWL5cnCgyLaBdf/SiU/Eg3C13r0NbHZWNT/RDEMKK91Y6t79kTs3vyRcNZbfu5a8g==", "dev": true, "optional": true }, "esbuild-windows-arm64": { - "version": "0.14.25", - "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.25.tgz", - "integrity": "sha512-4ype9ERiI45rSh+R8qUoBtaj6kJvUOI7oVLhKqPEpcF4Pa5PpT3hm/mXAyotJHREkHpM87PAJcA442mLnbtlNA==", + "version": "0.14.23", + "resolved": "https://registry.npmjs.org/esbuild-windows-arm64/-/esbuild-windows-arm64-0.14.23.tgz", + "integrity": "sha512-cTFaQqT2+ik9e4hePvYtRZQ3pqOvKDVNarzql0VFIzhc0tru/ZgdLoXd6epLiKT+SzoSce6V9YJ+nn6RCn6SHw==", "dev": true, "optional": true }, @@ -892,12 +884,12 @@ "dev": true }, "eslint": { - "version": "8.10.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.10.0.tgz", - "integrity": "sha512-tcI1D9lfVec+R4LE1mNDnzoJ/f71Kl/9Cv4nG47jOueCMBrCCKYXr4AUVS7go6mWYGFD4+EoN6+eXSrEbRzXVw==", + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.9.0.tgz", + "integrity": "sha512-PB09IGwv4F4b0/atrbcMFboF/giawbBLVC7fyDamk5Wtey4Jh2K+rYaBhCAbUyEI4QzB1ly09Uglc9iCtFaG2Q==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.2.0", + "@eslint/eslintrc": "^1.1.0", "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", @@ -2173,9 +2165,9 @@ } }, "typescript": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.2.tgz", - "integrity": "sha512-HM/hFigTBHZhLXshn9sN37H085+hQGeJHJ/X7LpBWLID/fbc2acUMfU+lGD98X81sKP+pFa9f0DZmCwB9GnbAg==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz", + "integrity": "sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA==", "dev": true }, "unique-string": { diff --git a/package.json b/package.json index a446ad6..bdd34db 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "vscode-basex", "displayName": "BaseX tools", "description": "BaseX tools: XQuery, XML, XPath Tools for Visual Studio Code", - "version": "0.0.52", + "version": "0.0.28", "preview": true, "publisher": "quodatum", "author": "Andy Bunce (https://github.com/Quodatum)", @@ -12,13 +12,13 @@ "theme": "light" }, "icon": "resources/basex.png", - "homepage": "https://github.com/Quodatum/vscode-basex", + "homepage": "https://github.com/Quodatum/vscode-xml", "repository": { "type": "git", - "url": "git+https://github.com/Quodatum/vscode-basex.git" + "url": "git+https://github.com/Quodatum/vscode-xml.git" }, "bugs": { - "url": "https://github.com/Quodatum/vscode-basex/issues" + "url": "https://github.com/Quodatum/vscode-xml/issues" }, "engines": { "vscode": "^1.63.0" @@ -27,7 +27,6 @@ "Formatters", "Programming Languages", "Linters", - "Snippets", "Other" ], "activationEvents": [ @@ -71,134 +70,109 @@ { "command": "basexTools.minifyXml", "title": "BaseX Tools: Minify XML" - }, - { - "command": "basexTools.getAST", - "title": "BaseX Tools: AST" } ], - "configuration": [ - { - "id": "xmltree", - "title": "XML tree view ", - - "properties": { - "basexTools.xmlTree.enableTreeView": { - "type": "boolean", - "default": false, - "description": "Enables the XML Document view in the explorer for XML documents.", - "scope": "window" - }, - "basexTools.xmlTree.enableViewMetadata": { - "type": "boolean", - "default": true, - "description": "Enables attribute and child element counts in the XML Document view.", - "scope": "window" - }, - "basexTools.xmlTree.enableViewCursorSync": { - "type": "boolean", - "default": false, - "description": "Enables auto-reveal of elements in the XML Document view when a start tag is clicked in the editor.", - "scope": "window" - } + "configuration": { + "title": "BaseX Tools Configuration", + "type": "object", + "properties": { + "basexTools.enableXmlTreeView": { + "type": "boolean", + "default": true, + "description": "Enables the XML Document view in the explorer for XML documents.", + "scope": "window" + }, + "basexTools.enableXmlTreeViewMetadata": { + "type": "boolean", + "default": true, + "description": "Enables attribute and child element counts in the XML Document view.", + "scope": "window" + }, + "basexTools.enableXmlTreeViewCursorSync": { + "type": "boolean", + "default": false, + "description": "Enables auto-reveal of elements in the XML Document view when a start tag is clicked in the editor.", + "scope": "window" + }, + "basexTools.enforcePrettySelfClosingTagOnFormat": { + "type": "boolean", + "default": false, + "description": "Enforces a space before the forward slash at the end of a self-closing XML tag.", + "scope": "resource" + }, + "basexTools.ignoreDefaultNamespace": { + "type": "boolean", + "default": true, + "description": "Ignore default xmlns attributes when evaluating XPath.", + "scope": "window" + }, + "basexTools.persistXPathQuery": { + "type": "boolean", + "default": true, + "description": "Remember the last XPath query used.", + "scope": "window" + }, + "basexTools.removeCommentsOnMinify": { + "type": "boolean", + "default": false, + "description": "Remove XML comments during minification.", + "scope": "resource" + }, + "basexTools.splitAttributesOnFormat": { + "type": "boolean", + "default": false, + "description": "Put each attribute on a new line when formatting XML. Overrides `basexTools.splitXmlnsOnFormat` if set to `true`.", + "scope": "resource" + }, + "basexTools.splitXmlnsOnFormat": { + "type": "boolean", + "default": true, + "description": "Put each xmlns attribute on a new line when formatting XML.", + "scope": "resource" + }, + "basexTools.xmlFormatterImplementation": { + "type": "string", + "enum": [ + "classic", + "v2" + ], + "default": "v2", + "description": "Supported XML Formatters: classic", + "scope": "window" + }, + "basexTools.xqueryExecutionArguments": { + "type": "array", + "default": [ + "-xquery", + "$(script)", + "-in", + "$(input)", + "-out", + "$(input).output.xml" + ], + "description": "Arguments to be passed to the XQuery execution engine.", + "scope": "window" + }, + "basexTools.xqueryExecutionEngine": { + "type": "string", + "default": "", + "description": "The full path to the executable to run when executing XQuery scripts.", + "scope": "window" + }, + "basexTools.xqueryExecutionInputLimit": { + "type": "integer", + "default": 100, + "description": "The maximum number of input files to enumerate when executing XQuery scripts.", + "scope": "window" + }, + "basexTools.xqueryExecutionInputSearchPattern": { + "type": "string", + "default": "**/*.xml", + "description": "The pattern used to search for input XML files when executing XQuery scripts.", + "scope": "window" } - }, - { - "id": "xpath", - "title": "XPath ", - "properties":{ - "basexTools.xpath.ignoreDefaultNamespace": { - "type": "boolean", - "default": true, - "description": "Ignore default xmlns attributes when evaluating XPath.", - "scope": "window" - }, - "basexTools.xpath.persistXPathQuery": { - "type": "boolean", - "default": true, - "description": "Remember the last XPath query used.", - "scope": "window" - } - } - },{ - "id": "xquery", - "title": "XQuery ", - "properties":{ - "basexTools.xquery.executionArguments": { - "type": "array", - "default": [ - "-xquery", - "$(script)", - "-in", - "$(input)", - "-out", - "$(input).output.xml" - ], - "description": "Arguments to be passed to the XQuery execution engine.", - "scope": "window" - }, - "basexTools.xquery.executionEngine": { - "type": "string", - "default": "", - "description": "The full path to the executable to run when executing XQuery scripts.", - "scope": "window" - }, - "basexTools.xquery.executionInputLimit": { - "type": "integer", - "default": 100, - "description": "The maximum number of input files to enumerate when executing XQuery scripts.", - "scope": "window" - }, - "basexTools.xquery.executionInputSearchPattern": { - "type": "string", - "default": "**/*.xml", - "description": "The pattern used to search for input XML files when executing XQuery scripts.", - "scope": "window" - } - } - - },{ - "title": "BaseX Tools ", - "type": "object", - "properties": { - "basexTools.enforcePrettySelfClosingTagOnFormat": { - "type": "boolean", - "default": false, - "description": "Enforces a space before the forward slash at the end of a self-closing XML tag.", - "scope": "resource" - }, - - "basexTools.removeCommentsOnMinify": { - "type": "boolean", - "default": false, - "description": "Remove XML comments during minification.", - "scope": "resource" - }, - "basexTools.splitAttributesOnFormat": { - "type": "boolean", - "default": false, - "description": "Put each attribute on a new line when formatting XML. Overrides `basexTools.splitXmlnsOnFormat` if set to `true`.", - "scope": "resource" - }, - "basexTools.splitXmlnsOnFormat": { - "type": "boolean", - "default": true, - "description": "Put each xmlns attribute on a new line when formatting XML.", - "scope": "resource" - }, - "basexTools.xmlFormatterImplementation": { - "type": "string", - "enum": [ - "classic", - "v2" - ], - "default": "v2", - "description": "Supported XML Formatters: classic", - "scope": "window" - } - } } - ], + }, "grammars": [ { "language": "xquery", @@ -206,12 +180,6 @@ "scopeName": "source.xquery" } ], - "snippets": [ - { - "language": "xquery", - "path": "./snippets.jsonc" - } - ], "keybindings": [ { "key": "ctrl+shift+alt+x", @@ -307,18 +275,18 @@ "@types/node": "^14.18.12", "@types/vscode": "^1.63.0", "@types/xmldom": "^0.1.31", - "@typescript-eslint/eslint-plugin": "^5.13.0", - "@typescript-eslint/parser": "^5.13.0", - "@vscode/test-electron": "^2.1.3", - "esbuild": "^0.14.25", - "eslint": "^8.10.0", + "@typescript-eslint/eslint-plugin": "^5.12.0", + "@typescript-eslint/parser": "^5.12.0", + "@vscode/test-electron": "^2.1.2", + "esbuild": "^0.14.23", + "eslint": "^8.9.0", "glob": "^7.2.0", "mocha": "^9.2.1", - "typescript": "^4.6.2" + "typescript": "^4.5.4" }, "dependencies": { - "@quodatum/xqlint": "^0.0.11", + "@quodatum/xqlint": "^0.0.8", "@xmldom/xmldom": "^0.8.1", "xpath": "0.0.32" } -} \ No newline at end of file +} diff --git a/resources/basex.png b/resources/basex.png index 675f416..d737358 100644 Binary files a/resources/basex.png and b/resources/basex.png differ diff --git a/snippets.jsonc b/snippets.jsonc deleted file mode 100644 index 2149379..0000000 --- a/snippets.jsonc +++ /dev/null @@ -1,120 +0,0 @@ -{ - - "for": { - "prefix": "for", - "body": "for $${1:item} in ${2:expr}" - }, - "return": { - "prefix": "ret", - "body": "return ${1:expr}" - }, - "import": { - "prefix": "import", - "body": "import module namespace ${1:ns} = '${2:http://www.example.com/}';", - "description": "Import module" - }, - "module": { - "prefix": "module", - "body": "module namespace ${1:ns} = '${2:http://www.example.com}';" - }, - "every": { - "prefix": "every", - "body": "every $${1:varname} in ${2:expr} satisfies ${3:expr}" - }, - "some": { - "prefix": "some", - "body": "some $${1:varname} in ${2:expr} satisfies ${3:expr}" - }, - "function": { - "prefix": "df", - "body": [ - "(:~ $${2:name} :)", - "declare function ${1:ns}:${2:name}(){", - "${3:expr}", - "};" - ], - "description": "declare a function" - }, - "declare variable": { - "prefix": "dv", - "body": [ - "(:~ $${1:varname} :)", - "declare variable $${1:varname} := ${2:expr};", - "" - ], - "description": "declare variable" - }, - "switch": { - "prefix": "sw", - "body": [ - "switch(${1:foo})", - "case ${2:foo} return ${3:true}", - "default return ${4:false}" - ], - "description": "switch statement" - }, - "typeswitch": { - "prefix": "type", - "body": [ - "typeswitch(${1:foo})", - "case ${2:foo} return ${3:true}", - "default return ${4:false}" - ], - "description": "typeswitch statement" - }, - "try": { - "prefix": "try", - "body": [ - "try { ${1:expr} } ", - "catch ${2:*} { ${3:expr} }" - ], - "description": "switch statement" - }, - "tumbling": { - "prefix": "tumbling", - "body": [ - "for tumbling window $${1:varname} in ${2:expr}", - "start at $${3:start} when ${4:expr}", - "end at $${5:end} when ${6:expr}", - "return ${7:expr}" - ], - "description": "tumbling window" - }, - "sliding": { - "prefix": "sliding", - "body": [ - "for sliding window $${1:varname} in ${2:expr}", - "start at $${3:start} when ${4:expr}", - "end at $${5:end} when ${6:expr}", - "return ${7:expr}" - ], - "description": "sliding window" - } -} -//snippet if -// if(${1:true}) then ${2:expr} else ${3:true} - -// default return ${4:false} - - -//snippet let -// let $${1:varname} := ${2:expr} -//snippet group -// group by $${1:varname} := ${2:expr} -//snippet order -// order by ${1:expr} ${2:descending} -//snippet stable -// stable order by ${1:expr} -//snippet count -// count $${1:varname} -//snippet ordered -// ordered { ${1:expr} } -//snippet unordered -// unordered { ${1:expr} } -//snippet treat -// treat as ${1:expr} -//snippet castable -// castable as ${1:atomicType} -//snippet cast -// cast as ${1:atomicType} - diff --git a/src/CHANGELOG.md b/src/CHANGELOG.md deleted file mode 100644 index fd3310f..0000000 --- a/src/CHANGELOG.md +++ /dev/null @@ -1,5 +0,0 @@ -# 0.0.48 -* Fix xmlToText #6 -* FIX outline all vars - -# 0.0.47 diff --git a/src/common/configuration.ts b/src/common/configuration.ts index fbca6b2..c8f141e 100644 --- a/src/common/configuration.ts +++ b/src/common/configuration.ts @@ -4,23 +4,23 @@ const ExtensionTopLevelSection = "basexTools"; export class Configuration { static get enableXmlTreeView(): boolean { - return this._getForWindow("xmlTree.enableTreeView"); + return this._getForWindow("enableXmlTreeView"); } static get enableXmlTreeViewMetadata(): boolean { - return this._getForWindow("xmlTree.enableViewMetadata"); + return this._getForWindow("enableXmlTreeViewMetadata"); } static get enableXmlTreeViewCursorSync(): boolean { - return this._getForWindow("xmlTree.enableViewCursorSync"); + return this._getForWindow("enableXmlTreeViewCursorSync"); } static get ignoreDefaultNamespace(): boolean { - return this._getForWindow("xpath.ignoreDefaultNamespace"); + return this._getForWindow("ignoreDefaultNamespace"); } static get persistXPathQuery(): boolean { - return this._getForWindow("xpath.persistXPathQuery"); + return this._getForWindow("persistXPathQuery"); } static get xmlFormatterImplementation(): string { @@ -28,19 +28,19 @@ export class Configuration { } static get xqueryExecutionArguments(): string[] { - return this._getForWindow("xquery.executionArguments"); + return this._getForWindow("xqueryExecutionArguments"); } static get xqueryExecutionEngine(): string { - return this._getForWindow("xquery.executionEngine"); + return this._getForWindow("xqueryExecutionEngine"); } static get xqueryExecutionInputLimit(): number { - return this._getForWindow("xquery.executionInputLimit"); + return this._getForWindow("xqueryExecutionInputLimit"); } static get xqueryExecutionInputSearchPattern(): string { - return this._getForWindow("xquery.executionInputSearchPattern"); + return this._getForWindow("xqueryExecutionInputSearchPattern"); } static enforcePrettySelfClosingTagOnFormat(resource: Uri): boolean { diff --git a/src/common/logger.ts b/src/common/logger.ts index 6ca1994..1938181 100644 --- a/src/common/logger.ts +++ b/src/common/logger.ts @@ -1,10 +1,9 @@ // debug messages import { OutputChannel, window } from "vscode"; // eslint-disable-next-line @typescript-eslint/no-var-requires -const ver = require("@quodatum/xqlint").version; - -const _channel:OutputChannel = window.createOutputChannel("BaseX"); +const XQLint = require("@quodatum/xqlint").XQLint; +const _channel:OutputChannel = window.createOutputChannel("BaseX log"); function logdate(){ return (new Date()).toISOString().slice(0, 19).replace(/-/g, "/").replace("T", " "); } @@ -20,5 +19,5 @@ export class channel { _channel.show } } -channel.log("started, XQLint version: "+ver); +channel.log("started, XQLint version: "+XQLint.version); _channel.show \ No newline at end of file diff --git a/src/completion/xquery-completion-item-provider.ts b/src/completion/xquery-completion-item-provider.ts index 73c61b3..93ad127 100644 --- a/src/completion/xquery-completion-item-provider.ts +++ b/src/completion/xquery-completion-item-provider.ts @@ -24,9 +24,7 @@ export class XQueryCompletionItemProvider implements CompletionItemProvider { case "function": completionItem.kind = CompletionItemKind.Function; - // eslint-disable-next-line no-case-declarations const funcStart = (xqLintCompletionItem.value.indexOf(":") + 1); - // eslint-disable-next-line no-case-declarations const funcEnd = xqLintCompletionItem.value.indexOf("("); completionItem.insertText = xqLintCompletionItem.value.substring(funcStart, funcEnd); diff --git a/src/constants.ts b/src/constants.ts index 641878c..9f08f7a 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/no-namespace */ export namespace commands { export const evaluateXPath = "basexTools.evaluateXPath"; export const executeXQuery = "basexTools.executeXQuery"; @@ -7,7 +6,6 @@ export namespace commands { export const textToXml = "basexTools.textToXml"; export const getCurrentXPath = "basexTools.getCurrentXPath"; export const minifyXml = "basexTools.minifyXml"; - export const getAST = "basexTools.getAST"; } export namespace contextKeys { diff --git a/src/extension.ts b/src/extension.ts index 6efe5f9..50c0cf0 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,21 +1,20 @@ import { - commands, languages, window, ExtensionContext, - TextEditor, TextEditorSelectionChangeEvent, TextEditorSelectionChangeKind, DiagnosticCollection + commands, languages, window, workspace, ExtensionContext, Memento, + TextEditor, TextEditorSelectionChangeEvent, TextEditorSelectionChangeKind, DiagnosticCollection, TextDocument, TextEdit,Range } from "vscode"; import { channel } from "./common/logger"; import { createDocumentSelector, ExtensionState, Configuration } from "./common"; import { XQueryCompletionItemProvider } from "./completion"; import { XmlFormatterFactory, XmlFormattingEditProvider } from "./formatting"; -import { formatAsXml, minifyXml, xmlToText, textToXml } from "./formatting/commands"; -import { XQueryLinter,getAst } from "./linting"; +import { formatAsXml, minifyXml, xmlToText, textToXml } from "./formatting/commands"; +import { XQueryLinter } from "./linting"; import { XmlTreeDataProvider } from "./tree-view"; import { evaluateXPath, getCurrentXPath } from "./xpath/commands"; import { executeXQuery } from "./xquery-execution/commands"; import * as constants from "./constants"; -import { XQueryFormatter } from "./formatting/xquery-formatting-provider"; -import { Symbols } from './symbols/symbols'; +import { XQueryFormatter } from "./formatting/XQueryFormatter"; let diagnosticCollectionXQuery: DiagnosticCollection; @@ -33,27 +32,30 @@ export function activate(context: ExtensionContext) { /* Formatting Features */ const xmlFormattingEditProvider = new XmlFormattingEditProvider(XmlFormatterFactory.getXmlFormatter()); - const xqueryFormattingEditProvider = new XQueryFormatter(); + context.subscriptions.push( commands.registerTextEditorCommand(constants.commands.formatAsXml, formatAsXml), commands.registerTextEditorCommand(constants.commands.xmlToText, xmlToText), commands.registerTextEditorCommand(constants.commands.textToXml, textToXml), commands.registerTextEditorCommand(constants.commands.minifyXml, minifyXml), - commands.registerTextEditorCommand(constants.commands.getAST, getAst), - languages.registerDocumentFormattingEditProvider(xmlXsdDocSelector, xmlFormattingEditProvider), - languages.registerDocumentRangeFormattingEditProvider(xmlXsdDocSelector, xmlFormattingEditProvider), - - languages.registerDocumentFormattingEditProvider(xqueryDocSelector, xqueryFormattingEditProvider), - languages.registerDocumentRangeFormattingEditProvider(xqueryDocSelector, xqueryFormattingEditProvider) + languages.registerDocumentRangeFormattingEditProvider(xmlXsdDocSelector, xmlFormattingEditProvider) ); - - - // symbols - const symbols = new Symbols(); - context.subscriptions.push(languages.registerDocumentSymbolProvider(constants.languageIds.xquery, symbols)); - + // 👍 XQuery formatter implemented using API + languages.registerDocumentFormattingEditProvider(constants.languageIds.xquery, { + async provideDocumentFormattingEdits(document: TextDocument): Promise { + + try { + const text = XQueryFormatter.format(document.getText()) + const entireDocRange = document.validateRange(new Range(0, 0, document.lineCount, 0)); + return [TextEdit.replace(entireDocRange, text)]; + } catch (e) { + window.showInformationMessage('Format failed -syntax error') + } + } + }); + /* Linting Features */ diagnosticCollectionXQuery = languages.createDiagnosticCollection(constants.diagnosticCollections.xquery); context.subscriptions.push( @@ -95,7 +97,7 @@ export function activate(context: ExtensionContext) { export function deactivate() { // do nothing -} +}; function _handleContextChange(editor: TextEditor): void { const supportedSchemes = [constants.uriSchemes.file, constants.uriSchemes.untitled]; diff --git a/src/formatting/XQueryFormatter.ts b/src/formatting/XQueryFormatter.ts new file mode 100644 index 0000000..82e2e76 --- /dev/null +++ b/src/formatting/XQueryFormatter.ts @@ -0,0 +1,18 @@ +// format xquery +import { channel } from "../common/logger"; +import { XQLint, CodeFormatter } from "@quodatum/xqlint"; + + +export class XQueryFormatter { + static format(xquery: string): string { + channel.log("XQueryFormatter"); + const linter = new (XQLint as any)(xquery, { "styleCheck": false }); + channel.appendLine("got linter: " + linter.hasSyntaxError()); + //if(linter.hasSyntaxError()+linter.hasSyntaxError()) throw new Error("XQuery syntax error") + const ast = linter.getAST() + const formatter = new (CodeFormatter as any)(ast); + const formatted = formatter.format().trim(); + channel.log("XQueryFormatter done"); + return formatted; + } +} diff --git a/src/formatting/commands/index.ts b/src/formatting/commands/index.ts index 8e7437c..3dc6ea2 100644 --- a/src/formatting/commands/index.ts +++ b/src/formatting/commands/index.ts @@ -1,5 +1,4 @@ export * from "./formatAsXml"; export * from "./minifyXml"; export * from "./xmlToText"; - - +export * from "./textToXml"; diff --git a/src/formatting/commands/textToXml.ts b/src/formatting/commands/textToXml.ts new file mode 100644 index 0000000..cf6c4ef --- /dev/null +++ b/src/formatting/commands/textToXml.ts @@ -0,0 +1,33 @@ +import { workspace } from "vscode"; +import { ProviderResult, Range, TextEdit, TextEditor, Selection } from "vscode"; + +import { NativeCommands } from "../../common"; +import * as constants from "../../constants"; + +import { XmlFormatterFactory } from "../xml-formatter"; +import { XmlFormattingEditProvider } from "../xml-formatting-edit-provider"; +import { XmlFormattingOptionsFactory } from "../xml-formatting-options"; + +export function textToXml(textEditor: TextEditor): void { + textEditor.edit(textEdit => { + const selections = textEditor.selections; + selections.forEach(selection => { + if (selection.isEmpty) { + selection = new Selection( + textEditor.document.positionAt(0), + textEditor.document.positionAt(textEditor.document.getText().length) + ); + } + const txt = textEditor.document.getText(new Range(selection.start, selection.end)); + const transformed = txt + .replace(/</g, "<") + .replace(/>/g, ">") + .replace(/&/g, "&") + // tslint:disable-next-line + .replace(/"/g, '"') + .replace(/'/g, "'"); + + textEdit.replace(selection, transformed); + }); + }); +} diff --git a/src/formatting/commands/xmlToText.ts b/src/formatting/commands/xmlToText.ts index 2551c7c..5dea03f 100644 --- a/src/formatting/commands/xmlToText.ts +++ b/src/formatting/commands/xmlToText.ts @@ -1,7 +1,12 @@ +import { workspace } from "vscode"; +import { ProviderResult, Range, TextEdit, TextEditor, Selection } from "vscode"; -import { Range, TextEditor, Selection } from "vscode"; - +import { NativeCommands } from "../../common"; +import * as constants from "../../constants"; +import { XmlFormatterFactory } from "../xml-formatter"; +import { XmlFormattingEditProvider } from "../xml-formatting-edit-provider"; +import { XmlFormattingOptionsFactory } from "../xml-formatting-options"; export function xmlToText(textEditor: TextEditor): void { textEditor.edit(textEdit => { @@ -15,9 +20,9 @@ export function xmlToText(textEditor: TextEditor): void { } const txt = textEditor.document.getText(new Range(selection.start, selection.end)); const transformed = txt - .replace(/&/g, "&") .replace(//g, ">") + .replace(/&/g, "&") .replace(/"/g, """) .replace(/'/g, "'"); @@ -25,27 +30,3 @@ export function xmlToText(textEditor: TextEditor): void { }); }); } -export function textToXml(textEditor: TextEditor): void { - textEditor.edit(textEdit => { - const selections = textEditor.selections; - selections.forEach(selection => { - if (selection.isEmpty) { - selection = new Selection( - textEditor.document.positionAt(0), - textEditor.document.positionAt(textEditor.document.getText().length) - ); - } - const txt = textEditor.document.getText(new Range(selection.start, selection.end)); - const transformed = txt - .replace(/</g, "<") - .replace(/>/g, ">") - .replace(/&/g, "&") - // tslint:disable-next-line - .replace(/"/g, '"') - .replace(/'/g, "'"); - - textEdit.replace(selection, transformed); - }); - }); -} - diff --git a/src/formatting/index.ts b/src/formatting/index.ts index 02d5f91..d5956c4 100644 --- a/src/formatting/index.ts +++ b/src/formatting/index.ts @@ -1,4 +1,3 @@ export * from "./xml-formatter"; export * from "./xml-formatting-edit-provider"; export * from "./xml-formatting-options"; -export * from "./xquery-formatting-provider"; diff --git a/src/formatting/xml-formatter.ts b/src/formatting/xml-formatter.ts index baa8955..8a61c2f 100644 --- a/src/formatting/xml-formatter.ts +++ b/src/formatting/xml-formatter.ts @@ -1,6 +1,6 @@ +import { window, workspace } from "vscode"; - -import { Configuration } from "../common"; +import { Configuration, ExtensionState } from "../common"; import * as constants from "../constants"; import { ClassicXmlFormatter } from "./formatters/classic-xml-formatter"; import { V2XmlFormatter } from "./formatters/v2-xml-formatter"; diff --git a/src/formatting/xquery-formatting-provider.ts b/src/formatting/xquery-formatting-provider.ts deleted file mode 100644 index 0da9ca1..0000000 --- a/src/formatting/xquery-formatting-provider.ts +++ /dev/null @@ -1,33 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -// format xquery -import { XQLint, CodeFormatter } from "@quodatum/xqlint"; -import { CancellationToken, DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider, - FormattingOptions, ProviderResult,Range, - TextDocument, TextEdit} from "vscode"; - -import { channel } from "../common/logger"; - -function format(xquery: string,document: TextDocument): string { - channel.log("XQueryFormatter" + document.uri); - const linter = new (XQLint as any)(xquery, { "styleCheck": false }); - channel.appendLine(" linter hasSyntaxError: " + linter.hasSyntaxError()); - //if(linter.hasSyntaxError()+linter.hasSyntaxError()) throw new Error("XQuery syntax error") - const ast = linter.getAST() - const formatter = new (CodeFormatter as any)(ast); - const formatted = formatter.format().trim(); - channel.log("XQueryFormatter done"); - return formatted; -} -export class XQueryFormatter implements DocumentFormattingEditProvider, DocumentRangeFormattingEditProvider{ - provideDocumentFormattingEdits(document: TextDocument, options: FormattingOptions, token: CancellationToken): ProviderResult { - const lastLine = document.lineAt(document.lineCount - 1); - const documentRange = new Range(document.positionAt(0), lastLine.range.end); - return this.provideDocumentRangeFormattingEdits(document, documentRange, options, token); - } - - provideDocumentRangeFormattingEdits(document: TextDocument, range: Range, _options: FormattingOptions, _token: CancellationToken): ProviderResult { - const selected = document.getText(range); - const result = format(selected, document); - return [TextEdit.replace(range, result)]; - } -} diff --git a/src/linting/getAST.ts b/src/linting/getAST.ts deleted file mode 100644 index b792df9..0000000 --- a/src/linting/getAST.ts +++ /dev/null @@ -1,23 +0,0 @@ - -import { Range, TextEditor, Selection } from "vscode"; -import { channel } from "../common/logger"; -// eslint-disable-next-line @typescript-eslint/no-var-requires -const XQLint = require("@quodatum/xqlint").XQLint; - -export function getAst(textEditor: TextEditor): void { - textEditor.edit(textEdit => { - const selections = textEditor.selections; - selections.forEach(selection => { - if (selection.isEmpty) { - selection = new Selection( - textEditor.document.positionAt(0), - textEditor.document.positionAt(textEditor.document.getText().length) - ); - } - const text = textEditor.document.getText(new Range(selection.start, selection.end)); - const linter = new XQLint(text); - const ast=linter.getAST(); - channel.appendLine(ast); - }); - }); -} \ No newline at end of file diff --git a/src/linting/index.ts b/src/linting/index.ts index e7c5add..4ab4df0 100644 --- a/src/linting/index.ts +++ b/src/linting/index.ts @@ -1,2 +1 @@ export * from "./xquery-linter"; -export * from "./getAST"; diff --git a/src/symbols/symbols.ts b/src/symbols/symbols.ts deleted file mode 100644 index 62862c4..0000000 --- a/src/symbols/symbols.ts +++ /dev/null @@ -1,57 +0,0 @@ -/* eslint-disable @typescript-eslint/no-unused-vars */ -import { XQLint } from '@quodatum/xqlint'; -import {SymbolKind, DocumentSymbol, DocumentSymbolProvider, - Range, Position, TextDocument,CancellationToken} from 'vscode'; -import { channel } from "../common/logger"; -// -// This class handles Symbols -// -function makeSymbol(name: string, description: string, icon: SymbolKind, pos: any) { - const spos = new Position(pos.sl, pos.sc); - const epos = new Position(pos.el, pos.ec); - const fullrange = new Range(spos, epos); - const selrange = new Range(spos, spos); - return new DocumentSymbol(name, description, icon, fullrange, selrange); -} - -export class Symbols implements DocumentSymbolProvider { - provideDocumentSymbols = async ( - document: TextDocument, - token: CancellationToken - ): Promise => { - - channel.log("Symbols: " + document.uri); - const symbols: DocumentSymbol[] = []; - const text = document.getText(); - const linter = new (XQLint as any)(text, { "styleCheck": false }); - - const xqdoc = linter.getXQDoc(); - channel.log("got xqdoc"); - const prolog=new Range(0,0,0,0) - symbols.push(makeSymbol(xqdoc.moduleNamespace || "Main", xqdoc.description, SymbolKind.Module, prolog)) - - let vars=makeSymbol("Variables", "", SymbolKind.Variable, prolog) - vars.children=[] - // type: type, - // pos: pos, - // qname: qname, - // annotations: {} - xqdoc.variables.forEach(v => { - const name = v.name; - const info = makeSymbol(name, "", SymbolKind.Variable, v.pos) - vars.children.push(info); - }); - - const funs=makeSymbol("Variables", "", SymbolKind.Function, prolog) - funs.children=[] - xqdoc.functions.forEach(v => { - const name = v.name +"#" + v.params.length; - const info = makeSymbol(name, "", SymbolKind.Function, v.pos) - funs.children.push(info); - }); - symbols.push(vars) - symbols.push(funs) - channel.log("Symbols done " + document.uri); - return symbols; - }; -} diff --git a/src/xquery-execution/child-process.ts b/src/xquery-execution/child-process.ts index 45db33d..161f963 100644 --- a/src/xquery-execution/child-process.ts +++ b/src/xquery-execution/child-process.ts @@ -1,4 +1,4 @@ -import child_process = require("child_process"); +const child_process = require("child_process"); export class ChildProcess { static async spawn(executable: string, args: string[]): Promise {