mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
Merge from vscode 0fde6619172c9f04c41f2e816479e432cc974b8b (#5199)
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user