提交 e63b4731 编写于 作者: D Denis Gladkikh

Fix issues with getting settings

上级 0a4e82fb
......@@ -194,7 +194,7 @@ class DefaultSettingsInput extends StringEditorInput {
public static getInstance(instantiationService: IInstantiationService, configurationService: IConfigurationService): DefaultSettingsInput {
if (!DefaultSettingsInput.INSTANCE) {
let editorConfig = configurationService.getConfiguration<any>();
let defaults = getDefaultValuesContent(editorConfig.insertSpaces ? strings.repeat(' ', editorConfig.tabSize) : '\t');
let defaults = getDefaultValuesContent(editorConfig.editor.insertSpaces ? strings.repeat(' ', editorConfig.editor.tabSize) : '\t');
let defaultsHeader = '// ' + nls.localize('defaultSettingsHeader', "Overwrite settings by placing them into your settings file.");
DefaultSettingsInput.INSTANCE = instantiationService.createInstance(DefaultSettingsInput, nls.localize('defaultName', "Default Settings"), null, defaultsHeader + '\n' + defaults, 'application/json', false);
......
......@@ -295,7 +295,7 @@ export class ConfigurationManager implements debug.IConfigurationManager {
configurations: adapter.initialConfigurations ? adapter.initialConfigurations : []
},
null,
editorConfig.insertSpaces ? strings.repeat(' ', editorConfig.tabSize) : '\t');
editorConfig.editor.insertSpaces ? strings.repeat(' ', editorConfig.editor.tabSize) : '\t');
});
});
}
......
......@@ -241,8 +241,8 @@ class ConfigureTaskRunnerAction extends Action {
}
return contentPromise.then(content => {
let editorConfig = this.configurationService.getConfiguration<any>();
if (editorConfig.insertSpaces) {
content = content.replace(/(\n)(\t+)/g, (_, s1, s2) => s1 + strings.repeat(' ', s2.length * editorConfig.tabSize));
if (editorConfig.editor.insertSpaces) {
content = content.replace(/(\n)(\t+)/g, (_, s1, s2) => s1 + strings.repeat(' ', s2.length * editorConfig.editor.tabSize));
}
return this.fileService.createFile(this.contextService.toResource('.vscode/tasks.json'), content);
});
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册