From 42e790d238baeb5295a2fd5015dbebd4981bdbd6 Mon Sep 17 00:00:00 2001 From: Denis Malinochkin Date: Sun, 25 Sep 2016 18:41:31 +0300 Subject: [PATCH] Fix work with empty settings --- src/extension.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 91734b4..42d521e 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -115,7 +115,11 @@ export function activate(context: vscode.ExtensionContext) { return; } - const remarkSettings = vscode.workspace.getConfiguration('remark').get('format'); + let remarkSettings = vscode.workspace.getConfiguration('remark').get('format'); + remarkSettings = Object.assign({ + plugins: [], + rules: [] + }, remarkSettings); if (remarkSettings.plugins.length !== 0) { return getPlugins(remarkSettings.plugins).then((plugins) => {