Skip to content

Commit

Permalink
XML Completion element apply generate invalid XML content
Browse files Browse the repository at this point in the history
  • Loading branch information
angelozerr authored and datho7561 committed Dec 2, 2022
1 parent eef51c1 commit 501b694
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
10 changes: 9 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": [
Expand Down Expand Up @@ -691,4 +699,4 @@
}
]
}
}
}
2 changes: 1 addition & 1 deletion src/client/xmlClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
3 changes: 2 additions & 1 deletion src/settings/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
};
Expand All @@ -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'])];

Expand Down

0 comments on commit 501b694

Please sign in to comment.