diff --git a/src/vs/workbench/browser/parts/editor/textEditor.ts b/src/vs/workbench/browser/parts/editor/textEditor.ts index 6f1eb23cb441f96a5f82e7becf1ca903e2488e1b..882ea844b668bf58bc3ebb1b8742d218149cdb9c 100644 --- a/src/vs/workbench/browser/parts/editor/textEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textEditor.ts @@ -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 { diff --git a/src/vs/workbench/common/options.ts b/src/vs/workbench/common/options.ts index 14a7c16bd97e26fd8f6779be86a2151a4395d354..b0646576e84ef8d2447427d4753bc1cb76f70614 100644 --- a/src/vs/workbench/common/options.ts +++ b/src/vs/workbench/common/options.ts @@ -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. */ diff --git a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts index e94225ea382ab88c44fbcaba21b0e476eee76d88..e53c4eec774e22ac8db99d24b19cc62dbf883b93 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugEditorContribution.ts @@ -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 }); }); } diff --git a/src/vs/workbench/parts/debug/electron-browser/debugService.ts b/src/vs/workbench/parts/debug/electron-browser/debugService.ts index 6e1dd81fc0e359d53a87195d6ae8dee16bdcdbed..ca7b0fd096f2c52ce5324dd6dc38ec446bc296f3 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugService.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugService.ts @@ -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(); diff --git a/src/vs/workbench/parts/debug/electron-browser/repl.ts b/src/vs/workbench/parts/debug/electron-browser/repl.ts index ed947ca9f4ab70e6522164a6164412ee6f6bb0ce..04bae961b69ad24ea35b57be1fb34df5f616c0bd 100644 --- a/src/vs/workbench/parts/debug/electron-browser/repl.ts +++ b/src/vs/workbench/parts/debug/electron-browser/repl.ts @@ -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 {