import { workspace, Uri } from "vscode"; const ExtensionTopLevelSection = "xmlTools"; export class Configuration { static get enableXmlTreeView(): boolean { return this._getForWindow("enableXmlTreeView"); } static get enableXmlTreeViewMetadata(): boolean { return this._getForWindow("enableXmlTreeViewMetadata"); } static get enableXmlTreeViewCursorSync(): boolean { return this._getForWindow("enableXmlTreeViewCursorSync"); } static get ignoreDefaultNamespace(): boolean { return this._getForWindow("ignoreDefaultNamespace"); } static get persistXPathQuery(): boolean { return this._getForWindow("persistXPathQuery"); } static get xmlFormatterImplementation(): string { return this._getForWindow("xmlFormatterImplementation"); } static get xqueryExecutionArguments(): string[] { return this._getForWindow("xqueryExecutionArguments"); } static get xqueryExecutionEngine(): string { return this._getForWindow("xqueryExecutionEngine"); } static get xqueryExecutionInputLimit(): number { return this._getForWindow("xqueryExecutionInputLimit"); } static get xqueryExecutionInputSearchPattern(): string { return this._getForWindow("xqueryExecutionInputSearchPattern"); } static enforcePrettySelfClosingTagOnFormat(resource: Uri): boolean { return this._getForResource("enforcePrettySelfClosingTagOnFormat", resource); } static removeCommentsOnMinify(resource: Uri): boolean { return this._getForResource("removeCommentsOnMinify", resource); } static splitAttributesOnFormat(resource: Uri): boolean { return this._getForResource("splitAttributesOnFormat", resource); } static splitXmlnsOnFormat(resource: Uri): boolean { return this._getForResource("splitXmlnsOnFormat", resource); } static preserveSpacesBetweenAttributes(resource: Uri): boolean { return this._getForResource("preserveSpacesBetweenAttributes", resource); } private static _getForResource(section: string, resource: Uri): T { return workspace.getConfiguration(ExtensionTopLevelSection, resource).get(section); } private static _getForWindow(section: string): T { return workspace.getConfiguration(ExtensionTopLevelSection).get(section); } }