mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Fix issues with getting settings
This commit is contained in:
parent
0a4e82fbbd
commit
e63b4731ef
|
@ -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);
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue