Skip to content

Commit

Permalink
Move default option values to editorOptions.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed May 8, 2017
1 parent b2091c5 commit ed52cdd
Show file tree
Hide file tree
Showing 16 changed files with 238 additions and 321 deletions.
5 changes: 2 additions & 3 deletions src/vs/editor/browser/widget/diffEditorWidget.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { ISashEvent, IVerticalSashLayoutProvider, Sash } from 'vs/base/browser/u
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { ICodeEditorService } from 'vs/editor/common/services/codeEditorService';
import { DefaultConfig } from 'vs/editor/common/config/defaultConfig';
import { Range, IRange } from 'vs/editor/common/core/range';
import * as editorCommon from 'vs/editor/common/editorCommon';
import { IEditorWorkerService } from 'vs/editor/common/services/editorWorkerService';
Expand Down Expand Up @@ -214,7 +213,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
this._domElement = domElement;
options = options || {};

this._theme = options.theme || DefaultConfig.editor.theme;
this._theme = options.theme || editorOptions.EDITOR_DEFAULTS.theme;
// renderSideBySide
this._renderSideBySide = true;
if (typeof options.renderSideBySide !== 'undefined') {
Expand Down Expand Up @@ -899,7 +898,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE

private _adjustOptionsForRightHandSide(options: editorOptions.IDiffEditorOptions): editorOptions.IEditorOptions {
let result = this._adjustOptionsForSubEditor(options);
result.revealHorizontalRightPadding = DefaultConfig.editor.revealHorizontalRightPadding + DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH;
result.revealHorizontalRightPadding = editorOptions.EDITOR_DEFAULTS.revealHorizontalRightPadding + DiffEditorWidget.ENTIRE_DIFF_OVERVIEW_WIDTH;
result.scrollbar.verticalHasArrows = false;
result.theme = this._theme + ' modified-in-monaco-diff-editor';
return result;
Expand Down
4 changes: 0 additions & 4 deletions src/vs/editor/common/commonCodeEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { ServicesAccessor, IInstantiationService } from 'vs/platform/instantiati
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
import { IContextKey, IContextKeyServiceTarget, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { CommonEditorConfiguration } from 'vs/editor/common/config/commonEditorConfig';
import { DefaultConfig } from 'vs/editor/common/config/defaultConfig';
import { Cursor } from 'vs/editor/common/controller/cursor';
import { CursorColumns, IViewModelHelper, ICursors } from 'vs/editor/common/controller/cursorCommon';
import { Position, IPosition } from 'vs/editor/common/core/position';
Expand Down Expand Up @@ -126,9 +125,6 @@ export abstract class CommonCodeEditor extends Disposable implements editorCommo
this._decorationTypeSubtypes = {};

options = options || {};
if (typeof options.ariaLabel === 'undefined') {
options.ariaLabel = DefaultConfig.editor.ariaLabel;
}
this._configuration = this._register(this._createConfiguration(options));
this._register(this._configuration.onDidChange((e) => {
this._onDidChangeConfiguration.fire(e);
Expand Down
114 changes: 58 additions & 56 deletions src/vs/editor/common/config/commonEditorConfig.ts

Large diffs are not rendered by default.

130 changes: 0 additions & 130 deletions src/vs/editor/common/config/defaultConfig.ts

This file was deleted.

0 comments on commit ed52cdd

Please sign in to comment.