[mod] update libraries

This commit is contained in:
Andy Bunce 2022-01-27 22:14:54 +00:00
parent 95702e6355
commit 1ea5f9481f
5 changed files with 1527 additions and 2451 deletions

3914
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,15 @@
{ {
"name": "xml", "name": "xml",
"displayName": "XML Tools", "displayName": "XML Tools for BaseX",
"description": "XML Formatting, XQuery, and XPath Tools for Visual Studio Code", "description": "XML Formatting, XQuery, and XPath Tools for Visual Studio Code",
"version": "2.5.1", "version": "2.5.2",
"preview": false, "preview": false,
"publisher": "DotJoshJohnson", "publisher": "quodatum",
"author": { "author": {
"name": "Josh Johnson", "name": "Andy Bunce",
"url": "https://github.com/DotJoshJohnson" "url": "https://github.com/DotJoshJohnson"
}, },
"license": "MIT",
"galleryBanner": { "galleryBanner": {
"color": "#FFFFFF", "color": "#FFFFFF",
"theme": "light" "theme": "light"
@ -23,7 +24,7 @@
"url": "https://github.com/DotJoshJohnson/vscode-xml/issues" "url": "https://github.com/DotJoshJohnson/vscode-xml/issues"
}, },
"engines": { "engines": {
"vscode": "^1.22.2" "vscode": "^1.63.0"
}, },
"categories": [ "categories": [
"Formatters", "Formatters",
@ -260,20 +261,25 @@
}, },
"scripts": { "scripts": {
"vscode:prepublish": "npm run compile", "vscode:prepublish": "npm run compile",
"compile": "npm run lint && tsc -p ./", "compile": "tsc -p ./",
"watch": "tsc -watch -p ./", "watch": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install", "pretest": "npm run compile && npm run lint",
"test": "npm run compile && mocha './out/test/**/*.js'", "lint": "eslint src --ext ts",
"test-windows": "npm run compile && mocha ./out/test/**/*.js", "test": "node ./out/test/runTest.js"
"lint": "tslint -p tslint.json --fix"
}, },
"devDependencies": { "devDependencies": {
"@types/mocha": "^2.2.42", "@types/vscode": "^1.63.0",
"@types/node": "^7.0.43", "@types/glob": "^7.2.0",
"@types/xmldom": "^0.1.29", "@types/mocha": "^9.0.0",
"tslint": "^5.9.1", "@types/node": "14.x",
"typescript": "^2.6.1", "@typescript-eslint/eslint-plugin": "^5.9.1",
"vscode": "^1.1.16" "@typescript-eslint/parser": "^5.9.1",
"@types/xmldom": "^0.1.13",
"eslint": "^8.6.0",
"glob": "^7.2.0",
"mocha": "^9.1.3",
"typescript": "^4.5.4",
"@vscode/test-electron": "^2.0.3"
}, },
"dependencies": { "dependencies": {
"xmldom": "^0.1.27", "xmldom": "^0.1.27",

View File

@ -2,6 +2,6 @@ import * as fs from "fs";
export class TestDataLoader { export class TestDataLoader {
static load(fileName: string): string { static load(fileName: string): string {
return fs.readFileSync(`${__dirname}/../../../src/test/test-data/${fileName}`, "UTF-8"); return fs.readFileSync(`${__dirname}/../../../src/test/test-data/${fileName}`, "utf-8");
} }
} }

View File

@ -33,7 +33,7 @@ export class XmlTreeDataProvider implements TreeDataProvider<any> {
return window.activeTextEditor || null; return window.activeTextEditor || null;
} }
getTreeItem(element: Node): TreeItem | Thenable<TreeItem> { getTreeItem(element: Element): TreeItem | Thenable<TreeItem> {
const enableMetadata = Configuration.enableXmlTreeViewMetadata; const enableMetadata = Configuration.enableXmlTreeViewMetadata;
const enableSync = Configuration.enableXmlTreeViewCursorSync; const enableSync = Configuration.enableXmlTreeViewCursorSync;
@ -60,9 +60,9 @@ export class XmlTreeDataProvider implements TreeDataProvider<any> {
treeItem.label += `children: ${childElements.length}, `; treeItem.label += `children: ${childElements.length}, `;
treeItem.collapsibleState = TreeItemCollapsibleState.Collapsed; treeItem.collapsibleState = TreeItemCollapsibleState.Collapsed;
} }
const label = treeItem.label as string;
treeItem.label = label.substr(0, label.length - 2) + ")";
treeItem.label = treeItem.label.substr(0, treeItem.label.length - 2);
treeItem.label += ")";
} }
if (this._xmlTraverser.hasSimilarSiblings(<Element>element) && enableSync) { if (this._xmlTraverser.hasSimilarSiblings(<Element>element) && enableSync) {
@ -134,7 +134,7 @@ export class XmlTreeDataProvider implements TreeDataProvider<any> {
NativeCommands.setContext(constants.contextKeys.xmlTreeViewEnabled, false); NativeCommands.setContext(constants.contextKeys.xmlTreeViewEnabled, false);
this._xmlDocument = null; this._xmlDocument = null;
this._onDidChangeTreeData.fire(); this._onDidChangeTreeData.fire(0);
return; return;
} }
@ -162,7 +162,7 @@ export class XmlTreeDataProvider implements TreeDataProvider<any> {
this._xmlTraverser.xmlDocument = this._xmlDocument; this._xmlTraverser.xmlDocument = this._xmlDocument;
} }
this._onDidChangeTreeData.fire(); this._onDidChangeTreeData.fire(0);
} }
} }

View File

@ -108,12 +108,14 @@ export async function executeXQuery(editor: TextEditor, edit: TextEditorEdit): P
await ChildProcess.spawn(executable, args); await ChildProcess.spawn(executable, args);
} }
catch (error) { catch (error ) {
if (error.message.search(/[Ll]ine:?\s*\d+/gm) > -1) { let message = "Unknown Error";
const match: RegExpExecArray = /[Ll]ine:?\s*\d+/gm.exec(error.message); if (error instanceof Error) { message = error.message; }
const line: number = (Number.parseInt(match[0].replace(/([Ll]ine:?\s*)|\s/, "")) - 1); if (message.search(/[Ll]ine:?\s*\d+/gm) > -1) {
const match: RegExpExecArray = /[Ll]ine:?\s*\d+/gm.exec(message);
const line: number = (Number.parseInt(match[0].replace(/([Ll]ine:?\s*)|\s/, ""), 10) - 1);
const selection: string = await window.showErrorMessage(error.message, `Go to Line ${line}`); const selection: string = await window.showErrorMessage(message, `Go to Line ${line}`);
if (selection === `Go to Line ${line}`) { if (selection === `Go to Line ${line}`) {
editor.revealRange(new Range(line, 0, line, 0)); editor.revealRange(new Range(line, 0, line, 0));
@ -121,7 +123,7 @@ export async function executeXQuery(editor: TextEditor, edit: TextEditorEdit): P
} }
else { else {
window.showErrorMessage(error.message); window.showErrorMessage(message);
} }
} }