mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
remove editor options from context service
This commit is contained in:
parent
7d9506c48a
commit
1ee0c147db
|
@ -9,11 +9,10 @@ import {TPromise} from 'vs/base/common/winjs.base';
|
|||
import {Dimension, Builder} from 'vs/base/browser/builder';
|
||||
import objects = require('vs/base/common/objects');
|
||||
import {CodeEditorWidget} from 'vs/editor/browser/widget/codeEditorWidget';
|
||||
import {EventType as WorkbenchEventType} from 'vs/workbench/common/events';
|
||||
import {EditorInput, EditorOptions} from 'vs/workbench/common/editor';
|
||||
import {BaseEditor} from 'vs/workbench/browser/parts/editor/baseEditor';
|
||||
import {EditorConfiguration} from 'vs/editor/common/config/commonEditorConfig';
|
||||
import {IEditor, EventType, IEditorOptions} from 'vs/editor/common/editorCommon';
|
||||
import {IEditor, IEditorOptions} from 'vs/editor/common/editorCommon';
|
||||
import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService';
|
||||
import {IFilesConfiguration} from 'vs/platform/files/common/files';
|
||||
import {Position} from 'vs/platform/editor/common/editor';
|
||||
|
@ -52,9 +51,7 @@ export abstract class BaseTextEditor extends BaseEditor {
|
|||
) {
|
||||
super(id, telemetryService);
|
||||
|
||||
this.toUnbind.push(this._eventService.addListener2(WorkbenchEventType.WORKBENCH_OPTIONS_CHANGED, _ => this.handleConfigurationChangeEvent()));
|
||||
this.toUnbind.push(this.configurationService.onDidUpdateConfiguration(e => this.handleConfigurationChangeEvent(e.config)));
|
||||
|
||||
this.toUnbind.push(_themeService.onDidColorThemeChange(_ => this.handleConfigurationChangeEvent()));
|
||||
}
|
||||
|
||||
|
@ -106,15 +103,12 @@ export abstract class BaseTextEditor extends BaseEditor {
|
|||
}
|
||||
|
||||
protected getCodeEditorOptions(): IEditorOptions {
|
||||
let baseOptions: IEditorOptions = {
|
||||
return {
|
||||
overviewRulerLanes: 3,
|
||||
glyphMargin: true,
|
||||
lineNumbersMinChars: 3,
|
||||
theme: this._themeService.getColorTheme()
|
||||
};
|
||||
|
||||
// Always mixin editor options from the context into our set to allow for override
|
||||
return objects.mixin(baseOptions, this.contextService.getOptions().editor);
|
||||
}
|
||||
|
||||
public get eventService(): IEventService {
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
'use strict';
|
||||
|
||||
import {IEditorOptions} from 'vs/editor/common/editorCommon';
|
||||
import {IResourceInput} from 'vs/platform/editor/common/editor';
|
||||
import {IUserFriendlyKeybinding} from 'vs/platform/keybinding/common/keybinding';
|
||||
|
||||
|
@ -36,11 +35,6 @@ export interface IOptions {
|
|||
*/
|
||||
extensionsToInstall?: string[];
|
||||
|
||||
/**
|
||||
* Editor options to be used for any editor in the workbench.
|
||||
*/
|
||||
editor?: IEditorOptions;
|
||||
|
||||
/**
|
||||
* The global application settings if any.
|
||||
*/
|
||||
|
|
|
@ -17,10 +17,10 @@ import editorcommon = require('vs/editor/common/editorCommon');
|
|||
import {DebugHoverWidget} from 'vs/workbench/parts/debug/electron-browser/debugHover';
|
||||
import debugactions = require('vs/workbench/parts/debug/browser/debugActions');
|
||||
import debug = require('vs/workbench/parts/debug/common/debug');
|
||||
import {IWorkspaceContextService} from 'vs/workbench/services/workspace/common/contextService';
|
||||
import {IInstantiationService} from 'vs/platform/instantiation/common/instantiation';
|
||||
import {IContextMenuService} from 'vs/platform/contextview/browser/contextView';
|
||||
import {Range} from 'vs/editor/common/core/range';
|
||||
import {ICodeEditorService} from 'vs/editor/common/services/codeEditorService';
|
||||
|
||||
const HOVER_DELAY = 300;
|
||||
|
||||
|
@ -41,9 +41,9 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
|
|||
constructor(
|
||||
private editor: editorbrowser.ICodeEditor,
|
||||
@debug.IDebugService private debugService: debug.IDebugService,
|
||||
@IWorkspaceContextService private contextService: IWorkspaceContextService,
|
||||
@IContextMenuService private contextMenuService: IContextMenuService,
|
||||
@IInstantiationService private instantiationService: IInstantiationService
|
||||
@IInstantiationService private instantiationService: IInstantiationService,
|
||||
@ICodeEditorService private codeEditorService: ICodeEditorService
|
||||
) {
|
||||
this.breakpointHintDecoration = [];
|
||||
this.hoverWidget = new DebugHoverWidget(this.editor, this.debugService, this.instantiationService);
|
||||
|
@ -165,8 +165,8 @@ export class DebugEditorContribution implements debug.IDebugEditorContribution {
|
|||
if (state !== debug.State.Stopped) {
|
||||
this.hideHoverWidget();
|
||||
}
|
||||
this.contextService.updateOptions('editor', {
|
||||
hover: state !== debug.State.Stopped
|
||||
this.codeEditorService.listCodeEditors().forEach(e => {
|
||||
e.updateOptions({ hover: state !== debug.State.Stopped });
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -652,9 +652,6 @@ export class DebugService implements debug.IDebugService {
|
|||
this.partService.addClass('debugging');
|
||||
}
|
||||
this.extensionService.activateByEvent(`onDebug:${configuration.type}`).done(null, errors.onUnexpectedError);
|
||||
this.contextService.updateOptions('editor', {
|
||||
glyphMargin: true
|
||||
});
|
||||
this.inDebugMode.set(true);
|
||||
this.lazyTransitionToRunningState();
|
||||
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
|
||||
import 'vs/css!./../browser/media/repl';
|
||||
import nls = require('vs/nls');
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
import {TPromise} from 'vs/base/common/winjs.base';
|
||||
import errors = require('vs/base/common/errors');
|
||||
import lifecycle = require('vs/base/common/lifecycle');
|
||||
|
@ -213,7 +212,7 @@ export class Repl extends Panel {
|
|||
}
|
||||
|
||||
private getReplInputOptions(): IEditorOptions {
|
||||
let baseOptions: IEditorOptions = {
|
||||
return {
|
||||
overviewRulerLanes: 0,
|
||||
glyphMargin: false,
|
||||
lineNumbers: false,
|
||||
|
@ -229,9 +228,6 @@ export class Repl extends Panel {
|
|||
lineHeight: 21,
|
||||
theme: this.themeService.getColorTheme()
|
||||
};
|
||||
|
||||
// Always mixin editor options from the context into our set to allow for override
|
||||
return objects.mixin(baseOptions, this.contextService.getOptions().editor);
|
||||
}
|
||||
|
||||
public dispose(): void {
|
||||
|
|
Loading…
Reference in a new issue