mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 21:09:43 +00:00
Fix #16705
This commit is contained in:
parent
b4a3393aad
commit
c67602a819
|
@ -31,7 +31,11 @@
|
|||
"url": "vscode://schemas/keybindings"
|
||||
},
|
||||
{
|
||||
"fileMatch": "vscode://defaultsettings/settings.json",
|
||||
"fileMatch": "vscode://defaultsettings/settings.json#user",
|
||||
"url": "vscode://schemas/settings"
|
||||
},
|
||||
{
|
||||
"fileMatch": "vscode://defaultsettings/settings.json#workspace",
|
||||
"url": "vscode://schemas/settings"
|
||||
},
|
||||
{
|
||||
|
|
|
@ -197,6 +197,10 @@ export class PreferencesService extends Disposable implements IPreferencesServic
|
|||
return null;
|
||||
}
|
||||
|
||||
private getDefaultSettingsURI(configurationTarget: ConfigurationTarget): URI {
|
||||
return URI.from({ scheme: PreferencesService.DEFAULT_SETTINGS_URI.scheme, authority: PreferencesService.DEFAULT_SETTINGS_URI.authority, path: PreferencesService.DEFAULT_SETTINGS_URI.path, fragment: ConfigurationTarget.USER === configurationTarget ? 'user' : 'workspace' });
|
||||
}
|
||||
|
||||
private promptToOpenWorkspaceSettings() {
|
||||
this.choiceService.choose(Severity.Info, nls.localize('workspaceHasSettings', "The currently opened folder contains workspace settings that may override user settings"),
|
||||
[nls.localize('openWorkspaceSettings', "Open Workspace Settings"), nls.localize('neverShowAgain', "Don't show again"), nls.localize('close', "Close")]
|
||||
|
@ -219,8 +223,9 @@ export class PreferencesService extends Disposable implements IPreferencesServic
|
|||
const openDefaultSettings = !!this.configurationService.getConfiguration<IWorkbenchSettingsConfiguration>().workbench.settings.openDefaultSettings;
|
||||
if (openDefaultSettings) {
|
||||
const emptySettingsContents = this.getEmptyEditableSettingsContent(configurationTarget);
|
||||
const defaultSettingsResource = this.getDefaultSettingsURI(configurationTarget);
|
||||
const settingsResource = this.getEditableSettingsURI(configurationTarget);
|
||||
return this.openTwoEditors(this.instantiationService.createInstance(DefaultPreferencesEditorInput, PreferencesService.DEFAULT_SETTINGS_URI, true), settingsResource, emptySettingsContents).then(() => null);
|
||||
return this.openTwoEditors(this.instantiationService.createInstance(DefaultPreferencesEditorInput, defaultSettingsResource, true), settingsResource, emptySettingsContents).then(() => null);
|
||||
}
|
||||
return this.openEditableSettings(configurationTarget).then(() => null);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue