preferences.ts 2.0 KB
Newer Older
1 2 3 4 5 6 7
/*---------------------------------------------------------------------------------------------
 *  Copyright (c) Microsoft Corporation. All rights reserved.
 *  Licensed under the MIT License. See License.txt in the project root for license information.
 *--------------------------------------------------------------------------------------------*/

import { TPromise } from 'vs/base/common/winjs.base';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
S
Sandeep Somavarapu 已提交
8 9 10 11 12
import { IRange } from 'vs/editor/common/editorCommon';
import URI from 'vs/base/common/uri';
import { IConfigurationValue } from 'vs/workbench/services/configuration/common/configurationEditing';

export interface ISettingsGroup {
13
	range: IRange;
S
Sandeep Somavarapu 已提交
14
	title: string;
15
	titleRange: IRange;
S
Sandeep Somavarapu 已提交
16 17 18 19
	sections: ISettingsSection[];
}

export interface ISettingsSection {
20 21
	descriptionRange?: IRange;
	description?: string;
S
Sandeep Somavarapu 已提交
22 23 24 25
	settings: ISetting[];
}

export interface ISetting {
26
	range: IRange;
S
Sandeep Somavarapu 已提交
27 28
	key: string;
	value: any;
29 30
	valueRange: IRange;
	description: string;
S
Sandeep Somavarapu 已提交
31 32
}

33
export interface IPreferencesEditorModel {
S
Sandeep Somavarapu 已提交
34 35
	uri: URI;
	content: string;
36 37 38
}

export interface ISettingsEditorModel extends IPreferencesEditorModel {
39
	settingsGroups: ISettingsGroup[];
S
Sandeep Somavarapu 已提交
40 41
}

42
export interface IKeybindingsEditorModel extends IPreferencesEditorModel {
S
Sandeep Somavarapu 已提交
43
}
44

45
export const IPreferencesService = createDecorator<IPreferencesService>('preferencesService');
46

47
export interface IPreferencesService {
48 49
	_serviceBrand: any;

50 51 52 53
	getDefaultSettingsEditorModel(): TPromise<ISettingsEditorModel>;
	getUserSettingsEditorModel(): TPromise<ISettingsEditorModel>;
	getWorkspaceSettingsEditorModel(): TPromise<ISettingsEditorModel>;
	getDefaultKeybindingsEditorModel(): TPromise<IKeybindingsEditorModel>;
54 55

	resolvePreferencesEditorModel(uri: URI): TPromise<IPreferencesEditorModel>;
S
Sandeep Somavarapu 已提交
56

57 58 59
	openGlobalSettings(): TPromise<void>;
	openWorkspaceSettings(): TPromise<void>;
	openGlobalKeybindingSettings(): TPromise<void>;
S
Sandeep Somavarapu 已提交
60
	copyConfiguration(configurationValue: IConfigurationValue): void;
61
}