From 501b694a396165061fbe9fa2e5e2baba65878a23 Mon Sep 17 00:00:00 2001 From: azerr Date: Mon, 21 Nov 2022 16:04:00 +0100 Subject: [PATCH] XML Completion element apply generate invalid XML content Fixes https://github.com/eclipse/lemminx/issues/1373 Signed-off-by: azerr --- package.json | 10 +++++++++- src/client/xmlClient.ts | 2 +- src/settings/settings.ts | 3 ++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 8ce43590..a94a7f64 100644 --- a/package.json +++ b/package.json @@ -643,6 +643,14 @@ "[xsl]": { "editor.autoClosingBrackets": "never", "files.trimFinalNewlines": true + }, + "[dtd]": { + "editor.autoClosingBrackets": "never", + "files.trimFinalNewlines": true + }, + "[svg]": { + "editor.autoClosingBrackets": "never", + "files.trimFinalNewlines": true } }, "commands": [ @@ -691,4 +699,4 @@ } ] } -} +} \ No newline at end of file diff --git a/src/client/xmlClient.ts b/src/client/xmlClient.ts index 435acdf0..78ce938f 100644 --- a/src/client/xmlClient.ts +++ b/src/client/xmlClient.ts @@ -148,7 +148,7 @@ function getLanguageClientOptions( errorHandler: new ClientErrorHandler('XML', context), synchronize: { //preferences starting with these will trigger didChangeConfiguration - configurationSection: ['xml', '[xml]', 'files.trimFinalNewlines', 'files.trimTrailingWhitespace', 'files.insertFinalNewline'] + configurationSection: ['xml', '[xml]', 'files.trimFinalNewlines', 'files.trimTrailingWhitespace', 'files.insertFinalNewline', 'editor.linkedEditing'] }, middleware: { workspace: { diff --git a/src/settings/settings.ts b/src/settings/settings.ts index 7ca3d5f4..1a3846cc 100644 --- a/src/settings/settings.ts +++ b/src/settings/settings.ts @@ -221,6 +221,7 @@ export function getXMLSettings(javaHome: string | undefined, logfile: string, ex xml['xml']['format']['trimFinalNewlines'] = workspace.getConfiguration('files').get('trimFinalNewlines', true); xml['xml']['format']['trimTrailingWhitespace'] = workspace.getConfiguration('files').get('trimTrailingWhitespace', false); xml['xml']['format']['insertFinalNewline'] = workspace.getConfiguration('files').get('insertFinalNewline', false); + xml['xml']['linkedEditingEnabled'] = workspace.getConfiguration('editor')['linkedEditing'] || false; xml['xml']['telemetry'] = { enabled: workspace.getConfiguration('redhat.telemetry').get('enabled', false) }; @@ -246,7 +247,7 @@ export function getXMLSettings(javaHome: string | undefined, logfile: string, ex xml['xml']['fileAssociations'].push(element); } }); - + // Apply variable substitutions for file associations xml['xml']['fileAssociations'] = [...getVariableSubstitutedAssociations(xml['xml']['fileAssociations'])];