Update configuration options.

This commit is contained in:
CismonX 2021-04-29 20:17:49 +08:00
parent c0f1a64ab8
commit c09d267d66
Signed by: cismonx
GPG Key ID: 3094873E29A482FB
4 changed files with 15 additions and 15 deletions

View File

@ -154,6 +154,11 @@
"default": true, "default": true,
"description": "When snippet is enabled, hide the snippets' corresponding commands from completion items." "description": "When snippet is enabled, hide the snippets' corresponding commands from completion items."
}, },
"texinfo.diagnosis.noWarnings": {
"type": "boolean",
"default": false,
"description": "Do not show warnings in diagnosis."
},
"texinfo.enableCodeLens": { "texinfo.enableCodeLens": {
"type": "boolean", "type": "boolean",
"default": true, "default": true,
@ -202,11 +207,6 @@
"default": false, "default": false,
"description": "Supress node cross-reference validation." "description": "Supress node cross-reference validation."
}, },
"texinfo.preview.noWarnings": {
"type": "boolean",
"default": false,
"description": "Suppress warnings."
},
"texinfo.preview.variables": { "texinfo.preview.variables": {
"type": "array", "type": "array",
"default": [], "default": [],

View File

@ -102,9 +102,11 @@ export default class ContextMapping implements vscode.Disposable {
const document = editor.document; const document = editor.document;
// Only show preview for saved files, as we're not gonna send document content to `makeinfo` via STDIN. // Only show preview for saved files, as we're not gonna send document content to `makeinfo` via STDIN.
// Instead, the file will be loaded from disk. // Instead, the file will be loaded from disk.
if (document.isUntitled) { if (document.isUntitled && !await prompt('Save this document to display preview.', 'Save')) {
if (!await prompt('Save this document to display preview.', 'Save')) return; return;
if (!await document.save()) return; }
if (document.isDirty && !await document.save()) {
return;
} }
this.getDocumentContext(document).initPreview().show(); this.getDocumentContext(document).initPreview().show();
} }

View File

@ -36,6 +36,10 @@ export default class Options {
return this.getBoolean('completion.hideSnippetCommands'); return this.getBoolean('completion.hideSnippetCommands');
} }
get noWarnings() {
return this.getBoolean('diagnosis.noWarnings');
}
get enableCodeLens() { get enableCodeLens() {
return this.getBoolean('enableCodeLens'); return this.getBoolean('enableCodeLens');
} }
@ -72,10 +76,6 @@ export default class Options {
return this.getBoolean('preview.noValidation'); return this.getBoolean('preview.noValidation');
} }
get noWarnings() {
return this.getBoolean('preview.noWarnings');
}
get variables() { get variables() {
return this.getArray('preview.variables'); return this.getArray('preview.variables');
} }

View File

@ -39,9 +39,7 @@ export default class Converter {
this.options.noNumberSections && options.push('--no-number-sections'); this.options.noNumberSections && options.push('--no-number-sections');
this.options.noValidation && options.push('--no-validate'); this.options.noValidation && options.push('--no-validate');
this.options.noWarnings && options.push('--no-warn'); this.options.noWarnings && options.push('--no-warn');
if (insertScript !== undefined) { insertScript !== undefined && options.push('-c', `EXTRA_HEAD <script>${insertScript}</script>`);
options.push('--set-customization-variable', `EXTRA_HEAD <script>${insertScript}</script>`);
}
this.addIncludePaths(this.options.includePaths, options); this.addIncludePaths(this.options.includePaths, options);
this.defineVariables(this.options.variables, options); this.defineVariables(this.options.variables, options);
this.includeCustomCSS(this.options.customCSS, options); this.includeCustomCSS(this.options.customCSS, options);