update
This commit is contained in:
parent
9fb645a4d1
commit
d91cf96895
59
package.json
59
package.json
|
@ -13,6 +13,27 @@
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/texinfo-lang/vscode-texinfo"
|
"url": "https://github.com/texinfo-lang/vscode-texinfo"
|
||||||
},
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@types/node": "^14.11.2",
|
||||||
|
"@types/vscode": "^1.49.0",
|
||||||
|
"@typescript-eslint/eslint-plugin": "^3.8.0",
|
||||||
|
"@typescript-eslint/parser": "^3.8.0",
|
||||||
|
"eslint": "^7.10.0",
|
||||||
|
"typescript": "^4.0.3"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"cson": "^7.20.0",
|
||||||
|
"language-texinfo": "^1.0.0",
|
||||||
|
"node-html-parser": "^1.2.21"
|
||||||
|
},
|
||||||
|
"scripts": {
|
||||||
|
"vscode:prepublish": "npm run lint && npm run build",
|
||||||
|
"compile": "tsc -p ./",
|
||||||
|
"prepare": "sh ./scripts/prepare.sh",
|
||||||
|
"build": "npm run prepare && npm run compile",
|
||||||
|
"lint": "eslint --ext ts --fix src",
|
||||||
|
"watch": "tsc -watch -p ./"
|
||||||
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.49.0"
|
"vscode": "^1.49.0"
|
||||||
},
|
},
|
||||||
|
@ -30,11 +51,18 @@
|
||||||
"commands": [
|
"commands": [
|
||||||
{
|
{
|
||||||
"command": "texinfo.showPreview",
|
"command": "texinfo.showPreview",
|
||||||
"title": "Show preview (as HTML)",
|
"title": "Show preview",
|
||||||
"icon": "$(open-preview)"
|
"icon": "$(open-preview)"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"menus": {
|
"menus": {
|
||||||
|
"commandPalette": [
|
||||||
|
{
|
||||||
|
"command": "texinfo.showPreview",
|
||||||
|
"when": "editorLangId == texinfo",
|
||||||
|
"group": "navigation"
|
||||||
|
}
|
||||||
|
],
|
||||||
"editor/title": [
|
"editor/title": [
|
||||||
{
|
{
|
||||||
"command": "texinfo.showPreview",
|
"command": "texinfo.showPreview",
|
||||||
|
@ -43,6 +71,14 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"keybindings": [
|
||||||
|
{
|
||||||
|
"command": "texinfo.showPreview",
|
||||||
|
"key": "ctrl+k v",
|
||||||
|
"mac": "cmd+k v",
|
||||||
|
"when": "editorLangId == texinfo"
|
||||||
|
}
|
||||||
|
],
|
||||||
"configuration": {
|
"configuration": {
|
||||||
"title": "Texinfo",
|
"title": "Texinfo",
|
||||||
"properties": {
|
"properties": {
|
||||||
|
@ -110,26 +146,5 @@
|
||||||
"configuration": "./language-configuration.json"
|
"configuration": "./language-configuration.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
|
||||||
"scripts": {
|
|
||||||
"vscode:prepublish": "npm run lint && npm run build",
|
|
||||||
"compile": "tsc -p ./",
|
|
||||||
"prepare": "sh ./scripts/prepare.sh",
|
|
||||||
"build": "npm run prepare && npm run compile",
|
|
||||||
"lint": "eslint --ext ts --fix src",
|
|
||||||
"watch": "tsc -watch -p ./"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@types/node": "^14.11.2",
|
|
||||||
"@types/vscode": "^1.49.0",
|
|
||||||
"@typescript-eslint/eslint-plugin": "^3.8.0",
|
|
||||||
"@typescript-eslint/parser": "^3.8.0",
|
|
||||||
"eslint": "^7.10.0",
|
|
||||||
"typescript": "^4.0.3"
|
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"cson": "^7.20.0",
|
|
||||||
"language-texinfo": "^1.0.0",
|
|
||||||
"node-html-parser": "^1.2.21"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,8 +37,7 @@ export class Converter {
|
||||||
}
|
}
|
||||||
|
|
||||||
private async convert(path: string) {
|
private async convert(path: string) {
|
||||||
const makeinfo = Options.makeinfo;
|
|
||||||
const maxBuffer = Options.maxSize * 1024 * 1024;
|
const maxBuffer = Options.maxSize * 1024 * 1024;
|
||||||
return await utils.exec(makeinfo, this.options.concat(path), maxBuffer);
|
return await utils.exec(Options.makeinfo, this.options.concat(path), maxBuffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,13 +31,11 @@ export async function prompt(message: string, confirm: string) {
|
||||||
export function exec(path: string, args: string[], maxBuffer: number) {
|
export function exec(path: string, args: string[], maxBuffer: number) {
|
||||||
return new Promise<string | undefined>((resolve) => {
|
return new Promise<string | undefined>((resolve) => {
|
||||||
child_process.execFile(path, args, { maxBuffer: maxBuffer }, (error, stdout, stderr) => {
|
child_process.execFile(path, args, { maxBuffer: maxBuffer }, (error, stdout, stderr) => {
|
||||||
if (stderr) {
|
|
||||||
console.log(stderr);
|
|
||||||
}
|
|
||||||
if (error) {
|
if (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
resolve(undefined);
|
resolve(undefined);
|
||||||
} else {
|
} else {
|
||||||
|
stderr && console.log(stderr);
|
||||||
resolve(stdout);
|
resolve(stdout);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue