提交 b0a7b57d 编写于 作者: S Sandeep Somavarapu

Rename IConfigurationService onDidUpdateConfiguration to onDidChangeConfiguration

上级 7d3ee8ab
......@@ -136,7 +136,7 @@ export class CodeMenu {
});
// Update when auto save config changes
this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IConfiguration>(), true /* update menu if changed */));
this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IConfiguration>(), true /* update menu if changed */));
// Listen to update service
this.updateService.onStateChange(() => this.updateMenu());
......
......@@ -409,7 +409,7 @@ export class CodeWindow implements ICodeWindow {
}
// Handle configuration changes
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated()));
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated()));
// Handle Workspace events
this.toDispose.push(this.workspaceService.onUntitledWorkspaceDeleted(e => this.onUntitledWorkspaceDeleted(e)));
......
......@@ -224,7 +224,7 @@ export class ModelServiceImpl implements IModelService {
this._markerServiceSubscription = this._markerService.onMarkerChanged(this._handleMarkerChange, this);
}
this._configurationServiceSubscription = this._configurationService.onDidUpdateConfiguration(e => this._updateModelOptions());
this._configurationServiceSubscription = this._configurationService.onDidChangeConfiguration(e => this._updateModelOptions());
this._updateModelOptions();
}
......
......@@ -7,6 +7,7 @@ import Event from 'vs/base/common/event';
import URI from 'vs/base/common/uri';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { IPosition } from 'vs/editor/common/core/position';
import { IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
export const ITextResourceConfigurationService = createDecorator<ITextResourceConfigurationService>('textResourceConfigurationService');
......@@ -17,7 +18,7 @@ export interface ITextResourceConfigurationService {
/**
* Event that fires when the configuration changes.
*/
onDidUpdateConfiguration: Event<void>;
onDidChangeConfiguration: Event<IConfigurationChangeEvent>;
/**
* Fetches the appropriate section of the for the given resource with appropriate overrides (e.g. language).
......
......@@ -6,7 +6,7 @@
import Event, { Emitter } from 'vs/base/common/event';
import { Disposable } from 'vs/base/common/lifecycle';
import URI from 'vs/base/common/uri';
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/resourceConfiguration';
import { IPosition, Position } from 'vs/editor/common/core/position';
import { IModeService } from 'vs/editor/common/services/modeService';
......@@ -16,8 +16,8 @@ export class TextResourceConfigurationService extends Disposable implements ITex
public _serviceBrand: any;
private readonly _onDidUpdateConfiguration: Emitter<void> = this._register(new Emitter<void>());
public readonly onDidUpdateConfiguration: Event<void> = this._onDidUpdateConfiguration.event;
private readonly _onDidChangeConfiguration: Emitter<IConfigurationChangeEvent> = this._register(new Emitter<IConfigurationChangeEvent>());
public readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event;
constructor(
@IConfigurationService private configurationService: IConfigurationService,
......@@ -25,7 +25,7 @@ export class TextResourceConfigurationService extends Disposable implements ITex
@IModeService private modeService: IModeService,
) {
super();
this._register(this.configurationService.onDidUpdateConfiguration(() => this._onDidUpdateConfiguration.fire()));
this._register(this.configurationService.onDidChangeConfiguration(e => this._onDidChangeConfiguration.fire(e)));
}
getConfiguration<T>(resource: URI, section?: string): T
......
......@@ -445,8 +445,8 @@ export class SimpleConfigurationService implements IConfigurationService {
_serviceBrand: any;
private _onDidUpdateConfiguration = new Emitter<IConfigurationChangeEvent>();
public onDidUpdateConfiguration: Event<IConfigurationChangeEvent> = this._onDidUpdateConfiguration.event;
private _onDidChangeConfiguration = new Emitter<IConfigurationChangeEvent>();
public onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event;
private _configuration: Configuration;
......@@ -503,12 +503,12 @@ export class SimpleResourceConfigurationService implements ITextResourceConfigur
_serviceBrand: any;
public readonly onDidUpdateConfiguration: Event<void>;
private readonly _onDidUpdateConfigurationEmitter = new Emitter();
public readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent>;
private readonly _onDidChangeConfigurationEmitter = new Emitter();
constructor(private configurationService: SimpleConfigurationService) {
this.configurationService.onDidUpdateConfiguration(() => {
this._onDidUpdateConfigurationEmitter.fire();
this.configurationService.onDidChangeConfiguration((e) => {
this._onDidChangeConfigurationEmitter.fire(e);
});
}
......
......@@ -48,7 +48,7 @@ export interface IConfigurationChangeEvent {
export interface IConfigurationService {
_serviceBrand: any;
onDidUpdateConfiguration: Event<IConfigurationChangeEvent>;
onDidChangeConfiguration: Event<IConfigurationChangeEvent>;
getConfigurationData(): IConfigurationData;
......
......@@ -24,8 +24,8 @@ export class ConfigurationService extends Disposable implements IConfigurationSe
private _configuration: Configuration;
private userConfigModelWatcher: ConfigWatcher<ConfigurationModel>;
private _onDidUpdateConfiguration: Emitter<IConfigurationChangeEvent> = this._register(new Emitter<IConfigurationChangeEvent>());
readonly onDidUpdateConfiguration: Event<IConfigurationChangeEvent> = this._onDidUpdateConfiguration.event;
private _onDidChangeConfiguration: Emitter<IConfigurationChangeEvent> = this._register(new Emitter<IConfigurationChangeEvent>());
readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event;
constructor(
@IEnvironmentService environmentService: IEnvironmentService
......@@ -128,7 +128,7 @@ export class ConfigurationService extends Disposable implements IConfigurationSe
}
private trigger(keys: string[], source: ConfigurationTarget): void {
this._onDidUpdateConfiguration.fire(new ConfigurationChangeEvent().change(keys).telemetryData(source, this.getTargetConfiguration(source)));
this._onDidChangeConfiguration.fire(new ConfigurationChangeEvent().change(keys).telemetryData(source, this.getTargetConfiguration(source)));
}
private getTargetConfiguration(target: ConfigurationTarget): any {
......
......@@ -52,7 +52,7 @@ export class TestConfigurationService extends EventEmitter implements IConfigura
return TPromise.as(null);
}
public onDidUpdateConfiguration() {
public onDidChangeConfiguration() {
return { dispose() { } };
}
......
......@@ -58,7 +58,7 @@ class ConfigAwareContextValuesContainer extends Context {
super(id, null);
this._emitter = emitter;
this._subscription = configurationService.onDidUpdateConfiguration(e => this._updateConfigurationContext(configurationService.getConfiguration()));
this._subscription = configurationService.onDidChangeConfiguration(e => this._updateConfigurationContext(configurationService.getConfiguration()));
this._updateConfigurationContext(configurationService.getConfiguration());
}
......
......@@ -29,7 +29,7 @@ export class RequestService implements IRequestService {
@IConfigurationService configurationService: IConfigurationService
) {
this.configure(configurationService.getConfiguration<IHTTPConfiguration>());
configurationService.onDidUpdateConfiguration(() => this.configure(configurationService.getConfiguration()), this, this.disposables);
configurationService.onDidChangeConfiguration(() => this.configure(configurationService.getConfiguration()), this, this.disposables);
}
private configure(config: IHTTPConfiguration) {
......
......@@ -64,7 +64,7 @@ export class TelemetryService implements ITelemetryService {
if (this._configurationService) {
this._updateUserOptIn();
this._configurationService.onDidUpdateConfiguration(this._updateUserOptIn, this, this._disposables);
this._configurationService.onDidChangeConfiguration(this._updateUserOptIn, this, this._disposables);
/* __GDPR__
"optInStatus" : {
"optIn" : { "classification": "SystemMetaData", "purpose": "BusinessInsight" }
......
......@@ -185,7 +185,7 @@ const configurationValueWhitelist = [
];
export function configurationTelemetry(telemetryService: ITelemetryService, configurationService: IConfigurationService): IDisposable {
return configurationService.onDidUpdateConfiguration(event => {
return configurationService.onDidChangeConfiguration(event => {
if (event.source !== ConfigurationTarget.DEFAULT) {
/* __GDPR__
"updateConfiguration" : {
......
......@@ -697,7 +697,7 @@ suite('TelemetryService', () => {
};
},
keys() { return { default: [], user: [], workspace: [], workspaceFolder: [] }; },
onDidUpdateConfiguration: emitter.event,
onDidChangeConfiguration: emitter.event,
reloadConfiguration() { return null; },
getConfigurationData() { return null; }
});
......
......@@ -27,7 +27,7 @@ export class MainThreadConfiguration implements MainThreadConfigurationShape {
) {
const proxy = extHostContext.get(ExtHostContext.ExtHostConfiguration);
this._configurationListener = configurationService.onDidUpdateConfiguration(() => {
this._configurationListener = configurationService.onDidChangeConfiguration(() => {
proxy.$acceptConfigurationChanged(configurationService.getConfigurationData());
});
}
......
......@@ -65,7 +65,7 @@ export class ResourceLabel extends IconLabel {
private registerListeners(): void {
this.extensionService.onReady().then(() => this.render(true /* clear cache */)); // update when extensions are loaded with potentially new languages
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(() => this.render(true /* clear cache */))); // update when file.associations change
this.toDispose.push(this.configurationService.onDidChangeConfiguration(() => this.render(true /* clear cache */))); // update when file.associations change
this.toDispose.push(this.modelService.onModelModeChanged(e => this.onModelModeChanged(e))); // react to model mode changes
this.toDispose.push(this.decorationsService.onDidChangeDecorations(this.onFileDecorationsChanges, this)); // react to file decoration changes
this.toDispose.push(this.themeService.onThemeChange(() => this.render(false)));
......
......@@ -205,7 +205,7 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService
this.toUnbind.push(this.stacks.onEditorClosed(event => this.onEditorClosed(event)));
this.toUnbind.push(this.stacks.onGroupOpened(event => this.onEditorGroupOpenedOrClosed()));
this.toUnbind.push(this.stacks.onGroupClosed(event => this.onEditorGroupOpenedOrClosed()));
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IWorkbenchEditorConfiguration>())));
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IWorkbenchEditorConfiguration>())));
}
private onEditorGroupOpenedOrClosed(): void {
......
......@@ -66,7 +66,7 @@ export abstract class BaseTextEditor extends BaseEditor {
) {
super(id, telemetryService, themeService);
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.handleConfigurationChangeEvent(this.configurationService.getConfiguration<IEditorConfiguration>(this.getResource()))));
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.handleConfigurationChangeEvent(this.configurationService.getConfiguration<IEditorConfiguration>(this.getResource()))));
}
protected get instantiationService(): IInstantiationService {
......
......@@ -137,7 +137,7 @@ export class QuickOpenController extends Component implements IQuickOpenService
}
private registerListeners(): void {
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.updateConfiguration(this.configurationService.getConfiguration<IWorkbenchQuickOpenConfiguration>())));
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.updateConfiguration(this.configurationService.getConfiguration<IWorkbenchQuickOpenConfiguration>())));
this.toUnbind.push(this.partService.onTitleBarVisibilityChange(() => this.positionQuickOpenWidget()));
this.toUnbind.push(browser.onDidChangeZoomLevel(() => this.positionQuickOpenWidget()));
}
......
......@@ -99,7 +99,7 @@ export class TitlebarPart extends Part implements ITitleService {
private registerListeners(): void {
this.toUnbind.push(DOM.addDisposableListener(window, DOM.EventType.BLUR, () => this.onBlur()));
this.toUnbind.push(DOM.addDisposableListener(window, DOM.EventType.FOCUS, () => this.onFocus()));
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(() => this.onConfigurationChanged(true)));
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(() => this.onConfigurationChanged(true)));
this.toUnbind.push(this.editorGroupService.onEditorsChanged(() => this.onEditorsChanged()));
this.toUnbind.push(this.contextService.onDidChangeWorkspaceFolders(() => this.setTitle(this.getWindowTitle())));
this.toUnbind.push(this.contextService.onDidChangeWorkbenchState(() => this.setTitle(this.getWindowTitle())));
......
......@@ -110,7 +110,7 @@ export class EditorGroup implements IEditorGroup {
}
private registerListeners(): void {
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IWorkbenchEditorConfiguration>())));
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IWorkbenchEditorConfiguration>())));
}
private onConfigurationUpdated(config: IWorkbenchEditorConfiguration): void {
......
......@@ -94,7 +94,7 @@ export class UntitledEditorModel extends BaseTextEditorModel implements IEncodin
private registerListeners(): void {
// Config Changes
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange()));
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationChange()));
}
private onConfigurationChange(): void {
......
......@@ -95,7 +95,7 @@ export class ResourceGlobMatcher {
}
private registerListeners(): void {
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(() => this.updateExcludes(true)));
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(() => this.updateExcludes(true)));
this.toUnbind.push(this.contextService.onDidChangeWorkspaceFolders(() => this.updateExcludes(true)));
}
......
......@@ -240,7 +240,7 @@ export class ElectronWindow extends Themable {
});
// Configuration changes
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onDidUpdateConfiguration(e)));
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.onDidUpdateConfiguration(e)));
// Context menu support in input/textarea
window.document.addEventListener('contextmenu', e => this.onContextMenu(e));
......
......@@ -986,7 +986,7 @@ export class Workbench implements IPartService {
this.toDispose.push(this.quickOpen.onHide(() => (<WorkbenchMessageService>this.messageService).resume())); // resume messages once quick open is closed again
// Configuration changes
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(() => this.onDidUpdateConfiguration()));
this.toDispose.push(this.configurationService.onDidChangeConfiguration(() => this.onDidUpdateConfiguration()));
// Fullscreen changes
this.toDispose.push(browser.onDidChangeFullscreen(() => this.onFullscreenChanged()));
......
......@@ -50,7 +50,7 @@ export class BackupModelTracker implements IWorkbenchContribution {
this.toDispose.push(this.untitledEditorService.onDidDisposeModel((e) => this.discardBackup(e)));
// Listen to config changes
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration<IFilesConfiguration>())));
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration<IFilesConfiguration>())));
}
private onConfigurationChange(configuration: IFilesConfiguration): void {
......
......@@ -54,7 +54,7 @@ export class StartDebugActionItem extends EventEmitter implements IActionItem {
}
private registerListeners(): void {
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => {
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration('launch')) {
this.updateOptions();
}
......
......@@ -93,7 +93,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
private registerListeners(): void {
this.toUnbind.push(this.debugService.onDidChangeState(state => this.update(state)));
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(() => this.update(this.debugService.state)));
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(() => this.update(this.debugService.state)));
this.toUnbind.push(this.actionBar.actionRunner.addListener(EventType.RUN, (e: any) => {
// check for error
if (e.error && !errors.isPromiseCanceledError(e.error)) {
......
......@@ -323,7 +323,7 @@ export class ConfigurationManager implements IConfigurationManager {
this.initLaunches();
this.selectConfiguration();
}));
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(() => {
this.toDispose.push(this.configurationService.onDidChangeConfiguration(() => {
this.selectConfiguration();
}));
......
......@@ -709,7 +709,7 @@ export class ToggleAutoUpdateAction extends Action {
) {
super(id, label, '', true);
this.updateEnablement();
configurationService.onDidUpdateConfiguration(() => this.updateEnablement());
configurationService.onDidChangeConfiguration(() => this.updateEnablement());
}
private updateEnablement(): void {
......
......@@ -111,7 +111,7 @@ export class ExtensionsViewlet extends PersistentViewsViewlet implements IExtens
this.disposables.push(viewletService.onDidViewletOpen(this.onViewletOpen, this, this.disposables));
this.isAutoUpdateEnabled = this.extensionsWorkbenchService.isAutoUpdateEnabled;
this.configurationService.onDidUpdateConfiguration(() => {
this.configurationService.onDidChangeConfiguration(() => {
const isAutoUpdateEnabled = this.extensionsWorkbenchService.isAutoUpdateEnabled;
if (this.isAutoUpdateEnabled !== isAutoUpdateEnabled) {
this.isAutoUpdateEnabled = isAutoUpdateEnabled;
......
......@@ -347,7 +347,7 @@ export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService {
.on(this.onOpenExtensionUrl, this, this.disposables);
this._isAutoUpdateEnabled = this.configurationService.getConfiguration<IExtensionsConfiguration>(ConfigurationKey).autoUpdate;
this.configurationService.onDidUpdateConfiguration(() => {
this.configurationService.onDidChangeConfiguration(() => {
const isAutoUpdateEnabled = this.configurationService.getConfiguration<IExtensionsConfiguration>(ConfigurationKey).autoUpdate;
if (this._isAutoUpdateEnabled !== isAutoUpdateEnabled) {
this._isAutoUpdateEnabled = isAutoUpdateEnabled;
......
......@@ -62,7 +62,7 @@ export class ExplorerViewlet extends PersistentViewsViewlet {
this.registerViews();
this.onConfigurationUpdated();
this._register(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated()));
this._register(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated()));
this._register(this.contextService.onDidChangeWorkspaceName(e => this.updateTitleArea()));
this._register(this.contextService.onDidChangeWorkbenchState(() => this.registerViews()));
this._register(this.contextService.onDidChangeWorkspaceFolders(() => this.registerViews()));
......
......@@ -204,7 +204,7 @@ export class ExplorerView extends ViewsViewletPanel {
this.disposables.push(this.editorGroupService.onEditorsChanged(() => this.onEditorsChanged()));
// Also handle configuration updates
this.disposables.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IFilesConfiguration>(), e)));
this.disposables.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IFilesConfiguration>(), e)));
});
}
......
......@@ -568,7 +568,7 @@ export class FileSorter implements ISorter {
}
private registerListeners(): void {
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IFilesConfiguration>())));
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IFilesConfiguration>())));
}
private onConfigurationUpdated(configuration: IFilesConfiguration): void {
......@@ -769,7 +769,7 @@ export class FileDragAndDrop extends SimpleFileResourceDragAndDrop {
}
private registerListeners(): void {
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IFilesConfiguration>())));
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IFilesConfiguration>())));
}
private onConfigurationUpdated(config: IFilesConfiguration): void {
......
......@@ -183,7 +183,7 @@ export class OpenEditorsView extends ViewsViewletPanel {
this.disposables.push(this.model.onModelChanged(e => this.onEditorStacksModelChanged(e)));
// Also handle configuration updates
this.disposables.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IFilesConfiguration>())));
this.disposables.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IFilesConfiguration>())));
// Handle dirty counter
this.disposables.push(this.untitledEditorService.onDidChangeDirty(e => this.updateDirtyIndicator()));
......
......@@ -75,7 +75,7 @@ export class FileEditorTracker implements IWorkbenchContribution {
this.lifecycleService.onShutdown(this.dispose, this);
// Configuration
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IWorkbenchEditorConfiguration>())));
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationUpdated(this.configurationService.getConfiguration<IWorkbenchEditorConfiguration>())));
}
private onConfigurationUpdated(configuration: IWorkbenchEditorConfiguration): void {
......
......@@ -64,7 +64,7 @@ class MarkersFileDecorations implements IWorkbenchContribution {
) {
//
this._disposables = [
this._configurationService.onDidUpdateConfiguration(this._updateEnablement, this),
this._configurationService.onDidChangeConfiguration(this._updateEnablement, this),
];
this._updateEnablement();
}
......
......@@ -253,7 +253,7 @@ export class MarkersPanel extends Panel {
}
private createListeners(): void {
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationsUpdated(this.configurationService.getConfiguration<IProblemsConfiguration>())));
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationsUpdated(this.configurationService.getConfiguration<IProblemsConfiguration>())));
this.toUnbind.push(this.markerService.onMarkerChanged(this.onMarkerChanged, this));
this.toUnbind.push(this.editorGroupService.onEditorsChanged(this.onEditorsChanged, this));
this.toUnbind.push(this.tree.addListener('selection', () => this.onSelected()));
......
......@@ -950,7 +950,7 @@ class UnsupportedWorkspaceSettingsRenderer extends Disposable {
@IMarkerService private markerService: IMarkerService
) {
super();
this._register(this.configurationService.onDidUpdateConfiguration(() => this.render()));
this._register(this.configurationService.onDidChangeConfiguration(() => this.render()));
}
private getMarkerMessage(settingKey: string): string {
......
......@@ -38,7 +38,7 @@ export class PreferencesContribution implements IWorkbenchContribution {
@IWorkspaceContextService private workspaceService: IWorkspaceContextService,
@IConfigurationService private configurationService: IConfigurationService
) {
this.settingsListener = this.configurationService.onDidUpdateConfiguration(() => this.handleSettingsEditorOverride());
this.settingsListener = this.configurationService.onDidChangeConfiguration(() => this.handleSettingsEditorOverride());
this.handleSettingsEditorOverride();
this.start();
......
......@@ -95,7 +95,7 @@ class CommandsHistory {
}
private registerListeners(): void {
this.configurationService.onDidUpdateConfiguration(e => this.updateConfiguration());
this.configurationService.onDidChangeConfiguration(e => this.updateConfiguration());
once(this.lifecycleService.onShutdown)(reason => this.save());
}
......@@ -404,7 +404,7 @@ export class CommandsHandler extends QuickOpenHandler {
this.commandsHistory = this.instantiationService.createInstance(CommandsHistory);
this.configurationService.onDidUpdateConfiguration(e => this.updateConfiguration());
this.configurationService.onDidChangeConfiguration(e => this.updateConfiguration());
this.updateConfiguration();
}
......
......@@ -58,7 +58,7 @@ export class SettingsChangeRelauncher implements IWorkbenchContribution {
}
private registerListeners(): void {
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration<IConfiguration>(), true)));
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration<IConfiguration>(), true)));
this.toDispose.push(this.contextService.onDidChangeWorkbenchState(() => setTimeout(() => this.handleWorkbenchState())));
}
......
......@@ -90,7 +90,7 @@ export class FileDecorations implements IWorkbenchContribution {
@IConfigurationService private _configurationService: IConfigurationService,
@ISCMService private _scmService: ISCMService,
) {
this._configListener = this._configurationService.onDidUpdateConfiguration(e => e.affectsConfiguration('scm.fileDecorations.enabled') && this._update());
this._configListener = this._configurationService.onDidChangeConfiguration(e => e.affectsConfiguration('scm.fileDecorations.enabled') && this._update());
this._update();
}
......
......@@ -148,7 +148,7 @@ export class OpenAnythingHandler extends QuickOpenHandler {
}
private registerListeners(): void {
this.configurationService.onDidUpdateConfiguration(e => this.updateHandlers(this.configurationService.getConfiguration<IWorkbenchSearchConfiguration>()));
this.configurationService.onDidChangeConfiguration(e => this.updateHandlers(this.configurationService.getConfiguration<IWorkbenchSearchConfiguration>()));
}
private updateHandlers(configuration: IWorkbenchSearchConfiguration): void {
......
......@@ -620,7 +620,7 @@ class TaskService extends EventEmitter implements ITaskService {
this._taskSystemListeners = [];
this._outputChannel = this.outputService.getChannel(TaskService.OutputChannelId);
this._providers = new Map<number, ITaskProvider>();
this.configurationService.onDidUpdateConfiguration(() => {
this.configurationService.onDidChangeConfiguration(() => {
if (!this._taskSystem && !this._workspaceTasksPromise) {
return;
}
......
......@@ -59,7 +59,7 @@ export abstract class TerminalService implements ITerminalService {
this._onInstanceTitleChanged = new Emitter<string>();
this._onInstancesChanged = new Emitter<string>();
this._configurationService.onDidUpdateConfiguration(() => this.updateConfig());
this._configurationService.onDidChangeConfiguration(() => this.updateConfig());
lifecycleService.onWillShutdown(event => event.veto(this._onWillShutdown()));
this._terminalFocusContextKey = KEYBINDING_CONTEXT_TERMINAL_FOCUS.bindTo(this._contextKeyService);
this._findWidgetVisible = KEYBINDING_CONTEXT_TERMINAL_FIND_WIDGET_VISIBLE.bindTo(this._contextKeyService);
......
......@@ -74,7 +74,7 @@ export class TerminalPanel extends Panel {
this._terminalService.setContainers(this.getContainer().getHTMLElement(), this._terminalContainer);
this._register(this.themeService.onThemeChange(theme => this._updateTheme(theme)));
this._register(this._configurationService.onDidUpdateConfiguration(() => this._updateFont()));
this._register(this._configurationService.onDidChangeConfiguration(() => this._updateFont()));
this._updateFont();
this._updateTheme();
......
......@@ -23,7 +23,7 @@ class MockConfigurationService implements IConfigurationService {
public getValue<T>(key: string, overrides?: IConfigurationOverrides): T { return getConfigurationValue<T>(this.getConfiguration(), key); }
public updateValue<T>(): TPromise<void> { return null; }
public getConfigurationData(): any { return null; }
public onDidUpdateConfiguration() { return { dispose() { } }; }
public onDidChangeConfiguration() { return { dispose() { } }; }
public reloadConfiguration() { return null; }
}
......
......@@ -35,7 +35,7 @@ class UnsupportedWorkspaceSettingsContribution implements IWorkbenchContribution
@IStorageService private storageService: IStorageService
) {
lifecycleService.onShutdown(this.dispose, this);
this.toDispose.push(this.workspaceConfigurationService.onDidUpdateConfiguration(e => this.checkWorkspaceSettings()));
this.toDispose.push(this.workspaceConfigurationService.onDidChangeConfiguration(e => this.checkWorkspaceSettings()));
}
getId(): string {
......
......@@ -126,7 +126,7 @@ export class WatermarkContribution implements IWorkbenchContribution {
this.create();
}
});
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(e => {
this.toDispose.push(this.configurationService.onDidChangeConfiguration(e => {
if (e.affectsConfiguration(WORKBENCH_TIPS_ENABLED_KEY)) {
const enabled = this.configurationService.getValue<boolean>(WORKBENCH_TIPS_ENABLED_KEY);
if (enabled !== this.enabled) {
......
......@@ -401,7 +401,7 @@ export class WalkThroughPart extends BaseEditor {
}
}));
this.contentDisposables.push(this.configurationService.onDidUpdateConfiguration(() => {
this.contentDisposables.push(this.configurationService.onDidChangeConfiguration(() => {
if (snippet.textEditorModel) {
editor.updateOptions(this.getEditorOptions(snippet.textEditorModel.getModeId()));
}
......@@ -452,7 +452,7 @@ export class WalkThroughPart extends BaseEditor {
});
this.updateSizeClasses();
this.multiCursorModifier();
this.contentDisposables.push(this.configurationService.onDidUpdateConfiguration(() => this.multiCursorModifier()));
this.contentDisposables.push(this.configurationService.onDidChangeConfiguration(() => this.multiCursorModifier()));
if (input.onReady) {
input.onReady(innerContent);
}
......
......@@ -61,8 +61,8 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
private workspaceConfiguration: WorkspaceConfiguration;
private cachedFolderConfigs: StrictResourceMap<FolderConfiguration>;
protected readonly _onDidUpdateConfiguration: Emitter<IConfigurationChangeEvent> = this._register(new Emitter<IConfigurationChangeEvent>());
public readonly onDidUpdateConfiguration: Event<IConfigurationChangeEvent> = this._onDidUpdateConfiguration.event;
protected readonly _onDidChangeConfiguration: Emitter<IConfigurationChangeEvent> = this._register(new Emitter<IConfigurationChangeEvent>());
public readonly onDidChangeConfiguration: Event<IConfigurationChangeEvent> = this._onDidChangeConfiguration.event;
protected readonly _onDidChangeWorkspaceFolders: Emitter<IWorkspaceFoldersChangeEvent> = this._register(new Emitter<IWorkspaceFoldersChangeEvent>());
public readonly onDidChangeWorkspaceFolders: Event<IWorkspaceFoldersChangeEvent> = this._onDidChangeWorkspaceFolders.event;
......@@ -82,7 +82,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
this._register(this.workspaceConfiguration.onDidUpdateConfiguration(() => this.onWorkspaceConfigurationChanged()));
this.baseConfigurationService = this._register(new GlobalConfigurationService(environmentService));
this._register(this.baseConfigurationService.onDidUpdateConfiguration(e => this.onBaseConfigurationChanged(e)));
this._register(this.baseConfigurationService.onDidChangeConfiguration(e => this.onBaseConfigurationChanged(e)));
this._register(Registry.as<IConfigurationRegistry>(Extensions.Configuration).onDidRegisterConfiguration(e => this.registerConfigurationSchemas()));
}
......@@ -328,7 +328,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
// TODO Sandy: compare with old values??
const keys = this._configuration.keys();
this._onDidUpdateConfiguration.fire(new AllKeysConfigurationChangeEvent([...keys.default, ...keys.user, ...keys.workspace, ...keys.workspaceFolder], ConfigurationTarget.WORKSPACE, this.getTargetConfiguration(ConfigurationTarget.WORKSPACE)));
this._onDidChangeConfiguration.fire(new AllKeysConfigurationChangeEvent([...keys.default, ...keys.user, ...keys.workspace, ...keys.workspaceFolder], ConfigurationTarget.WORKSPACE, this.getTargetConfiguration(ConfigurationTarget.WORKSPACE)));
});
}
......@@ -520,7 +520,7 @@ export class WorkspaceService extends Disposable implements IWorkspaceConfigurat
private triggerConfigurationChange(configurationEvent: ConfigurationChangeEvent, target: ConfigurationTarget): void {
if (configurationEvent.affectedKeys.length) {
configurationEvent.telemetryData(target, this.getTargetConfiguration(target));
this._onDidUpdateConfiguration.fire(new WorkspaceConfigurationChangeEvent(configurationEvent, this.workspace));
this._onDidChangeConfiguration.fire(new WorkspaceConfigurationChangeEvent(configurationEvent, this.workspace));
}
}
......
......@@ -196,7 +196,7 @@ suite('WorkspaceConfigurationService - Node', () => {
fs.writeFileSync(globalSettingsFile, '{ "testworkbench.editor.tabs": true }');
return service.initialize(workspaceDir).then(() => {
service.onDidUpdateConfiguration(event => {
service.onDidChangeConfiguration(event => {
const config = service.getConfiguration<{ testworkbench: { editor: { tabs: boolean } } }>();
assert.equal(config.testworkbench.editor.tabs, false);
......@@ -279,7 +279,7 @@ suite('WorkspaceConfigurationService - Node', () => {
test('workspace change triggers event', (done: () => void) => {
createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => {
return createService(workspaceDir, globalSettingsFile).then(service => {
service.onDidUpdateConfiguration(event => {
service.onDidChangeConfiguration(event => {
const config = service.getConfiguration<{ testworkbench: { editor: { icons: boolean } } }>();
assert.equal(config.testworkbench.editor.icons, true);
assert.equal(service.getConfiguration<any>().testworkbench.editor.icons, true);
......@@ -305,7 +305,7 @@ suite('WorkspaceConfigurationService - Node', () => {
fs.writeFileSync(settingsFile, '{ "testworkbench.editor.icons": true }');
const target = sinon.stub();
service.onDidUpdateConfiguration(event => target());
service.onDidChangeConfiguration(event => target());
fs.writeFileSync(settingsFile, '{ "testworkbench.editor.icons": false }');
......@@ -327,7 +327,7 @@ suite('WorkspaceConfigurationService - Node', () => {
service.reloadWorkspaceConfiguration().done(() => {
const target = sinon.stub();
service.onDidUpdateConfiguration(event => target());
service.onDidChangeConfiguration(event => target());
service.reloadWorkspaceConfiguration().done(() => {
assert.ok(!target.called);
......@@ -344,7 +344,7 @@ suite('WorkspaceConfigurationService - Node', () => {
createWorkspace((workspaceDir, globalSettingsFile, cleanUp) => {
return createService(workspaceDir, globalSettingsFile).then(service => {
const target = sinon.stub();
service.onDidUpdateConfiguration(event => target());
service.onDidChangeConfiguration(event => target());
service.reloadUserConfiguration().done(() => {
assert.ok(!target.called);
service.dispose();
......
......@@ -354,7 +354,7 @@ class MockConfigurationService implements IConfigurationService {
public getValue(key: string): any { return getConfigurationValue<any>(this.getConfiguration(), key); }
public updateValue(): TPromise<void> { return null; }
public getConfigurationData(): any { return null; }
public onDidUpdateConfiguration() { return { dispose() { } }; }
public onDidChangeConfiguration() { return { dispose() { } }; }
public reloadConfiguration() { return null; }
}
......
......@@ -119,7 +119,7 @@ export class FileService implements IFileService {
this.toUnbind.push(this.raw.onAfterOperation(e => this._onAfterOperation.fire(e)));
// Config changes
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration<IFilesConfiguration>())));
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration<IFilesConfiguration>())));
// Root changes
this.toUnbind.push(this.contextService.onDidChangeWorkspaceFolders(() => this.onDidChangeWorkspaceFolders()));
......
......@@ -83,7 +83,7 @@ export class FileWatcher {
// Start watching
this.updateFolders();
this.toDispose.push(this.contextService.onDidChangeWorkspaceFolders(() => this.updateFolders()));
this.toDispose.push(this.configurationService.onDidUpdateConfiguration(() => this.updateFolders()));
this.toDispose.push(this.configurationService.onDidChangeConfiguration(() => this.updateFolders()));
return () => this.dispose();
}
......
......@@ -268,7 +268,7 @@ export class WorkbenchKeybindingService extends AbstractKeybindingService {
super(contextKeyService, commandService, telemetryService, messageService, statusBarService);
let dispatchConfig = getDispatchConfig(configurationService);
configurationService.onDidUpdateConfiguration((e) => {
configurationService.onDidChangeConfiguration((e) => {
let newDispatchConfig = getDispatchConfig(configurationService);
if (dispatchConfig === newDispatchConfig) {
return;
......
......@@ -123,7 +123,7 @@ export class WorkbenchModeServiceImpl extends ModeServiceImpl {
});
this._configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(this._configurationService.getConfiguration<IFilesConfiguration>()));
this._configurationService.onDidChangeConfiguration(e => this.onConfigurationChange(this._configurationService.getConfiguration<IFilesConfiguration>()));
this.onDidCreateMode((mode) => {
this._extensionService.activateByEvent(`onLanguage:${mode.getId()}`).done(null, onUnexpectedError);
......
......@@ -124,7 +124,7 @@ export abstract class TextFileService implements ITextFileService {
this.lifecycleService.onShutdown(this.dispose, this);
// Configuration changes
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration<IFilesConfiguration>())));
this.toUnbind.push(this.configurationService.onDidChangeConfiguration(e => this.onConfigurationChange(this.configurationService.getConfiguration<IFilesConfiguration>())));
}
private beforeShutdown(reason: ShutdownReason): boolean | TPromise<boolean> {
......
......@@ -235,7 +235,7 @@ export class WorkbenchThemeService implements IWorkbenchThemeService {
}
private installConfigurationListener() {
this.configurationService.onDidUpdateConfiguration(e => {
this.configurationService.onDidChangeConfiguration(e => {
let colorThemeSetting = this.configurationService.getValue<string>(COLOR_THEME_SETTING);
if (colorThemeSetting !== this.currentColorTheme.settingsId) {
this.colorThemeStore.findThemeDataBySettingsId(colorThemeSetting, null).then(theme => {
......
......@@ -1211,7 +1211,7 @@ export class TestTextResourceConfigurationService implements ITextResourceConfig
constructor(private configurationService = new TestConfigurationService()) {
}
public onDidUpdateConfiguration() {
public onDidChangeConfiguration() {
return { dispose() { } };
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册