提交 6e157467 编写于 作者: R Ramya Achutha Rao

Use copy of config object to avoid making changes to the readonly objects

上级 b18d4952
...@@ -309,7 +309,7 @@ export function sameNodes(node1: Node, node2: Node): boolean { ...@@ -309,7 +309,7 @@ export function sameNodes(node1: Node, node2: Node): boolean {
export function getEmmetConfiguration(syntax: string) { export function getEmmetConfiguration(syntax: string) {
const emmetConfig = vscode.workspace.getConfiguration('emmet'); const emmetConfig = vscode.workspace.getConfiguration('emmet');
const syntaxProfiles = Object.assign({}, emmetConfig['syntaxProfiles'] || {}); const syntaxProfiles = Object.assign({}, emmetConfig['syntaxProfiles'] || {});
const preferences = Object.assign({}, emmetConfig['preferences'] || {});
// jsx, xml and xsl syntaxes need to have self closing tags unless otherwise configured by user // jsx, xml and xsl syntaxes need to have self closing tags unless otherwise configured by user
if (syntax === 'jsx' || syntax === 'xml' || syntax === 'xsl') { if (syntax === 'jsx' || syntax === 'xml' || syntax === 'xsl') {
syntaxProfiles[syntax] = syntaxProfiles[syntax] || {}; syntaxProfiles[syntax] = syntaxProfiles[syntax] || {};
...@@ -322,7 +322,7 @@ export function getEmmetConfiguration(syntax: string) { ...@@ -322,7 +322,7 @@ export function getEmmetConfiguration(syntax: string) {
} }
return { return {
preferences: emmetConfig['preferences'], preferences,
showExpandedAbbreviation: emmetConfig['showExpandedAbbreviation'], showExpandedAbbreviation: emmetConfig['showExpandedAbbreviation'],
showAbbreviationSuggestions: emmetConfig['showAbbreviationSuggestions'], showAbbreviationSuggestions: emmetConfig['showAbbreviationSuggestions'],
syntaxProfiles, syntaxProfiles,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册