mirror of
https://github.com/Microsoft/vscode
synced 2024-08-28 13:29:44 +00:00
Fix #72385
This commit is contained in:
parent
b7f20a8b51
commit
059a3e1642
|
@ -137,7 +137,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
|
|||
}
|
||||
|
||||
if (this.defaultSettingsRawResource.toString() === uri.toString()) {
|
||||
const defaultRawSettingsEditorModel = this.instantiationService.createInstance(DefaultRawSettingsEditorModel, this.getDefaultSettings(ConfigurationTarget.USER));
|
||||
const defaultRawSettingsEditorModel = this.instantiationService.createInstance(DefaultRawSettingsEditorModel, this.getDefaultSettings(ConfigurationTarget.USER_LOCAL));
|
||||
const languageSelection = this.modeService.create('jsonc');
|
||||
const model = this._register(this.modelService.createModel(defaultRawSettingsEditorModel.content, languageSelection, uri));
|
||||
return Promise.resolve(model);
|
||||
|
@ -159,7 +159,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
|
|||
}
|
||||
|
||||
if (this.userSettingsResource.toString() === uri.toString()) {
|
||||
return this.createEditableSettingsEditorModel(ConfigurationTarget.USER, uri);
|
||||
return this.createEditableSettingsEditorModel(ConfigurationTarget.USER_LOCAL, uri);
|
||||
}
|
||||
|
||||
const workspaceSettingsUri = this.getEditableSettingsURI(ConfigurationTarget.WORKSPACE);
|
||||
|
@ -209,8 +209,8 @@ export class PreferencesService extends Disposable implements IPreferencesServic
|
|||
jsonEditor;
|
||||
|
||||
return jsonEditor ?
|
||||
this.openOrSwitchSettings(ConfigurationTarget.USER, this.userSettingsResource, options, group) :
|
||||
this.openOrSwitchSettings2(ConfigurationTarget.USER, undefined, options, group);
|
||||
this.openOrSwitchSettings(ConfigurationTarget.USER_LOCAL, this.userSettingsResource, options, group) :
|
||||
this.openOrSwitchSettings2(ConfigurationTarget.USER_LOCAL, undefined, options, group);
|
||||
}
|
||||
|
||||
async openRemoteSettings(): Promise<IEditor | null> {
|
||||
|
@ -377,7 +377,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
|
|||
}
|
||||
|
||||
public createSettings2EditorModel(): Settings2EditorModel {
|
||||
return this.instantiationService.createInstance(Settings2EditorModel, this.getDefaultSettings(ConfigurationTarget.USER));
|
||||
return this.instantiationService.createInstance(Settings2EditorModel, this.getDefaultSettings(ConfigurationTarget.USER_LOCAL));
|
||||
}
|
||||
|
||||
private doOpenSettings2(target: ConfigurationTarget, folderUri: URI | undefined, options?: IEditorOptions, group?: IEditorGroup): Promise<IEditor | null> {
|
||||
|
@ -419,7 +419,7 @@ export class PreferencesService extends Disposable implements IPreferencesServic
|
|||
|
||||
private getConfigurationTargetFromSettingsResource(resource: URI): ConfigurationTarget {
|
||||
if (this.userSettingsResource.toString() === resource.toString()) {
|
||||
return ConfigurationTarget.USER;
|
||||
return ConfigurationTarget.USER_LOCAL;
|
||||
}
|
||||
|
||||
const workspaceSettingsResource = this.workspaceSettingsResource;
|
||||
|
@ -432,11 +432,15 @@ export class PreferencesService extends Disposable implements IPreferencesServic
|
|||
return ConfigurationTarget.WORKSPACE_FOLDER;
|
||||
}
|
||||
|
||||
return ConfigurationTarget.USER;
|
||||
return ConfigurationTarget.USER_LOCAL;
|
||||
}
|
||||
|
||||
private getConfigurationTargetFromDefaultSettingsResource(uri: URI) {
|
||||
return this.isDefaultWorkspaceSettingsResource(uri) ? ConfigurationTarget.WORKSPACE : this.isDefaultFolderSettingsResource(uri) ? ConfigurationTarget.WORKSPACE_FOLDER : ConfigurationTarget.USER;
|
||||
return this.isDefaultWorkspaceSettingsResource(uri) ?
|
||||
ConfigurationTarget.WORKSPACE :
|
||||
this.isDefaultFolderSettingsResource(uri) ?
|
||||
ConfigurationTarget.WORKSPACE_FOLDER :
|
||||
ConfigurationTarget.USER_LOCAL;
|
||||
}
|
||||
|
||||
private isDefaultSettingsResource(uri: URI): boolean {
|
||||
|
|
Loading…
Reference in a new issue