Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ The following settings are supported:
* `xml.trace.server`: Trace the communication between VS Code and the XML language server in the Output view. Default is `off`.
* `xml.logs.client`: Enable/disable logging to the Output view. Default is `true`.
* [`xml.catalogs`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Preferences.md#catalogs): Register XML catalog files.
* `xml.downloadExternalResources.enabled`: Download external resources like referenced DTD, XSD. Default is `true`.
* [`xml.fileAssociations`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Preferences.md#file-associations): Allows XML schemas/ DTD to be associated to file name patterns.
* [`xml.format.enabled`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Formatting.md#xmlformatenabled): Enable/disable ability to format document. Default is `true`.
* [`xml.format.emptyElements`](https://github.com/redhat-developer/vscode-xml/blob/master/docs/Formatting.md#xmlformatemptyelements): Expand/collapse empty elements. Default is `ignore`.
Expand Down
26 changes: 16 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,12 @@
"default": true,
"markdownDescription": "Enable/disable logging to the Output view. Default is `true`."
},
"xml.downloadExternalResources.enabled": {
"type": "boolean",
"default": true,
"markdownDescription": "Download external resources like referenced DTD, XSD. Default is `true`.",
"scope": "window"
},
"xml.catalogs": {
"type": "array",
"default": [],
Expand Down Expand Up @@ -320,16 +326,6 @@
"default": false,
"markdownDescription": "The option to put a closing bracket on a newline when `#xml.format.splitAttributes#` is `true`. Default value is `false`. See [here](command:xml.open.docs?%5B%7B%22page%22%3A%22Formatting%22%2C%22section%22%3A%22xmlformatclosingbracketnewline%22%7D%5D) for more information."
},
"xml.preferences.quoteStyle": {
"type": "string",
"enum": [
"single",
"double"
],
"default": "double",
"markdownDescription": "Preferred quote style to use for completion: `single` quotes, `double` quotes. Default is `double`.",
"scope": "window"
},
"xml.completion.autoCloseTags": {
"type": "boolean",
"default": true,
Expand All @@ -347,6 +343,16 @@
"default": false,
"markdownDescription": "Enable/disable XML CodeLens. Default is `false`. See [here](command:xml.open.docs?%5B%7B%22page%22%3A%22CodeLens%22%2C%22section%22%3A%22Code%20Lens%22%7D%5D) for information about CodeLens features"
},
"xml.preferences.quoteStyle": {
"type": "string",
"enum": [
"single",
"double"
],
"default": "double",
"markdownDescription": "Preferred quote style to use for completion: `single` quotes, `double` quotes. Default is `double`.",
"scope": "window"
},
"xml.preferences.showSchemaDocumentationType": {
"type": "string",
"default": "all",
Expand Down
2 changes: 2 additions & 0 deletions src/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,10 @@ export function getXMLSettings(javaHome: string | undefined, logfile: string, ex
const isWorkspaceTrusted = (workspace as any).isTrusted;
if (isWorkspaceTrusted !== undefined && !isWorkspaceTrusted) {
xml['xml']['validation']['resolveExternalEntities'] = false;
xml['xml']['downloadExternalResources']['enabled'] = false;
} else {
xml['xml']['validation']['resolveExternalEntities'] = workspace.getConfiguration('xml').get('validation.resolveExternalEntities', false);
xml['xml']['downloadExternalResources']['enabled'] = workspace.getConfiguration('xml').get('downloadExternalResources.enabled', false);
}

//applying externalXmlSettings to the xmlSettings
Expand Down