mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
Auto marking private fields readonly in vs/editor
Readonly helps with type guards and code comprehension
This commit is contained in:
parent
d14eab580e
commit
013501950e
|
@ -19,8 +19,8 @@ import { IAccessibilityService } from 'vs/platform/accessibility/common/accessib
|
|||
|
||||
class CSSBasedConfigurationCache {
|
||||
|
||||
private _keys: { [key: string]: BareFontInfo; };
|
||||
private _values: { [key: string]: FontInfo; };
|
||||
private readonly _keys: { [key: string]: BareFontInfo; };
|
||||
private readonly _values: { [key: string]: FontInfo; };
|
||||
|
||||
constructor() {
|
||||
this._keys = Object.create(null);
|
||||
|
|
|
@ -8,9 +8,9 @@ import { IDimension } from 'vs/editor/common/editorCommon';
|
|||
|
||||
export class ElementSizeObserver extends Disposable {
|
||||
|
||||
private referenceDomElement: HTMLElement | null;
|
||||
private readonly referenceDomElement: HTMLElement | null;
|
||||
private measureReferenceDomElementToken: any;
|
||||
private changeCallback: () => void;
|
||||
private readonly changeCallback: () => void;
|
||||
private width: number;
|
||||
private height: number;
|
||||
|
||||
|
|
|
@ -69,9 +69,9 @@ export class MouseHandler extends ViewEventHandler {
|
|||
protected viewController: ViewController;
|
||||
protected viewHelper: IPointerHandlerHelper;
|
||||
protected mouseTargetFactory: MouseTargetFactory;
|
||||
private _asyncFocus: RunOnceScheduler;
|
||||
private readonly _asyncFocus: RunOnceScheduler;
|
||||
|
||||
private _mouseDownOperation: MouseDownOperation;
|
||||
private readonly _mouseDownOperation: MouseDownOperation;
|
||||
private lastMouseLeaveTime: number;
|
||||
|
||||
constructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {
|
||||
|
|
|
@ -430,8 +430,8 @@ function createEmptyContentDataInLines(horizontalDistanceToText: number): IEmpty
|
|||
|
||||
export class MouseTargetFactory {
|
||||
|
||||
private _context: ViewContext;
|
||||
private _viewHelper: IPointerHandlerHelper;
|
||||
private readonly _context: ViewContext;
|
||||
private readonly _viewHelper: IPointerHandlerHelper;
|
||||
|
||||
constructor(context: ViewContext, viewHelper: IPointerHandlerHelper) {
|
||||
this._context = context;
|
||||
|
|
|
@ -220,7 +220,7 @@ class TouchHandler extends MouseHandler {
|
|||
}
|
||||
|
||||
export class PointerHandler implements IDisposable {
|
||||
private handler: MouseHandler;
|
||||
private readonly handler: MouseHandler;
|
||||
|
||||
constructor(context: ViewContext, viewController: ViewController, viewHelper: IPointerHandlerHelper) {
|
||||
if (window.navigator.msPointerEnabled) {
|
||||
|
|
|
@ -89,7 +89,7 @@ export interface EditorMouseEventMerger {
|
|||
|
||||
export class EditorMouseEventFactory {
|
||||
|
||||
private _editorViewDomNode: HTMLElement;
|
||||
private readonly _editorViewDomNode: HTMLElement;
|
||||
|
||||
constructor(editorViewDomNode: HTMLElement) {
|
||||
this._editorViewDomNode = editorViewDomNode;
|
||||
|
@ -133,8 +133,8 @@ export class EditorMouseEventFactory {
|
|||
|
||||
export class GlobalEditorMouseMoveMonitor extends Disposable {
|
||||
|
||||
private _editorViewDomNode: HTMLElement;
|
||||
private _globalMouseMoveMonitor: GlobalMouseMoveMonitor<EditorMouseEvent>;
|
||||
private readonly _editorViewDomNode: HTMLElement;
|
||||
private readonly _globalMouseMoveMonitor: GlobalMouseMoveMonitor<EditorMouseEvent>;
|
||||
private _keydownListener: IDisposable | null;
|
||||
|
||||
constructor(editorViewDomNode: HTMLElement) {
|
||||
|
|
|
@ -127,7 +127,7 @@ export abstract class EditorCommand extends Command {
|
|||
*/
|
||||
public static bindToContribution<T extends IEditorContribution>(controllerGetter: (editor: ICodeEditor) => T): EditorControllerCommand<T> {
|
||||
return class EditorControllerCommandImpl extends EditorCommand {
|
||||
private _callback: (controller: T, args: any) => void;
|
||||
private readonly _callback: (controller: T, args: any) => void;
|
||||
|
||||
constructor(opts: IContributionCommandOptions<T>) {
|
||||
super(opts);
|
||||
|
@ -320,9 +320,9 @@ class EditorContributionRegistry {
|
|||
|
||||
public static readonly INSTANCE = new EditorContributionRegistry();
|
||||
|
||||
private editorContributions: IEditorContributionCtor[];
|
||||
private editorActions: EditorAction[];
|
||||
private editorCommands: { [commandId: string]: EditorCommand; };
|
||||
private readonly editorContributions: IEditorContributionCtor[];
|
||||
private readonly editorActions: EditorAction[];
|
||||
private readonly editorCommands: { [commandId: string]: EditorCommand; };
|
||||
|
||||
constructor() {
|
||||
this.editorContributions = [];
|
||||
|
|
|
@ -31,8 +31,8 @@ export abstract class AbstractCodeEditorService extends Disposable implements IC
|
|||
public readonly onDidChangeTransientModelProperty: Event<ITextModel> = this._onDidChangeTransientModelProperty.event;
|
||||
|
||||
|
||||
private _codeEditors: { [editorId: string]: ICodeEditor; };
|
||||
private _diffEditors: { [editorId: string]: IDiffEditor; };
|
||||
private readonly _codeEditors: { [editorId: string]: ICodeEditor; };
|
||||
private readonly _diffEditors: { [editorId: string]: IDiffEditor; };
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
|
@ -93,7 +93,7 @@ export abstract class AbstractCodeEditorService extends Disposable implements IC
|
|||
abstract removeDecorationType(key: string): void;
|
||||
abstract resolveDecorationOptions(decorationTypeKey: string | undefined, writable: boolean): IModelDecorationOptions;
|
||||
|
||||
private _transientWatchers: { [uri: string]: ModelTransientSettingWatcher; } = {};
|
||||
private readonly _transientWatchers: { [uri: string]: ModelTransientSettingWatcher; } = {};
|
||||
|
||||
public setTransientModelProperty(model: ITextModel, key: string, value: any): void {
|
||||
const uri = model.uri.toString();
|
||||
|
|
|
@ -16,9 +16,9 @@ import { ITheme, IThemeService, ThemeColor } from 'vs/platform/theme/common/them
|
|||
|
||||
export abstract class CodeEditorServiceImpl extends AbstractCodeEditorService {
|
||||
|
||||
private _styleSheet: HTMLStyleElement;
|
||||
private _decorationOptionProviders: { [key: string]: IModelDecorationOptionsProvider };
|
||||
private _themeService: IThemeService;
|
||||
private readonly _styleSheet: HTMLStyleElement;
|
||||
private readonly _decorationOptionProviders: { [key: string]: IModelDecorationOptionsProvider };
|
||||
private readonly _themeService: IThemeService;
|
||||
|
||||
constructor(@IThemeService themeService: IThemeService, styleSheet = dom.createStyleSheet()) {
|
||||
super();
|
||||
|
@ -79,7 +79,7 @@ class DecorationSubTypeOptionsProvider implements IModelDecorationOptionsProvide
|
|||
|
||||
public refCount: number;
|
||||
|
||||
private _parentTypeKey: string | undefined;
|
||||
private readonly _parentTypeKey: string | undefined;
|
||||
private _beforeContentRules: DecorationCSSRules | null;
|
||||
private _afterContentRules: DecorationCSSRules | null;
|
||||
|
||||
|
@ -245,13 +245,13 @@ const _CSS_MAP: { [prop: string]: string; } = {
|
|||
class DecorationCSSRules {
|
||||
|
||||
private _theme: ITheme;
|
||||
private _className: string;
|
||||
private _unThemedSelector: string;
|
||||
private readonly _className: string;
|
||||
private readonly _unThemedSelector: string;
|
||||
private _hasContent: boolean;
|
||||
private _hasLetterSpacing: boolean;
|
||||
private _ruleType: ModelDecorationCSSRuleType;
|
||||
private readonly _ruleType: ModelDecorationCSSRuleType;
|
||||
private _themeListener: IDisposable | null;
|
||||
private _providerArgs: ProviderArguments;
|
||||
private readonly _providerArgs: ProviderArguments;
|
||||
private _usesThemeColors: boolean;
|
||||
|
||||
public constructor(ruleType: ModelDecorationCSSRuleType, providerArgs: ProviderArguments, themeService: IThemeService) {
|
||||
|
|
|
@ -63,11 +63,11 @@ const invalidFunc = () => { throw new Error(`Invalid change accessor`); };
|
|||
|
||||
export class View extends ViewEventHandler {
|
||||
|
||||
private eventDispatcher: ViewEventDispatcher;
|
||||
private readonly eventDispatcher: ViewEventDispatcher;
|
||||
|
||||
private _scrollbar: EditorScrollbar;
|
||||
private _context: ViewContext;
|
||||
private _cursor: Cursor;
|
||||
private readonly _context: ViewContext;
|
||||
private readonly _cursor: Cursor;
|
||||
|
||||
// The view lines
|
||||
private viewLines: ViewLines;
|
||||
|
|
|
@ -32,7 +32,7 @@ export class ViewOutgoingEvents extends Disposable {
|
|||
public onMouseDrag: EventCallback<IEditorMouseEvent> | null = null;
|
||||
public onMouseDrop: EventCallback<IPartialEditorMouseEvent> | null = null;
|
||||
|
||||
private _viewModel: IViewModel;
|
||||
private readonly _viewModel: IViewModel;
|
||||
|
||||
constructor(viewModel: IViewModel) {
|
||||
super();
|
||||
|
|
|
@ -139,8 +139,8 @@ export class ViewOverlays extends ViewPart implements IVisibleLinesHost<ViewOver
|
|||
|
||||
export class ViewOverlayLine implements IVisibleLine {
|
||||
|
||||
private _configuration: IConfiguration;
|
||||
private _dynamicOverlays: DynamicViewOverlay[];
|
||||
private readonly _configuration: IConfiguration;
|
||||
private readonly _dynamicOverlays: DynamicViewOverlay[];
|
||||
private _domNode: FastDomNode<HTMLElement> | null;
|
||||
private _renderedContent: string | null;
|
||||
private _lineHeight: number;
|
||||
|
|
|
@ -29,7 +29,7 @@ class Coordinate {
|
|||
|
||||
export class ViewContentWidgets extends ViewPart {
|
||||
|
||||
private _viewDomNode: FastDomNode<HTMLElement>;
|
||||
private readonly _viewDomNode: FastDomNode<HTMLElement>;
|
||||
private _widgets: { [key: string]: Widget; };
|
||||
|
||||
public domNode: FastDomNode<HTMLElement>;
|
||||
|
@ -180,7 +180,7 @@ class Widget {
|
|||
public readonly allowEditorOverflow: boolean;
|
||||
public readonly suppressMouseDown: boolean;
|
||||
|
||||
private _fixedOverflowWidgets: boolean;
|
||||
private readonly _fixedOverflowWidgets: boolean;
|
||||
private _contentWidth: number;
|
||||
private _contentLeft: number;
|
||||
private _lineHeight: number;
|
||||
|
|
|
@ -12,7 +12,7 @@ import * as viewEvents from 'vs/editor/common/view/viewEvents';
|
|||
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export class CurrentLineHighlightOverlay extends DynamicViewOverlay {
|
||||
private _context: ViewContext;
|
||||
private readonly _context: ViewContext;
|
||||
private _lineHeight: number;
|
||||
private _renderLineHighlight: 'none' | 'gutter' | 'line' | 'all';
|
||||
private _selectionIsEmpty: boolean;
|
||||
|
|
|
@ -12,7 +12,7 @@ import * as viewEvents from 'vs/editor/common/view/viewEvents';
|
|||
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
|
||||
|
||||
export class CurrentLineMarginHighlightOverlay extends DynamicViewOverlay {
|
||||
private _context: ViewContext;
|
||||
private readonly _context: ViewContext;
|
||||
private _lineHeight: number;
|
||||
private _renderLineHighlight: 'none' | 'gutter' | 'line' | 'all';
|
||||
private _selectionIsEmpty: boolean;
|
||||
|
|
|
@ -13,7 +13,7 @@ import { ViewModelDecoration } from 'vs/editor/common/viewModel/viewModel';
|
|||
|
||||
export class DecorationsOverlay extends DynamicViewOverlay {
|
||||
|
||||
private _context: ViewContext;
|
||||
private readonly _context: ViewContext;
|
||||
private _lineHeight: number;
|
||||
private _typicalHalfwidthCharacterWidth: number;
|
||||
private _renderResult: string[] | null;
|
||||
|
|
|
@ -17,8 +17,8 @@ import { getThemeTypeSelector } from 'vs/platform/theme/common/themeService';
|
|||
|
||||
export class EditorScrollbar extends ViewPart {
|
||||
|
||||
private scrollbar: SmoothScrollableElement;
|
||||
private scrollbarDomNode: FastDomNode<HTMLElement>;
|
||||
private readonly scrollbar: SmoothScrollableElement;
|
||||
private readonly scrollbarDomNode: FastDomNode<HTMLElement>;
|
||||
|
||||
constructor(
|
||||
context: ViewContext,
|
||||
|
|
|
@ -74,7 +74,7 @@ export abstract class DedupOverlay extends DynamicViewOverlay {
|
|||
|
||||
export class GlyphMarginOverlay extends DedupOverlay {
|
||||
|
||||
private _context: ViewContext;
|
||||
private readonly _context: ViewContext;
|
||||
private _lineHeight: number;
|
||||
private _glyphMargin: boolean;
|
||||
private _glyphMarginLeft: number;
|
||||
|
|
|
@ -14,7 +14,7 @@ import { registerThemingParticipant } from 'vs/platform/theme/common/themeServic
|
|||
|
||||
export class IndentGuidesOverlay extends DynamicViewOverlay {
|
||||
|
||||
private _context: ViewContext;
|
||||
private readonly _context: ViewContext;
|
||||
private _primaryLineNumber: number;
|
||||
private _lineHeight: number;
|
||||
private _spaceWidth: number;
|
||||
|
|
|
@ -18,7 +18,7 @@ export class LineNumbersOverlay extends DynamicViewOverlay {
|
|||
|
||||
public static readonly CLASS_NAME = 'line-numbers';
|
||||
|
||||
private _context: ViewContext;
|
||||
private readonly _context: ViewContext;
|
||||
|
||||
private _lineHeight: number;
|
||||
private _renderLineNumbers: RenderLineNumbersType;
|
||||
|
|
|
@ -398,7 +398,7 @@ class RenderedViewLine implements IRenderedViewLine {
|
|||
/**
|
||||
* This is a map that is used only when the line is guaranteed to have no RTL text.
|
||||
*/
|
||||
private _pixelOffsetCache: Int32Array | null;
|
||||
private readonly _pixelOffsetCache: Int32Array | null;
|
||||
|
||||
constructor(domNode: FastDomNode<HTMLElement>, renderLineInput: RenderLineInput, characterMapping: CharacterMapping, containsRTL: boolean, containsForeignElements: ForeignElementType) {
|
||||
this.domNode = domNode;
|
||||
|
|
|
@ -76,10 +76,10 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost<ViewLine>,
|
|||
|
||||
// --- width
|
||||
private _maxLineWidth: number;
|
||||
private _asyncUpdateLineWidths: RunOnceScheduler;
|
||||
private readonly _asyncUpdateLineWidths: RunOnceScheduler;
|
||||
|
||||
private _horizontalRevealRequest: HorizontalRevealRequest | null;
|
||||
private _lastRenderedData: LastRenderedData;
|
||||
private readonly _lastRenderedData: LastRenderedData;
|
||||
|
||||
constructor(context: ViewContext, linesContent: FastDomNode<HTMLElement>) {
|
||||
super(context);
|
||||
|
|
|
@ -11,7 +11,7 @@ import * as viewEvents from 'vs/editor/common/view/viewEvents';
|
|||
|
||||
export class LinesDecorationsOverlay extends DedupOverlay {
|
||||
|
||||
private _context: ViewContext;
|
||||
private readonly _context: ViewContext;
|
||||
|
||||
private _decorationsLeft: number;
|
||||
private _decorationsWidth: number;
|
||||
|
|
|
@ -14,7 +14,7 @@ export class Margin extends ViewPart {
|
|||
public static readonly CLASS_NAME = 'glyph-margin';
|
||||
public static readonly OUTER_CLASS_NAME = 'margin';
|
||||
|
||||
private _domNode: FastDomNode<HTMLElement>;
|
||||
private readonly _domNode: FastDomNode<HTMLElement>;
|
||||
private _canUseLayerHinting: boolean;
|
||||
private _contentLeft: number;
|
||||
private _glyphMarginLeft: number;
|
||||
|
|
|
@ -10,7 +10,7 @@ import { ViewContext } from 'vs/editor/common/view/viewContext';
|
|||
import * as viewEvents from 'vs/editor/common/view/viewEvents';
|
||||
|
||||
export class MarginViewLineDecorationsOverlay extends DedupOverlay {
|
||||
private _context: ViewContext;
|
||||
private readonly _context: ViewContext;
|
||||
private _renderResult: string[] | null;
|
||||
|
||||
constructor(context: ViewContext) {
|
||||
|
|
|
@ -24,7 +24,7 @@ interface IWidgetMap {
|
|||
export class ViewOverlayWidgets extends ViewPart {
|
||||
|
||||
private _widgets: IWidgetMap;
|
||||
private _domNode: FastDomNode<HTMLElement>;
|
||||
private readonly _domNode: FastDomNode<HTMLElement>;
|
||||
|
||||
private _verticalScrollbarWidth: number;
|
||||
private _minimapWidth: number;
|
||||
|
|
|
@ -13,9 +13,9 @@ import { ViewEventHandler } from 'vs/editor/common/viewModel/viewEventHandler';
|
|||
|
||||
export class OverviewRuler extends ViewEventHandler implements IOverviewRuler {
|
||||
|
||||
private _context: ViewContext;
|
||||
private _domNode: FastDomNode<HTMLCanvasElement>;
|
||||
private _zoneManager: OverviewZoneManager;
|
||||
private readonly _context: ViewContext;
|
||||
private readonly _domNode: FastDomNode<HTMLCanvasElement>;
|
||||
private readonly _zoneManager: OverviewZoneManager;
|
||||
|
||||
constructor(context: ViewContext, cssClassName: string) {
|
||||
super();
|
||||
|
|
|
@ -15,7 +15,7 @@ import { registerThemingParticipant } from 'vs/platform/theme/common/themeServic
|
|||
export class Rulers extends ViewPart {
|
||||
|
||||
public domNode: FastDomNode<HTMLElement>;
|
||||
private _renderedRulers: FastDomNode<HTMLElement>[];
|
||||
private readonly _renderedRulers: FastDomNode<HTMLElement>[];
|
||||
private _rulers: number[];
|
||||
private _typicalHalfwidthCharacterWidth: number;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ import { registerThemingParticipant } from 'vs/platform/theme/common/themeServic
|
|||
|
||||
export class ScrollDecorationViewPart extends ViewPart {
|
||||
|
||||
private _domNode: FastDomNode<HTMLElement>;
|
||||
private readonly _domNode: FastDomNode<HTMLElement>;
|
||||
private _scrollTop: number;
|
||||
private _width: number;
|
||||
private _shouldShow: boolean;
|
||||
|
|
|
@ -73,7 +73,7 @@ export class SelectionsOverlay extends DynamicViewOverlay {
|
|||
|
||||
private static readonly ROUNDED_PIECE_WIDTH = 10;
|
||||
|
||||
private _context: ViewContext;
|
||||
private readonly _context: ViewContext;
|
||||
private _lineHeight: number;
|
||||
private _roundedSelection: boolean;
|
||||
private _typicalHalfwidthCharacterWidth: number;
|
||||
|
|
|
@ -28,16 +28,16 @@ export class ViewCursors extends ViewPart {
|
|||
|
||||
private _isVisible: boolean;
|
||||
|
||||
private _domNode: FastDomNode<HTMLElement>;
|
||||
private readonly _domNode: FastDomNode<HTMLElement>;
|
||||
|
||||
private _startCursorBlinkAnimation: TimeoutTimer;
|
||||
private _cursorFlatBlinkInterval: IntervalTimer;
|
||||
private readonly _startCursorBlinkAnimation: TimeoutTimer;
|
||||
private readonly _cursorFlatBlinkInterval: IntervalTimer;
|
||||
private _blinkingEnabled: boolean;
|
||||
|
||||
private _editorHasFocus: boolean;
|
||||
|
||||
private _primaryCursor: ViewCursor;
|
||||
private _secondaryCursors: ViewCursor[];
|
||||
private readonly _primaryCursor: ViewCursor;
|
||||
private readonly _secondaryCursors: ViewCursor[];
|
||||
private _renderData: IViewCursorRenderData[];
|
||||
|
||||
constructor(context: ViewContext) {
|
||||
|
|
|
@ -141,11 +141,11 @@ export class CodeEditorWidget extends Disposable implements editorBrowser.ICodeE
|
|||
private readonly _onDidLayoutChange: Emitter<editorOptions.EditorLayoutInfo> = this._register(new Emitter<editorOptions.EditorLayoutInfo>());
|
||||
public readonly onDidLayoutChange: Event<editorOptions.EditorLayoutInfo> = this._onDidLayoutChange.event;
|
||||
|
||||
private _editorTextFocus: BooleanEventEmitter = this._register(new BooleanEventEmitter());
|
||||
private readonly _editorTextFocus: BooleanEventEmitter = this._register(new BooleanEventEmitter());
|
||||
public readonly onDidFocusEditorText: Event<void> = this._editorTextFocus.onDidChangeToTrue;
|
||||
public readonly onDidBlurEditorText: Event<void> = this._editorTextFocus.onDidChangeToFalse;
|
||||
|
||||
private _editorWidgetFocus: BooleanEventEmitter = this._register(new BooleanEventEmitter());
|
||||
private readonly _editorWidgetFocus: BooleanEventEmitter = this._register(new BooleanEventEmitter());
|
||||
public readonly onDidFocusEditorWidget: Event<void> = this._editorWidgetFocus.onDidChangeToTrue;
|
||||
public readonly onDidBlurEditorWidget: Event<void> = this._editorWidgetFocus.onDidChangeToFalse;
|
||||
|
||||
|
@ -1549,16 +1549,16 @@ export class BooleanEventEmitter extends Disposable {
|
|||
|
||||
class EditorContextKeysManager extends Disposable {
|
||||
|
||||
private _editor: CodeEditorWidget;
|
||||
private _editorFocus: IContextKey<boolean>;
|
||||
private _textInputFocus: IContextKey<boolean>;
|
||||
private _editorTextFocus: IContextKey<boolean>;
|
||||
private _editorTabMovesFocus: IContextKey<boolean>;
|
||||
private _editorReadonly: IContextKey<boolean>;
|
||||
private _hasMultipleSelections: IContextKey<boolean>;
|
||||
private _hasNonEmptySelection: IContextKey<boolean>;
|
||||
private _canUndo: IContextKey<boolean>;
|
||||
private _canRedo: IContextKey<boolean>;
|
||||
private readonly _editor: CodeEditorWidget;
|
||||
private readonly _editorFocus: IContextKey<boolean>;
|
||||
private readonly _textInputFocus: IContextKey<boolean>;
|
||||
private readonly _editorTextFocus: IContextKey<boolean>;
|
||||
private readonly _editorTabMovesFocus: IContextKey<boolean>;
|
||||
private readonly _editorReadonly: IContextKey<boolean>;
|
||||
private readonly _hasMultipleSelections: IContextKey<boolean>;
|
||||
private readonly _hasNonEmptySelection: IContextKey<boolean>;
|
||||
private readonly _canUndo: IContextKey<boolean>;
|
||||
private readonly _canRedo: IContextKey<boolean>;
|
||||
|
||||
constructor(
|
||||
editor: CodeEditorWidget,
|
||||
|
@ -1627,25 +1627,25 @@ class EditorContextKeysManager extends Disposable {
|
|||
|
||||
export class EditorModeContext extends Disposable {
|
||||
|
||||
private _editor: CodeEditorWidget;
|
||||
private readonly _editor: CodeEditorWidget;
|
||||
|
||||
private _langId: IContextKey<string>;
|
||||
private _hasCompletionItemProvider: IContextKey<boolean>;
|
||||
private _hasCodeActionsProvider: IContextKey<boolean>;
|
||||
private _hasCodeLensProvider: IContextKey<boolean>;
|
||||
private _hasDefinitionProvider: IContextKey<boolean>;
|
||||
private _hasDeclarationProvider: IContextKey<boolean>;
|
||||
private _hasImplementationProvider: IContextKey<boolean>;
|
||||
private _hasTypeDefinitionProvider: IContextKey<boolean>;
|
||||
private _hasHoverProvider: IContextKey<boolean>;
|
||||
private _hasDocumentHighlightProvider: IContextKey<boolean>;
|
||||
private _hasDocumentSymbolProvider: IContextKey<boolean>;
|
||||
private _hasReferenceProvider: IContextKey<boolean>;
|
||||
private _hasRenameProvider: IContextKey<boolean>;
|
||||
private _hasDocumentFormattingProvider: IContextKey<boolean>;
|
||||
private _hasDocumentSelectionFormattingProvider: IContextKey<boolean>;
|
||||
private _hasSignatureHelpProvider: IContextKey<boolean>;
|
||||
private _isInWalkThrough: IContextKey<boolean>;
|
||||
private readonly _langId: IContextKey<string>;
|
||||
private readonly _hasCompletionItemProvider: IContextKey<boolean>;
|
||||
private readonly _hasCodeActionsProvider: IContextKey<boolean>;
|
||||
private readonly _hasCodeLensProvider: IContextKey<boolean>;
|
||||
private readonly _hasDefinitionProvider: IContextKey<boolean>;
|
||||
private readonly _hasDeclarationProvider: IContextKey<boolean>;
|
||||
private readonly _hasImplementationProvider: IContextKey<boolean>;
|
||||
private readonly _hasTypeDefinitionProvider: IContextKey<boolean>;
|
||||
private readonly _hasHoverProvider: IContextKey<boolean>;
|
||||
private readonly _hasDocumentHighlightProvider: IContextKey<boolean>;
|
||||
private readonly _hasDocumentSymbolProvider: IContextKey<boolean>;
|
||||
private readonly _hasReferenceProvider: IContextKey<boolean>;
|
||||
private readonly _hasRenameProvider: IContextKey<boolean>;
|
||||
private readonly _hasDocumentFormattingProvider: IContextKey<boolean>;
|
||||
private readonly _hasDocumentSelectionFormattingProvider: IContextKey<boolean>;
|
||||
private readonly _hasSignatureHelpProvider: IContextKey<boolean>;
|
||||
private readonly _isInWalkThrough: IContextKey<boolean>;
|
||||
|
||||
constructor(
|
||||
editor: CodeEditorWidget,
|
||||
|
@ -1751,7 +1751,7 @@ export class EditorModeContext extends Disposable {
|
|||
class CodeEditorWidgetFocusTracker extends Disposable {
|
||||
|
||||
private _hasFocus: boolean;
|
||||
private _domFocusTracker: dom.IFocusTracker;
|
||||
private readonly _domFocusTracker: dom.IFocusTracker;
|
||||
|
||||
private readonly _onChange: Emitter<void> = this._register(new Emitter<void>());
|
||||
public readonly onChange: Event<void> = this._onChange.event;
|
||||
|
|
|
@ -148,7 +148,7 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
|
|||
|
||||
private readonly id: number;
|
||||
|
||||
private _domElement: HTMLElement;
|
||||
private readonly _domElement: HTMLElement;
|
||||
protected readonly _containerDomElement: HTMLElement;
|
||||
private readonly _overviewDomElement: HTMLElement;
|
||||
private readonly _overviewViewportDomElement: FastDomNode<HTMLElement>;
|
||||
|
@ -160,12 +160,12 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
|
|||
|
||||
private originalEditor: CodeEditorWidget;
|
||||
private _originalDomNode: HTMLElement;
|
||||
private _originalEditorState: VisualEditorState;
|
||||
private readonly _originalEditorState: VisualEditorState;
|
||||
private _originalOverviewRuler: editorBrowser.IOverviewRuler;
|
||||
|
||||
private modifiedEditor: CodeEditorWidget;
|
||||
private _modifiedDomNode: HTMLElement;
|
||||
private _modifiedEditorState: VisualEditorState;
|
||||
private readonly _modifiedEditorState: VisualEditorState;
|
||||
private _modifiedOverviewRuler: editorBrowser.IOverviewRuler;
|
||||
|
||||
private _currentlyChangingViewZones: boolean;
|
||||
|
@ -184,15 +184,15 @@ export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffE
|
|||
private _enableSplitViewResizing: boolean;
|
||||
private _strategy: IDiffEditorWidgetStyle;
|
||||
|
||||
private _updateDecorationsRunner: RunOnceScheduler;
|
||||
private readonly _updateDecorationsRunner: RunOnceScheduler;
|
||||
|
||||
private _editorWorkerService: IEditorWorkerService;
|
||||
private readonly _editorWorkerService: IEditorWorkerService;
|
||||
protected _contextKeyService: IContextKeyService;
|
||||
private _codeEditorService: ICodeEditorService;
|
||||
private _themeService: IThemeService;
|
||||
private _notificationService: INotificationService;
|
||||
private readonly _codeEditorService: ICodeEditorService;
|
||||
private readonly _themeService: IThemeService;
|
||||
private readonly _notificationService: INotificationService;
|
||||
|
||||
private _reviewPane: DiffReview;
|
||||
private readonly _reviewPane: DiffReview;
|
||||
|
||||
constructor(
|
||||
domElement: HTMLElement,
|
||||
|
@ -1251,7 +1251,7 @@ interface IMyViewZone {
|
|||
class ForeignViewZonesIterator {
|
||||
|
||||
private _index: number;
|
||||
private _source: IEditorWhitespace[];
|
||||
private readonly _source: IEditorWhitespace[];
|
||||
public current: IEditorWhitespace | null;
|
||||
|
||||
constructor(source: IEditorWhitespace[]) {
|
||||
|
@ -1272,9 +1272,9 @@ class ForeignViewZonesIterator {
|
|||
|
||||
abstract class ViewZonesComputer {
|
||||
|
||||
private lineChanges: editorCommon.ILineChange[];
|
||||
private originalForeignVZ: IEditorWhitespace[];
|
||||
private modifiedForeignVZ: IEditorWhitespace[];
|
||||
private readonly lineChanges: editorCommon.ILineChange[];
|
||||
private readonly originalForeignVZ: IEditorWhitespace[];
|
||||
private readonly modifiedForeignVZ: IEditorWhitespace[];
|
||||
|
||||
constructor(lineChanges: editorCommon.ILineChange[], originalForeignVZ: IEditorWhitespace[], modifiedForeignVZ: IEditorWhitespace[]) {
|
||||
this.lineChanges = lineChanges;
|
||||
|
@ -1532,7 +1532,7 @@ class DiffEdtorWidgetSideBySide extends DiffEditorWidgetStyle implements IDiffEd
|
|||
static MINIMUM_EDITOR_WIDTH = 100;
|
||||
|
||||
private _disableSash: boolean;
|
||||
private _sash: Sash;
|
||||
private readonly _sash: Sash;
|
||||
private _sashRatio: number | null;
|
||||
private _sashPosition: number | null;
|
||||
private _startSashPosition: number;
|
||||
|
@ -1911,10 +1911,10 @@ class DiffEdtorWidgetInline extends DiffEditorWidgetStyle implements IDiffEditor
|
|||
|
||||
class InlineViewZonesComputer extends ViewZonesComputer {
|
||||
|
||||
private originalModel: ITextModel;
|
||||
private modifiedEditorConfiguration: editorOptions.InternalEditorOptions;
|
||||
private modifiedEditorTabSize: number;
|
||||
private renderIndicators: boolean;
|
||||
private readonly originalModel: ITextModel;
|
||||
private readonly modifiedEditorConfiguration: editorOptions.InternalEditorOptions;
|
||||
private readonly modifiedEditorTabSize: number;
|
||||
private readonly renderIndicators: boolean;
|
||||
|
||||
constructor(lineChanges: editorCommon.ILineChange[], originalForeignVZ: IEditorWhitespace[], modifiedForeignVZ: IEditorWhitespace[], originalEditor: editorBrowser.ICodeEditor, modifiedEditor: editorBrowser.ICodeEditor, renderIndicators: boolean) {
|
||||
super(lineChanges, originalForeignVZ, modifiedForeignVZ);
|
||||
|
|
|
@ -19,8 +19,8 @@ import { IAccessibilityService } from 'vs/platform/accessibility/common/accessib
|
|||
|
||||
export class EmbeddedCodeEditorWidget extends CodeEditorWidget {
|
||||
|
||||
private _parentEditor: ICodeEditor;
|
||||
private _overwriteOptions: IEditorOptions;
|
||||
private readonly _parentEditor: ICodeEditor;
|
||||
private readonly _overwriteOptions: IEditorOptions;
|
||||
|
||||
constructor(
|
||||
domElement: HTMLElement,
|
||||
|
@ -62,8 +62,8 @@ export class EmbeddedCodeEditorWidget extends CodeEditorWidget {
|
|||
|
||||
export class EmbeddedDiffEditorWidget extends DiffEditorWidget {
|
||||
|
||||
private _parentEditor: ICodeEditor;
|
||||
private _overwriteOptions: IDiffEditorOptions;
|
||||
private readonly _parentEditor: ICodeEditor;
|
||||
private readonly _overwriteOptions: IDiffEditorOptions;
|
||||
|
||||
constructor(
|
||||
domElement: HTMLElement,
|
||||
|
|
|
@ -98,9 +98,9 @@ export class ReplaceCommandWithOffsetCursorState implements ICommand {
|
|||
|
||||
export class ReplaceCommandThatPreservesSelection implements ICommand {
|
||||
|
||||
private _range: Range;
|
||||
private _text: string;
|
||||
private _initialSelection: Selection;
|
||||
private readonly _range: Range;
|
||||
private readonly _text: string;
|
||||
private readonly _initialSelection: Selection;
|
||||
private _selectionId: string;
|
||||
|
||||
constructor(editRange: Range, text: string, initialSelection: Selection) {
|
||||
|
|
|
@ -68,8 +68,8 @@ export class ShiftCommand implements ICommand {
|
|||
}
|
||||
}
|
||||
|
||||
private _opts: IShiftCommandOpts;
|
||||
private _selection: Selection;
|
||||
private readonly _opts: IShiftCommandOpts;
|
||||
private readonly _selection: Selection;
|
||||
private _selectionId: string;
|
||||
private _useLastEditRangeForCursorEndPosition: boolean;
|
||||
private _selectionStartColumnStaysPut: boolean;
|
||||
|
|
|
@ -9,9 +9,9 @@ import { ICommand, ICursorStateComputerData, IEditOperationBuilder } from 'vs/ed
|
|||
import { ITextModel } from 'vs/editor/common/model';
|
||||
|
||||
export class SurroundSelectionCommand implements ICommand {
|
||||
private _range: Selection;
|
||||
private _charBeforeSelection: string;
|
||||
private _charAfterSelection: string;
|
||||
private readonly _range: Selection;
|
||||
private readonly _charBeforeSelection: string;
|
||||
private readonly _charAfterSelection: string;
|
||||
|
||||
constructor(range: Selection, charBeforeSelection: string, charAfterSelection: string) {
|
||||
this._range = range;
|
||||
|
|
|
@ -13,9 +13,9 @@ import { IIdentifiedSingleEditOperation, ITextModel } from 'vs/editor/common/mod
|
|||
|
||||
export class TrimTrailingWhitespaceCommand implements ICommand {
|
||||
|
||||
private selection: Selection;
|
||||
private readonly selection: Selection;
|
||||
private selectionId: string;
|
||||
private cursors: Position[];
|
||||
private readonly cursors: Position[];
|
||||
|
||||
constructor(selection: Selection, cursors: Position[]) {
|
||||
this.selection = selection;
|
||||
|
|
|
@ -63,7 +63,7 @@ const enum Boolean {
|
|||
|
||||
export class CharacterSet {
|
||||
|
||||
private _actual: CharacterClassifier<Boolean>;
|
||||
private readonly _actual: CharacterClassifier<Boolean>;
|
||||
|
||||
constructor() {
|
||||
this._actual = new CharacterClassifier<Boolean>(Boolean.False);
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
|
||||
export class Uint8Matrix {
|
||||
|
||||
private _data: Uint8Array;
|
||||
private readonly _data: Uint8Array;
|
||||
public readonly rows: number;
|
||||
public readonly cols: number;
|
||||
|
||||
|
|
|
@ -102,7 +102,7 @@ export interface IUndoRedoResult {
|
|||
|
||||
export class EditStack {
|
||||
|
||||
private model: TextModel;
|
||||
private readonly model: TextModel;
|
||||
private currentOpenStackElement: IStackElement | null;
|
||||
private past: IStackElement[];
|
||||
private future: IStackElement[];
|
||||
|
|
|
@ -157,10 +157,10 @@ export class StringBuffer {
|
|||
* 2. TreeNode/Buffers normalization should not happen during snapshot reading.
|
||||
*/
|
||||
class PieceTreeSnapshot implements ITextSnapshot {
|
||||
private _pieces: Piece[];
|
||||
private readonly _pieces: Piece[];
|
||||
private _index: number;
|
||||
private _tree: PieceTreeBase;
|
||||
private _BOM: string;
|
||||
private readonly _tree: PieceTreeBase;
|
||||
private readonly _BOM: string;
|
||||
|
||||
constructor(tree: PieceTreeBase, BOM: string) {
|
||||
this._pieces = [];
|
||||
|
@ -205,7 +205,7 @@ interface CacheEntry {
|
|||
}
|
||||
|
||||
class PieceTreeSearchCache {
|
||||
private _limit: number;
|
||||
private readonly _limit: number;
|
||||
private _cache: CacheEntry[];
|
||||
|
||||
constructor(limit: number) {
|
||||
|
|
|
@ -27,8 +27,8 @@ export interface IReverseSingleEditOperation extends IIdentifiedSingleEditOperat
|
|||
}
|
||||
|
||||
export class PieceTreeTextBuffer implements ITextBuffer {
|
||||
private _pieceTree: PieceTreeBase;
|
||||
private _BOM: string;
|
||||
private readonly _pieceTree: PieceTreeBase;
|
||||
private readonly _BOM: string;
|
||||
private _mightContainRTL: boolean;
|
||||
private _mightContainNonBasicASCII: boolean;
|
||||
|
||||
|
|
|
@ -62,12 +62,12 @@ export class PieceTreeTextBufferFactory implements ITextBufferFactory {
|
|||
}
|
||||
|
||||
export class PieceTreeTextBufferBuilder implements ITextBufferBuilder {
|
||||
private chunks: StringBuffer[];
|
||||
private readonly chunks: StringBuffer[];
|
||||
private BOM: string;
|
||||
|
||||
private _hasPreviousChar: boolean;
|
||||
private _previousChar: number;
|
||||
private _tmpLineStarts: number[];
|
||||
private readonly _tmpLineStarts: number[];
|
||||
|
||||
private cr: number;
|
||||
private lf: number;
|
||||
|
|
|
@ -265,8 +265,8 @@ export class TextModel extends Disposable implements model.ITextModel {
|
|||
|
||||
//#region Tokenization
|
||||
private _languageIdentifier: LanguageIdentifier;
|
||||
private _tokenizationListener: IDisposable;
|
||||
private _languageRegistryListener: IDisposable;
|
||||
private readonly _tokenizationListener: IDisposable;
|
||||
private readonly _languageRegistryListener: IDisposable;
|
||||
private _revalidateTokensTimeout: any;
|
||||
/*private*/_tokens: ModelLinesTokens;
|
||||
//#endregion
|
||||
|
@ -2730,12 +2730,12 @@ class DecorationsTrees {
|
|||
/**
|
||||
* This tree holds decorations that do not show up in the overview ruler.
|
||||
*/
|
||||
private _decorationsTree0: IntervalTree;
|
||||
private readonly _decorationsTree0: IntervalTree;
|
||||
|
||||
/**
|
||||
* This tree holds decorations that show up in the overview ruler.
|
||||
*/
|
||||
private _decorationsTree1: IntervalTree;
|
||||
private readonly _decorationsTree1: IntervalTree;
|
||||
|
||||
constructor() {
|
||||
this._decorationsTree0 = new IntervalTree();
|
||||
|
|
|
@ -509,8 +509,8 @@ export function isValidMatch(wordSeparators: WordCharacterClassifier, text: stri
|
|||
}
|
||||
|
||||
export class Searcher {
|
||||
private _wordSeparators: WordCharacterClassifier | null;
|
||||
private _searchRegex: RegExp;
|
||||
private readonly _wordSeparators: WordCharacterClassifier | null;
|
||||
private readonly _searchRegex: RegExp;
|
||||
private _prevMatchStartIndex: number;
|
||||
private _prevMatchLength: number;
|
||||
|
||||
|
|
|
@ -472,7 +472,7 @@ export class ModelLinesTokens {
|
|||
|
||||
export class ModelTokensChangedEventBuilder {
|
||||
|
||||
private _ranges: { fromLineNumber: number; toLineNumber: number; }[];
|
||||
private readonly _ranges: { fromLineNumber: number; toLineNumber: number; }[];
|
||||
|
||||
constructor() {
|
||||
this._ranges = [];
|
||||
|
|
|
@ -7,7 +7,7 @@ import { IMode, LanguageIdentifier } from 'vs/editor/common/modes';
|
|||
|
||||
export class FrankensteinMode implements IMode {
|
||||
|
||||
private _languageIdentifier: LanguageIdentifier;
|
||||
private readonly _languageIdentifier: LanguageIdentifier;
|
||||
|
||||
constructor(languageIdentifier: LanguageIdentifier) {
|
||||
this._languageIdentifier = languageIdentifier;
|
||||
|
|
|
@ -175,7 +175,7 @@ export class LanguageConfigurationChangeEvent {
|
|||
|
||||
export class LanguageConfigurationRegistryImpl {
|
||||
|
||||
private _entries: RichEditSupport[];
|
||||
private readonly _entries: RichEditSupport[];
|
||||
|
||||
private readonly _onDidChange = new Emitter<LanguageConfigurationChangeEvent>();
|
||||
public readonly onDidChange: Event<LanguageConfigurationChangeEvent> = this._onDidChange.event;
|
||||
|
|
|
@ -29,7 +29,7 @@ function isExclusive(selector: LanguageSelector): boolean {
|
|||
export class LanguageFeatureRegistry<T> {
|
||||
|
||||
private _clock: number = 0;
|
||||
private _entries: Entry<T>[] = [];
|
||||
private readonly _entries: Entry<T>[] = [];
|
||||
private readonly _onDidChange = new Emitter<number>();
|
||||
|
||||
constructor() {
|
||||
|
|
|
@ -35,8 +35,8 @@ export type Edge = [State, number, State];
|
|||
|
||||
export class StateMachine {
|
||||
|
||||
private _states: Uint8Matrix;
|
||||
private _maxCharCode: number;
|
||||
private readonly _states: Uint8Matrix;
|
||||
private readonly _maxCharCode: number;
|
||||
|
||||
constructor(edges: Edge[]) {
|
||||
let maxCharCode = 0;
|
||||
|
|
|
@ -17,7 +17,7 @@ export const Extensions = {
|
|||
|
||||
export class EditorModesRegistry {
|
||||
|
||||
private _languages: ILanguageExtensionPoint[];
|
||||
private readonly _languages: ILanguageExtensionPoint[];
|
||||
private _dynamicLanguages: ILanguageExtensionPoint[];
|
||||
|
||||
private readonly _onDidChangeLanguages = new Emitter<void>();
|
||||
|
|
|
@ -64,7 +64,7 @@ export class BasicInplaceReplace {
|
|||
return null;
|
||||
}
|
||||
|
||||
private _defaultValueSet: string[][] = [
|
||||
private readonly _defaultValueSet: string[][] = [
|
||||
['true', 'false'],
|
||||
['True', 'False'],
|
||||
['Private', 'Public', 'Friend', 'ReadOnly', 'Partial', 'Protected', 'WriteOnly'],
|
||||
|
|
|
@ -151,8 +151,8 @@ const colorRegExp = /^#?([0-9A-Fa-f]{6})([0-9A-Fa-f]{2})?$/;
|
|||
export class ColorMap {
|
||||
|
||||
private _lastColorId: number;
|
||||
private _id2color: Color[];
|
||||
private _color2id: Map<string, ColorId>;
|
||||
private readonly _id2color: Color[];
|
||||
private readonly _color2id: Map<string, ColorId>;
|
||||
|
||||
constructor() {
|
||||
this._lastColorId = 0;
|
||||
|
|
|
@ -10,8 +10,8 @@ import { ColorId, ITokenizationRegistry, ITokenizationSupport, ITokenizationSupp
|
|||
|
||||
export class TokenizationRegistryImpl implements ITokenizationRegistry {
|
||||
|
||||
private _map: { [language: string]: ITokenizationSupport };
|
||||
private _promises: { [language: string]: Thenable<void> };
|
||||
private readonly _map: { [language: string]: ITokenizationSupport };
|
||||
private readonly _promises: { [language: string]: Thenable<void> };
|
||||
|
||||
private readonly _onDidChange = new Emitter<ITokenizationSupportChangedEvent>();
|
||||
public readonly onDidChange: Event<ITokenizationSupportChangedEvent> = this._onDidChange.event;
|
||||
|
|
|
@ -323,7 +323,7 @@ declare var require: any;
|
|||
* @internal
|
||||
*/
|
||||
export abstract class BaseEditorSimpleWorker {
|
||||
private _foreignModuleFactory: IForeignModuleFactory | null;
|
||||
private readonly _foreignModuleFactory: IForeignModuleFactory | null;
|
||||
private _foreignModule: any;
|
||||
|
||||
constructor(foreignModuleFactory: IForeignModuleFactory | null) {
|
||||
|
|
|
@ -146,7 +146,7 @@ class WordBasedCompletionItemProvider implements modes.CompletionItemProvider {
|
|||
|
||||
class WorkerManager extends Disposable {
|
||||
|
||||
private _modelService: IModelService;
|
||||
private readonly _modelService: IModelService;
|
||||
private _editorWorkerClient: EditorWorkerClient | null;
|
||||
private _lastWorkerUsedTime: number;
|
||||
|
||||
|
@ -211,8 +211,8 @@ class WorkerManager extends Disposable {
|
|||
|
||||
class EditorModelManager extends Disposable {
|
||||
|
||||
private _proxy: EditorSimpleWorkerImpl;
|
||||
private _modelService: IModelService;
|
||||
private readonly _proxy: EditorSimpleWorkerImpl;
|
||||
private readonly _modelService: IModelService;
|
||||
private _syncedModels: { [modelUrl: string]: IDisposable[]; } = Object.create(null);
|
||||
private _syncedModelsLastUsedTime: { [modelUrl: string]: number; } = Object.create(null);
|
||||
|
||||
|
@ -312,8 +312,8 @@ interface IWorkerClient<T> {
|
|||
}
|
||||
|
||||
class SynchronousWorkerClient<T extends IDisposable> implements IWorkerClient<T> {
|
||||
private _instance: T;
|
||||
private _proxyObj: Promise<T>;
|
||||
private readonly _instance: T;
|
||||
private readonly _proxyObj: Promise<T>;
|
||||
|
||||
constructor(instance: T) {
|
||||
this._instance = instance;
|
||||
|
@ -331,9 +331,9 @@ class SynchronousWorkerClient<T extends IDisposable> implements IWorkerClient<T>
|
|||
|
||||
export class EditorWorkerClient extends Disposable {
|
||||
|
||||
private _modelService: IModelService;
|
||||
private readonly _modelService: IModelService;
|
||||
private _worker: IWorkerClient<EditorSimpleWorkerImpl> | null;
|
||||
private _workerFactory: DefaultWorkerFactory;
|
||||
private readonly _workerFactory: DefaultWorkerFactory;
|
||||
private _modelManager: EditorModelManager | null;
|
||||
|
||||
constructor(modelService: IModelService, label: string | undefined) {
|
||||
|
|
|
@ -36,8 +36,8 @@ export class LanguagesRegistry extends Disposable {
|
|||
private readonly _warnOnOverwrite: boolean;
|
||||
|
||||
private _nextLanguageId2: number;
|
||||
private _languageIdToLanguage: string[];
|
||||
private _languageToLanguageId: { [id: string]: number; };
|
||||
private readonly _languageIdToLanguage: string[];
|
||||
private readonly _languageToLanguageId: { [id: string]: number; };
|
||||
|
||||
private _languages: { [id: string]: IResolvedLanguage; };
|
||||
private _mimeTypesMap: { [mimeType: string]: LanguageIdentifier; };
|
||||
|
|
|
@ -91,9 +91,9 @@ const DEFAULT_EOL = (platform.isLinux || platform.isMacintosh) ? DefaultEndOfLin
|
|||
export class ModelServiceImpl extends Disposable implements IModelService {
|
||||
public _serviceBrand: any;
|
||||
|
||||
private _configurationService: IConfigurationService;
|
||||
private _configurationServiceSubscription: IDisposable;
|
||||
private _resourcePropertiesService: ITextResourcePropertiesService;
|
||||
private readonly _configurationService: IConfigurationService;
|
||||
private readonly _configurationServiceSubscription: IDisposable;
|
||||
private readonly _resourcePropertiesService: ITextResourcePropertiesService;
|
||||
|
||||
private readonly _onModelAdded: Emitter<ITextModel> = this._register(new Emitter<ITextModel>());
|
||||
public readonly onModelAdded: Event<ITextModel> = this._onModelAdded.event;
|
||||
|
@ -111,7 +111,7 @@ export class ModelServiceImpl extends Disposable implements IModelService {
|
|||
/**
|
||||
* All the models known in the system.
|
||||
*/
|
||||
private _models: { [modelId: string]: ModelData; };
|
||||
private readonly _models: { [modelId: string]: ModelData; };
|
||||
|
||||
constructor(
|
||||
@IConfigurationService configurationService: IConfigurationService,
|
||||
|
|
|
@ -52,7 +52,7 @@ export interface IWebWorkerOptions {
|
|||
|
||||
class MonacoWebWorkerImpl<T> extends EditorWorkerClient implements MonacoWebWorker<T> {
|
||||
|
||||
private _foreignModuleId: string;
|
||||
private readonly _foreignModuleId: string;
|
||||
private _foreignModuleCreateData: any | null;
|
||||
private _foreignProxy: Promise<T> | null;
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ export class OverviewRulerZone {
|
|||
|
||||
export class OverviewZoneManager {
|
||||
|
||||
private _getVerticalOffsetForLine: (lineNumber: number) => number;
|
||||
private readonly _getVerticalOffsetForLine: (lineNumber: number) => number;
|
||||
private _zones: OverviewRulerZone[];
|
||||
private _colorZonesInvalid: boolean;
|
||||
private _lineHeight: number;
|
||||
|
@ -85,8 +85,8 @@ export class OverviewZoneManager {
|
|||
private _pixelRatio: number;
|
||||
|
||||
private _lastAssignedId: number;
|
||||
private _color2Id: { [color: string]: number; };
|
||||
private _id2Color: string[];
|
||||
private readonly _color2Id: { [color: string]: number; };
|
||||
private readonly _id2Color: string[];
|
||||
|
||||
constructor(getVerticalOffsetForLine: (lineNumber: number) => number) {
|
||||
this._getVerticalOffsetForLine = getVerticalOffsetForLine;
|
||||
|
|
|
@ -8,8 +8,8 @@ import { ViewEventHandler } from 'vs/editor/common/viewModel/viewEventHandler';
|
|||
|
||||
export class ViewEventDispatcher {
|
||||
|
||||
private _eventHandlerGateKeeper: (callback: () => void) => void;
|
||||
private _eventHandlers: ViewEventHandler[];
|
||||
private readonly _eventHandlerGateKeeper: (callback: () => void) => void;
|
||||
private readonly _eventHandlers: ViewEventHandler[];
|
||||
private _eventQueue: ViewEvent[] | null;
|
||||
private _isConsumingQueue: boolean;
|
||||
|
||||
|
|
|
@ -102,8 +102,8 @@ export class DecorationSegment {
|
|||
|
||||
class Stack {
|
||||
public count: number;
|
||||
private stopOffsets: number[];
|
||||
private classNames: string[];
|
||||
private readonly stopOffsets: number[];
|
||||
private readonly classNames: string[];
|
||||
|
||||
constructor() {
|
||||
this.stopOffsets = [];
|
||||
|
|
|
@ -30,7 +30,7 @@ export class LinesLayout {
|
|||
/**
|
||||
* Contains whitespace information in pixels
|
||||
*/
|
||||
private _whitespaces: WhitespaceComputer;
|
||||
private readonly _whitespaces: WhitespaceComputer;
|
||||
|
||||
constructor(lineCount: number, lineHeight: number) {
|
||||
this._lineCount = lineCount;
|
||||
|
|
|
@ -18,27 +18,27 @@ export class WhitespaceComputer {
|
|||
/**
|
||||
* heights[i] is the height in pixels for whitespace at index i
|
||||
*/
|
||||
private _heights: number[];
|
||||
private readonly _heights: number[];
|
||||
|
||||
/**
|
||||
* minWidths[i] is the min width in pixels for whitespace at index i
|
||||
*/
|
||||
private _minWidths: number[];
|
||||
private readonly _minWidths: number[];
|
||||
|
||||
/**
|
||||
* afterLineNumbers[i] is the line number whitespace at index i is after
|
||||
*/
|
||||
private _afterLineNumbers: number[];
|
||||
private readonly _afterLineNumbers: number[];
|
||||
|
||||
/**
|
||||
* ordinals[i] is the orinal of the whitespace at index i
|
||||
*/
|
||||
private _ordinals: number[];
|
||||
private readonly _ordinals: number[];
|
||||
|
||||
/**
|
||||
* prefixSum[i] = SUM(heights[j]), 1 <= j <= i
|
||||
*/
|
||||
private _prefixSum: number[];
|
||||
private readonly _prefixSum: number[];
|
||||
|
||||
/**
|
||||
* prefixSum[i], 1 <= i <= prefixSumValidIndex can be trusted
|
||||
|
@ -48,12 +48,12 @@ export class WhitespaceComputer {
|
|||
/**
|
||||
* ids[i] is the whitespace id of whitespace at index i
|
||||
*/
|
||||
private _ids: number[];
|
||||
private readonly _ids: number[];
|
||||
|
||||
/**
|
||||
* index at which a whitespace is positioned (inside heights, afterLineNumbers, prefixSum members)
|
||||
*/
|
||||
private _whitespaceId2Index: {
|
||||
private readonly _whitespaceId2Index: {
|
||||
[id: string]: number;
|
||||
};
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ class WrappingCharacterClassifier extends CharacterClassifier<CharacterClass> {
|
|||
|
||||
export class CharacterHardWrappingLineMapperFactory implements ILineMapperFactory {
|
||||
|
||||
private classifier: WrappingCharacterClassifier;
|
||||
private readonly classifier: WrappingCharacterClassifier;
|
||||
|
||||
constructor(breakBeforeChars: string, breakAfterChars: string, breakObtrusiveChars: string) {
|
||||
this.classifier = new WrappingCharacterClassifier(breakBeforeChars, breakAfterChars, breakObtrusiveChars);
|
||||
|
@ -255,8 +255,8 @@ export class CharacterHardWrappingLineMapperFactory implements ILineMapperFactor
|
|||
|
||||
export class CharacterHardWrappingLineMapping implements ILineMapping {
|
||||
|
||||
private _prefixSums: PrefixSumComputer;
|
||||
private _wrappedLinesIndent: string;
|
||||
private readonly _prefixSums: PrefixSumComputer;
|
||||
private readonly _wrappedLinesIndent: string;
|
||||
|
||||
constructor(prefixSums: PrefixSumComputer, wrappedLinesIndent: string) {
|
||||
this._prefixSums = prefixSums;
|
||||
|
|
|
@ -32,7 +32,7 @@ export class PrefixSumComputer {
|
|||
/**
|
||||
* prefixSum[i], 0 <= i <= prefixSumValidIndex can be trusted
|
||||
*/
|
||||
private prefixSumValidIndex: Int32Array;
|
||||
private readonly prefixSumValidIndex: Int32Array;
|
||||
|
||||
constructor(values: Uint32Array) {
|
||||
this.values = values;
|
||||
|
|
|
@ -149,7 +149,7 @@ const enum IndentGuideRepeatOption {
|
|||
|
||||
export class SplitLinesCollection implements IViewModelLinesCollection {
|
||||
|
||||
private model: ITextModel;
|
||||
private readonly model: ITextModel;
|
||||
private _validModelVersionId: number;
|
||||
|
||||
private wrappingColumn: number;
|
||||
|
@ -160,7 +160,7 @@ export class SplitLinesCollection implements IViewModelLinesCollection {
|
|||
|
||||
private prefixSumComputer: PrefixSumComputerWithCache;
|
||||
|
||||
private linePositionMapperFactory: ILineMapperFactory;
|
||||
private readonly linePositionMapperFactory: ILineMapperFactory;
|
||||
|
||||
private hiddenAreasIds: string[];
|
||||
|
||||
|
@ -1001,11 +1001,11 @@ class InvisibleIdentitySplitLine implements ISplitLine {
|
|||
|
||||
export class SplitLine implements ISplitLine {
|
||||
|
||||
private positionMapper: ILineMapping;
|
||||
private outputLineCount: number;
|
||||
private readonly positionMapper: ILineMapping;
|
||||
private readonly outputLineCount: number;
|
||||
|
||||
private wrappedIndent: string;
|
||||
private wrappedIndentLength: number;
|
||||
private readonly wrappedIndent: string;
|
||||
private readonly wrappedIndentLength: number;
|
||||
private _isVisible: boolean;
|
||||
|
||||
constructor(positionMapper: ILineMapping, isVisible: boolean) {
|
||||
|
|
|
@ -92,7 +92,7 @@ export class BracketMatchingController extends Disposable implements editorCommo
|
|||
private _lastBracketsData: BracketsData[];
|
||||
private _lastVersionId: number;
|
||||
private _decorations: string[];
|
||||
private _updateBracketsSoon: RunOnceScheduler;
|
||||
private readonly _updateBracketsSoon: RunOnceScheduler;
|
||||
private _matchBrackets: boolean;
|
||||
|
||||
constructor(
|
||||
|
|
|
@ -12,7 +12,7 @@ import { MoveCaretCommand } from 'vs/editor/contrib/caretOperations/moveCaretCom
|
|||
|
||||
class MoveCaretAction extends EditorAction {
|
||||
|
||||
private left: boolean;
|
||||
private readonly left: boolean;
|
||||
|
||||
constructor(left: boolean, opts: IActionOptions) {
|
||||
super(opts);
|
||||
|
|
|
@ -10,8 +10,8 @@ import { ITextModel } from 'vs/editor/common/model';
|
|||
|
||||
export class MoveCaretCommand implements ICommand {
|
||||
|
||||
private _selection: Selection;
|
||||
private _isMovingLeft: boolean;
|
||||
private readonly _selection: Selection;
|
||||
private readonly _isMovingLeft: boolean;
|
||||
|
||||
private _cutStartIndex: number;
|
||||
private _cutEndIndex: number;
|
||||
|
|
|
@ -32,7 +32,7 @@ type ExecCommand = 'cut' | 'copy' | 'paste';
|
|||
|
||||
abstract class ExecCommandAction extends EditorAction {
|
||||
|
||||
private browserCommand: ExecCommand;
|
||||
private readonly browserCommand: ExecCommand;
|
||||
|
||||
constructor(browserCommand: ExecCommand, opts: IActionOptions) {
|
||||
super(opts);
|
||||
|
|
|
@ -42,11 +42,11 @@ export class QuickFixController implements IEditorContribution {
|
|||
return editor.getContribution<QuickFixController>(QuickFixController.ID);
|
||||
}
|
||||
|
||||
private _editor: ICodeEditor;
|
||||
private _model: CodeActionModel;
|
||||
private _codeActionContextMenu: CodeActionContextMenu;
|
||||
private _lightBulbWidget: LightBulbWidget;
|
||||
private _disposables: IDisposable[] = [];
|
||||
private readonly _editor: ICodeEditor;
|
||||
private readonly _model: CodeActionModel;
|
||||
private readonly _codeActionContextMenu: CodeActionContextMenu;
|
||||
private readonly _lightBulbWidget: LightBulbWidget;
|
||||
private readonly _disposables: IDisposable[] = [];
|
||||
|
||||
private _activeRequest: CancelablePromise<CodeAction[]> | undefined;
|
||||
|
||||
|
|
|
@ -26,9 +26,9 @@ export class CodeActionOracle {
|
|||
private readonly _autoTriggerTimer = new TimeoutTimer();
|
||||
|
||||
constructor(
|
||||
private _editor: ICodeEditor,
|
||||
private readonly _editor: ICodeEditor,
|
||||
private readonly _markerService: IMarkerService,
|
||||
private _signalChange: (newState: CodeActionsState.State) => void,
|
||||
private readonly _signalChange: (newState: CodeActionsState.State) => void,
|
||||
private readonly _delay: number = 250,
|
||||
private readonly _progressService?: IProgressService,
|
||||
) {
|
||||
|
|
|
@ -33,7 +33,7 @@ export class CodeLensContribution implements editorCommon.IEditorContribution {
|
|||
private _detectVisibleLenses: RunOnceScheduler;
|
||||
|
||||
constructor(
|
||||
private _editor: editorBrowser.ICodeEditor,
|
||||
private readonly _editor: editorBrowser.ICodeEditor,
|
||||
@ICommandService private readonly _commandService: ICommandService,
|
||||
@INotificationService private readonly _notificationService: INotificationService
|
||||
) {
|
||||
|
|
|
@ -26,7 +26,7 @@ class CodeLensViewZone implements editorBrowser.IViewZone {
|
|||
afterLineNumber: number;
|
||||
|
||||
private _lastHeight: number;
|
||||
private _onHeight: Function;
|
||||
private readonly _onHeight: Function;
|
||||
|
||||
constructor(afterLineNumber: number, onHeight: Function) {
|
||||
this.afterLineNumber = afterLineNumber;
|
||||
|
@ -164,9 +164,9 @@ export interface IDecorationIdCallback {
|
|||
|
||||
export class CodeLensHelper {
|
||||
|
||||
private _removeDecorations: string[];
|
||||
private _addDecorations: IModelDeltaDecoration[];
|
||||
private _addDecorationsCallbacks: IDecorationIdCallback[];
|
||||
private readonly _removeDecorations: string[];
|
||||
private readonly _addDecorations: IModelDeltaDecoration[];
|
||||
private readonly _addDecorationsCallbacks: IDecorationIdCallback[];
|
||||
|
||||
constructor() {
|
||||
this._removeDecorations = [];
|
||||
|
|
|
@ -37,11 +37,11 @@ export class ColorDetector implements IEditorContribution {
|
|||
private _colorDatas = new Map<string, IColorData>();
|
||||
|
||||
private _colorDecoratorIds: string[] = [];
|
||||
private _decorationsTypes: { [key: string]: boolean } = {};
|
||||
private readonly _decorationsTypes: { [key: string]: boolean } = {};
|
||||
|
||||
private _isEnabled: boolean;
|
||||
|
||||
constructor(private _editor: ICodeEditor,
|
||||
constructor(private readonly _editor: ICodeEditor,
|
||||
@ICodeEditorService private readonly _codeEditorService: ICodeEditorService,
|
||||
@IConfigurationService private readonly _configurationService: IConfigurationService
|
||||
) {
|
||||
|
|
|
@ -19,11 +19,11 @@ const $ = dom.$;
|
|||
|
||||
export class ColorPickerHeader extends Disposable {
|
||||
|
||||
private domNode: HTMLElement;
|
||||
private pickedColorNode: HTMLElement;
|
||||
private readonly domNode: HTMLElement;
|
||||
private readonly pickedColorNode: HTMLElement;
|
||||
private backgroundColor: Color;
|
||||
|
||||
constructor(container: HTMLElement, private model: ColorPickerModel, themeService: IThemeService) {
|
||||
constructor(container: HTMLElement, private readonly model: ColorPickerModel, themeService: IThemeService) {
|
||||
super();
|
||||
|
||||
this.domNode = $('.colorpicker-header');
|
||||
|
@ -63,12 +63,12 @@ export class ColorPickerHeader extends Disposable {
|
|||
|
||||
export class ColorPickerBody extends Disposable {
|
||||
|
||||
private domNode: HTMLElement;
|
||||
private saturationBox: SaturationBox;
|
||||
private hueStrip: Strip;
|
||||
private opacityStrip: Strip;
|
||||
private readonly domNode: HTMLElement;
|
||||
private readonly saturationBox: SaturationBox;
|
||||
private readonly hueStrip: Strip;
|
||||
private readonly opacityStrip: Strip;
|
||||
|
||||
constructor(container: HTMLElement, private model: ColorPickerModel, private pixelRatio: number) {
|
||||
constructor(container: HTMLElement, private readonly model: ColorPickerModel, private pixelRatio: number) {
|
||||
super();
|
||||
|
||||
this.domNode = $('.colorpicker-body');
|
||||
|
@ -120,9 +120,9 @@ export class ColorPickerBody extends Disposable {
|
|||
|
||||
class SaturationBox extends Disposable {
|
||||
|
||||
private domNode: HTMLElement;
|
||||
private selection: HTMLElement;
|
||||
private canvas: HTMLCanvasElement;
|
||||
private readonly domNode: HTMLElement;
|
||||
private readonly selection: HTMLElement;
|
||||
private readonly canvas: HTMLCanvasElement;
|
||||
private width: number;
|
||||
private height: number;
|
||||
|
||||
|
@ -133,7 +133,7 @@ class SaturationBox extends Disposable {
|
|||
private _onColorFlushed = new Emitter<void>();
|
||||
readonly onColorFlushed: Event<void> = this._onColorFlushed.event;
|
||||
|
||||
constructor(container: HTMLElement, private model: ColorPickerModel, private pixelRatio: number) {
|
||||
constructor(container: HTMLElement, private readonly model: ColorPickerModel, private pixelRatio: number) {
|
||||
super();
|
||||
|
||||
this.domNode = $('.saturation-wrap');
|
||||
|
@ -335,7 +335,7 @@ export class ColorPickerWidget extends Widget {
|
|||
|
||||
body: ColorPickerBody;
|
||||
|
||||
constructor(container: Node, private model: ColorPickerModel, private pixelRatio: number, themeService: IThemeService) {
|
||||
constructor(container: Node, private readonly model: ColorPickerModel, private pixelRatio: number, themeService: IThemeService) {
|
||||
super();
|
||||
|
||||
this._register(onDidChangeZoomLevel(() => this.layout()));
|
||||
|
|
|
@ -14,7 +14,7 @@ import { LanguageConfigurationRegistry } from 'vs/editor/common/modes/languageCo
|
|||
|
||||
export class BlockCommentCommand implements editorCommon.ICommand {
|
||||
|
||||
private _selection: Selection;
|
||||
private readonly _selection: Selection;
|
||||
private _usedEndToken: string | null;
|
||||
|
||||
constructor(selection: Selection) {
|
||||
|
|
|
@ -16,7 +16,7 @@ import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegis
|
|||
|
||||
abstract class CommentLineAction extends EditorAction {
|
||||
|
||||
private _type: Type;
|
||||
private readonly _type: Type;
|
||||
|
||||
constructor(type: Type, opts: IActionOptions) {
|
||||
super(opts);
|
||||
|
|
|
@ -48,12 +48,12 @@ export const enum Type {
|
|||
|
||||
export class LineCommentCommand implements editorCommon.ICommand {
|
||||
|
||||
private _selection: Selection;
|
||||
private readonly _selection: Selection;
|
||||
private _selectionId: string;
|
||||
private _deltaColumn: number;
|
||||
private _moveEndPositionDown: boolean;
|
||||
private _tabSize: number;
|
||||
private _type: Type;
|
||||
private readonly _tabSize: number;
|
||||
private readonly _type: Type;
|
||||
|
||||
constructor(selection: Selection, tabSize: number, type: Type) {
|
||||
this._selection = selection;
|
||||
|
|
|
@ -32,7 +32,7 @@ export class ContextMenuController implements IEditorContribution {
|
|||
|
||||
private _toDispose: IDisposable[] = [];
|
||||
private _contextMenuIsBeingShownCount: number = 0;
|
||||
private _editor: ICodeEditor;
|
||||
private readonly _editor: ICodeEditor;
|
||||
|
||||
constructor(
|
||||
editor: ICodeEditor,
|
||||
|
|
|
@ -32,7 +32,7 @@ export class DragAndDropController implements editorCommon.IEditorContribution {
|
|||
|
||||
private static readonly ID = 'editor.contrib.dragAndDrop';
|
||||
|
||||
private _editor: ICodeEditor;
|
||||
private readonly _editor: ICodeEditor;
|
||||
private _toUnhook: IDisposable[];
|
||||
private _dragSelection: Selection | null;
|
||||
private _dndDecorationIds: string[];
|
||||
|
|
|
@ -12,10 +12,10 @@ import { ITextModel } from 'vs/editor/common/model';
|
|||
|
||||
export class DragAndDropCommand implements editorCommon.ICommand {
|
||||
|
||||
private selection: Selection;
|
||||
private targetPosition: Position;
|
||||
private readonly selection: Selection;
|
||||
private readonly targetPosition: Position;
|
||||
private targetSelection: Selection;
|
||||
private copy: boolean;
|
||||
private readonly copy: boolean;
|
||||
|
||||
constructor(selection: Selection, targetPosition: Position, copy: boolean) {
|
||||
this.selection = selection;
|
||||
|
|
|
@ -71,12 +71,12 @@ export class CommonFindController extends Disposable implements editorCommon.IEd
|
|||
private static readonly ID = 'editor.contrib.findController';
|
||||
|
||||
protected _editor: ICodeEditor;
|
||||
private _findWidgetVisible: IContextKey<boolean>;
|
||||
private readonly _findWidgetVisible: IContextKey<boolean>;
|
||||
protected _state: FindReplaceState;
|
||||
protected _updateHistoryDelayer: Delayer<void>;
|
||||
private _model: FindModelBoundToEditorModel | null;
|
||||
private _storageService: IStorageService;
|
||||
private _clipboardService: IClipboardService;
|
||||
private readonly _storageService: IStorageService;
|
||||
private readonly _clipboardService: IClipboardService;
|
||||
protected readonly _contextKeyService: IContextKeyService;
|
||||
|
||||
public static get(editor: ICodeEditor): CommonFindController {
|
||||
|
|
|
@ -14,7 +14,7 @@ import { themeColorFromId } from 'vs/platform/theme/common/themeService';
|
|||
|
||||
export class FindDecorations implements IDisposable {
|
||||
|
||||
private _editor: IActiveCodeEditor;
|
||||
private readonly _editor: IActiveCodeEditor;
|
||||
private _decorations: string[];
|
||||
private _overviewRulerApproximateDecorations: string[];
|
||||
private _findScopeDecorationId: string | null;
|
||||
|
|
|
@ -69,14 +69,14 @@ const RESEARCH_DELAY = 240;
|
|||
|
||||
export class FindModelBoundToEditorModel {
|
||||
|
||||
private _editor: IActiveCodeEditor;
|
||||
private _state: FindReplaceState;
|
||||
private readonly _editor: IActiveCodeEditor;
|
||||
private readonly _state: FindReplaceState;
|
||||
private _toDispose: IDisposable[];
|
||||
private _decorations: FindDecorations;
|
||||
private readonly _decorations: FindDecorations;
|
||||
private _ignoreModelContentChanged: boolean;
|
||||
private _startSearchingTimer: TimeoutTimer;
|
||||
private readonly _startSearchingTimer: TimeoutTimer;
|
||||
|
||||
private _updateDecorationsScheduler: RunOnceScheduler;
|
||||
private readonly _updateDecorationsScheduler: RunOnceScheduler;
|
||||
private _isDisposed: boolean;
|
||||
|
||||
constructor(editor: IActiveCodeEditor, state: FindReplaceState) {
|
||||
|
|
|
@ -18,14 +18,14 @@ export class FindOptionsWidget extends Widget implements IOverlayWidget {
|
|||
|
||||
private static readonly ID = 'editor.contrib.findOptionsWidget';
|
||||
|
||||
private _editor: ICodeEditor;
|
||||
private _state: FindReplaceState;
|
||||
private _keybindingService: IKeybindingService;
|
||||
private readonly _editor: ICodeEditor;
|
||||
private readonly _state: FindReplaceState;
|
||||
private readonly _keybindingService: IKeybindingService;
|
||||
|
||||
private _domNode: HTMLElement;
|
||||
private regex: RegexCheckbox;
|
||||
private wholeWords: WholeWordsCheckbox;
|
||||
private caseSensitive: CaseSensitiveCheckbox;
|
||||
private readonly _domNode: HTMLElement;
|
||||
private readonly regex: RegexCheckbox;
|
||||
private readonly wholeWords: WholeWordsCheckbox;
|
||||
private readonly caseSensitive: CaseSensitiveCheckbox;
|
||||
|
||||
constructor(
|
||||
editor: ICodeEditor,
|
||||
|
|
|
@ -84,8 +84,8 @@ export class FindWidgetViewZone implements IViewZone {
|
|||
export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSashLayoutProvider {
|
||||
private static readonly ID = 'editor.contrib.findWidget';
|
||||
private readonly _codeEditor: ICodeEditor;
|
||||
private _state: FindReplaceState;
|
||||
private _controller: IFindController;
|
||||
private readonly _state: FindReplaceState;
|
||||
private readonly _controller: IFindController;
|
||||
private readonly _contextViewProvider: IContextViewProvider;
|
||||
private readonly _keybindingService: IKeybindingService;
|
||||
private readonly _contextKeyService: IContextKeyService;
|
||||
|
@ -107,16 +107,16 @@ export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSas
|
|||
private _isReplaceVisible: boolean;
|
||||
private _ignoreChangeEvent: boolean;
|
||||
|
||||
private _findFocusTracker: dom.IFocusTracker;
|
||||
private _findInputFocused: IContextKey<boolean>;
|
||||
private _replaceFocusTracker: dom.IFocusTracker;
|
||||
private _replaceInputFocused: IContextKey<boolean>;
|
||||
private readonly _findFocusTracker: dom.IFocusTracker;
|
||||
private readonly _findInputFocused: IContextKey<boolean>;
|
||||
private readonly _replaceFocusTracker: dom.IFocusTracker;
|
||||
private readonly _replaceInputFocused: IContextKey<boolean>;
|
||||
private _viewZone?: FindWidgetViewZone;
|
||||
private _viewZoneId?: number;
|
||||
|
||||
private _resizeSash: Sash;
|
||||
private _resized: boolean;
|
||||
private _updateHistoryDelayer: Delayer<void>;
|
||||
private readonly _updateHistoryDelayer: Delayer<void>;
|
||||
|
||||
constructor(
|
||||
codeEditor: ICodeEditor,
|
||||
|
|
|
@ -15,10 +15,10 @@ interface IEditOperation {
|
|||
|
||||
export class ReplaceAllCommand implements editorCommon.ICommand {
|
||||
|
||||
private _editorSelection: Selection;
|
||||
private readonly _editorSelection: Selection;
|
||||
private _trackedEditorSelectionId: string;
|
||||
private _ranges: Range[];
|
||||
private _replaceStrings: string[];
|
||||
private readonly _ranges: Range[];
|
||||
private readonly _replaceStrings: string[];
|
||||
|
||||
constructor(editorSelection: Selection, ranges: Range[], replaceStrings: string[]) {
|
||||
this._editorSelection = editorSelection;
|
||||
|
|
|
@ -25,13 +25,13 @@ const NLS_NEXT_MATCH_BTN_LABEL = nls.localize('label.nextMatchButton', "Next mat
|
|||
const NLS_CLOSE_BTN_LABEL = nls.localize('label.closeButton', "Close");
|
||||
|
||||
export abstract class SimpleFindWidget extends Widget {
|
||||
private _findInput: FindInput;
|
||||
private _domNode: HTMLElement;
|
||||
private _innerDomNode: HTMLElement;
|
||||
private readonly _findInput: FindInput;
|
||||
private readonly _domNode: HTMLElement;
|
||||
private readonly _innerDomNode: HTMLElement;
|
||||
private _isVisible: boolean = false;
|
||||
private _focusTracker: dom.IFocusTracker;
|
||||
private _findInputFocusTracker: dom.IFocusTracker;
|
||||
private _updateHistoryDelayer: Delayer<void>;
|
||||
private readonly _focusTracker: dom.IFocusTracker;
|
||||
private readonly _findInputFocusTracker: dom.IFocusTracker;
|
||||
private readonly _updateHistoryDelayer: Delayer<void>;
|
||||
|
||||
constructor(
|
||||
@IContextViewService private readonly _contextViewService: IContextViewService,
|
||||
|
|
|
@ -55,12 +55,12 @@ export class FoldingController implements IEditorContribution {
|
|||
return editor.getContribution<FoldingController>(ID);
|
||||
}
|
||||
|
||||
private editor: ICodeEditor;
|
||||
private readonly editor: ICodeEditor;
|
||||
private _isEnabled: boolean;
|
||||
private _autoHideFoldingControls: boolean;
|
||||
private _useFoldingProviders: boolean;
|
||||
|
||||
private foldingDecorationProvider: FoldingDecorationProvider;
|
||||
private readonly foldingDecorationProvider: FoldingDecorationProvider;
|
||||
|
||||
private foldingModel: FoldingModel | null;
|
||||
private hiddenRangeModel: HiddenRangeModel | null;
|
||||
|
|
|
@ -28,7 +28,7 @@ export class FoldingDecorationProvider implements IDecorationProvider {
|
|||
|
||||
public autoHideFoldingControls: boolean = true;
|
||||
|
||||
constructor(private editor: ICodeEditor) {
|
||||
constructor(private readonly editor: ICodeEditor) {
|
||||
}
|
||||
|
||||
getDecorationOption(isCollapsed: boolean): ModelDecorationOptions {
|
||||
|
|
|
@ -21,8 +21,8 @@ export interface FoldingModelChangeEvent {
|
|||
export type CollapseMemento = ILineRange[];
|
||||
|
||||
export class FoldingModel {
|
||||
private _textModel: ITextModel;
|
||||
private _decorationProvider: IDecorationProvider;
|
||||
private readonly _textModel: ITextModel;
|
||||
private readonly _decorationProvider: IDecorationProvider;
|
||||
|
||||
private _regions: FoldingRegions;
|
||||
private _editorDecorationIds: string[];
|
||||
|
|
|
@ -14,11 +14,11 @@ export const MAX_LINE_NUMBER = 0xFFFFFF;
|
|||
const MASK_INDENT = 0xFF000000;
|
||||
|
||||
export class FoldingRegions {
|
||||
private _startIndexes: Uint32Array;
|
||||
private _endIndexes: Uint32Array;
|
||||
private _collapseStates: Uint32Array;
|
||||
private readonly _startIndexes: Uint32Array;
|
||||
private readonly _endIndexes: Uint32Array;
|
||||
private readonly _collapseStates: Uint32Array;
|
||||
private _parentsComputed: boolean;
|
||||
private _types: Array<string | undefined> | undefined;
|
||||
private readonly _types: Array<string | undefined> | undefined;
|
||||
|
||||
constructor(startIndexes: Uint32Array, endIndexes: Uint32Array, types?: Array<string | undefined>) {
|
||||
if (startIndexes.length !== endIndexes.length || startIndexes.length > MAX_FOLDING_REGIONS) {
|
||||
|
@ -154,7 +154,7 @@ export class FoldingRegions {
|
|||
|
||||
export class FoldingRegion {
|
||||
|
||||
constructor(private ranges: FoldingRegions, private index: number) {
|
||||
constructor(private readonly ranges: FoldingRegions, private index: number) {
|
||||
}
|
||||
|
||||
public get startLineNumber() {
|
||||
|
|
|
@ -11,7 +11,7 @@ import { Selection } from 'vs/editor/common/core/selection';
|
|||
import { findFirstInSorted } from 'vs/base/common/arrays';
|
||||
|
||||
export class HiddenRangeModel {
|
||||
private _foldingModel: FoldingModel;
|
||||
private readonly _foldingModel: FoldingModel;
|
||||
private _hiddenRanges: IRange[];
|
||||
private _foldingModelListener: IDisposable | null;
|
||||
private _updateEventEmitter = new Emitter<IRange[]>();
|
||||
|
|
|
@ -20,7 +20,7 @@ export class IndentRangeProvider implements RangeProvider {
|
|||
|
||||
readonly decorations;
|
||||
|
||||
constructor(private editorModel: ITextModel) {
|
||||
constructor(private readonly editorModel: ITextModel) {
|
||||
}
|
||||
|
||||
dispose() {
|
||||
|
@ -36,11 +36,11 @@ export class IndentRangeProvider implements RangeProvider {
|
|||
|
||||
// public only for testing
|
||||
export class RangesCollector {
|
||||
private _startIndexes: number[];
|
||||
private _endIndexes: number[];
|
||||
private _indentOccurrences: number[];
|
||||
private readonly _startIndexes: number[];
|
||||
private readonly _endIndexes: number[];
|
||||
private readonly _indentOccurrences: number[];
|
||||
private _length: number;
|
||||
private _foldingRangesLimit: number;
|
||||
private readonly _foldingRangesLimit: number;
|
||||
|
||||
constructor(foldingRangesLimit: number) {
|
||||
this._startIndexes = [];
|
||||
|
|
|
@ -17,7 +17,7 @@ export class InitializingRangeProvider implements RangeProvider {
|
|||
private decorationIds: string[] | undefined;
|
||||
private timeout: any;
|
||||
|
||||
constructor(private editorModel: ITextModel, initialRanges: ILineRange[], onTimeout: () => void, timeoutTime: number) {
|
||||
constructor(private readonly editorModel: ITextModel, initialRanges: ILineRange[], onTimeout: () => void, timeoutTime: number) {
|
||||
if (initialRanges.length) {
|
||||
let toDecorationRange = (range: ILineRange): IModelDeltaDecoration => {
|
||||
return {
|
||||
|
|
|
@ -25,7 +25,7 @@ export class SyntaxRangeProvider implements RangeProvider {
|
|||
|
||||
readonly id = ID_SYNTAX_PROVIDER;
|
||||
|
||||
constructor(private editorModel: ITextModel, private providers: FoldingRangeProvider[], private limit = MAX_FOLDING_REGIONS) {
|
||||
constructor(private readonly editorModel: ITextModel, private providers: FoldingRangeProvider[], private limit = MAX_FOLDING_REGIONS) {
|
||||
}
|
||||
|
||||
compute(cancellationToken: CancellationToken): Promise<FoldingRegions | null> {
|
||||
|
@ -69,13 +69,13 @@ function collectSyntaxRanges(providers: FoldingRangeProvider[], model: ITextMode
|
|||
}
|
||||
|
||||
export class RangesCollector {
|
||||
private _startIndexes: number[];
|
||||
private _endIndexes: number[];
|
||||
private _nestingLevels: number[];
|
||||
private _nestingLevelCounts: number[];
|
||||
private _types: Array<string | undefined>;
|
||||
private readonly _startIndexes: number[];
|
||||
private readonly _endIndexes: number[];
|
||||
private readonly _nestingLevels: number[];
|
||||
private readonly _nestingLevelCounts: number[];
|
||||
private readonly _types: Array<string | undefined>;
|
||||
private _length: number;
|
||||
private _foldingRangesLimit: number;
|
||||
private readonly _foldingRangesLimit: number;
|
||||
|
||||
constructor(foldingRangesLimit: number) {
|
||||
this._startIndexes = [];
|
||||
|
|
|
@ -31,7 +31,7 @@ class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorC
|
|||
private static readonly ID = 'editor.contrib.gotodefinitionwithmouse';
|
||||
static MAX_SOURCE_PREVIEW_LINES = 8;
|
||||
|
||||
private editor: ICodeEditor;
|
||||
private readonly editor: ICodeEditor;
|
||||
private toUnhook: IDisposable[];
|
||||
private decorations: string[];
|
||||
private currentWordUnderMouse: IWordAtPosition | null;
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue