From d8e926be9721e35573dc475b3fbaabfb5d8be7d1 Mon Sep 17 00:00:00 2001 From: Matt Bierner Date: Mon, 20 Nov 2017 15:18:52 -0800 Subject: [PATCH] Mark most private static constants as private static readonly --- extensions/git/src/autofetch.ts | 2 +- src/vs/base/browser/touch.ts | 4 +- .../browser/ui/contextview/contextview.ts | 4 +- .../ui/resourceviewer/resourceViewer.ts | 10 ++--- src/vs/base/browser/ui/splitview/panelview.ts | 4 +- src/vs/base/common/event.ts | 2 +- src/vs/base/common/map.ts | 4 +- src/vs/base/common/uuid.ts | 4 +- src/vs/base/node/processes.ts | 2 +- src/vs/base/parts/ipc/node/ipc.net.ts | 2 +- .../quickopen/browser/quickOpenWidget.ts | 4 +- .../contrib/nodeCachedDataCleaner.ts | 2 +- src/vs/code/electron-main/app.ts | 2 +- src/vs/code/electron-main/keyboard.ts | 2 +- src/vs/code/electron-main/menus.ts | 2 +- src/vs/code/electron-main/window.ts | 10 ++--- src/vs/code/electron-main/windows.ts | 4 +- .../editor/browser/controller/mouseHandler.ts | 2 +- .../browser/controller/textAreaState.ts | 2 +- src/vs/editor/browser/view/viewLayer.ts | 2 +- .../browser/viewParts/lines/viewLines.ts | 2 +- .../viewParts/selections/selections.ts | 14 +++---- .../editor/browser/widget/diffEditorWidget.ts | 4 +- .../editor/common/model/editableTextModel.ts | 2 +- src/vs/editor/common/model/textModel.ts | 6 +-- .../common/model/textModelWithTokens.ts | 2 +- .../common/services/editorSimpleWorker.ts | 2 +- .../bracketMatching/bracketMatching.ts | 4 +- .../test/bracketMatching.test.ts | 2 +- .../contrib/colorPicker/colorPickerWidget.ts | 2 +- .../editor/contrib/contextmenu/contextmenu.ts | 2 +- .../editor/contrib/cursorUndo/cursorUndo.ts | 2 +- src/vs/editor/contrib/dnd/dnd.ts | 4 +- src/vs/editor/contrib/find/findController.ts | 2 +- src/vs/editor/contrib/find/findDecorations.ts | 12 +++--- .../editor/contrib/find/findOptionsWidget.ts | 2 +- src/vs/editor/contrib/find/findWidget.ts | 2 +- src/vs/editor/contrib/folding/folding.ts | 2 +- src/vs/editor/contrib/format/formatActions.ts | 4 +- .../goToDeclaration/goToDeclarationMouse.ts | 2 +- src/vs/editor/contrib/gotoError/gotoError.ts | 2 +- src/vs/editor/contrib/hover/hover.ts | 2 +- .../editor/contrib/hover/modesContentHover.ts | 2 +- .../contrib/inPlaceReplace/inPlaceReplace.ts | 4 +- .../editor/contrib/indentation/indentation.ts | 2 +- .../test/moveLinesCommand.test.ts | 2 +- .../contrib/message/messageController.ts | 2 +- .../editor/contrib/multicursor/multicursor.ts | 8 ++-- .../contrib/parameterHints/parameterHints.ts | 2 +- .../parameterHints/parameterHintsWidget.ts | 2 +- .../contrib/quickFix/quickFixCommands.ts | 2 +- .../referenceSearch/referenceSearch.ts | 2 +- .../referenceSearch/referencesController.ts | 2 +- .../referenceSearch/referencesWidget.ts | 4 +- src/vs/editor/contrib/rename/rename.ts | 2 +- .../editor/contrib/smartSelect/smartSelect.ts | 2 +- .../test/tokenSelectionSupport.test.ts | 2 +- .../wordHighlighter/wordHighlighter.ts | 8 ++-- .../editor/contrib/zoneWidget/zoneWidget.ts | 2 +- .../accessibilityHelp/accessibilityHelp.ts | 8 ++-- .../iPadShowKeyboard/iPadShowKeyboard.ts | 4 +- .../browser/inspectTokens/inspectTokens.ts | 4 +- .../browser/quickOpen/editorQuickOpen.ts | 4 +- .../quickOpen/quickOpenEditorWidget.ts | 2 +- .../standalone/browser/simpleServices.ts | 2 +- .../standalone/common/monarch/monarchLexer.ts | 4 +- .../browser/commands/shiftCommand.test.ts | 2 +- .../test/browser/controller/cursor.test.ts | 14 +++---- src/vs/editor/test/common/commentMode.ts | 2 +- .../common/modes/textToHtmlTokenizer.test.ts | 2 +- .../electron-main/historyMainService.ts | 6 +-- .../integrity/node/integrityServiceImpl.ts | 2 +- .../lifecycle/electron-main/lifecycleMain.ts | 2 +- .../electron-browser/mainThreadTelemetry.ts | 2 +- .../workbench/api/node/extHostTextEditor.ts | 2 +- .../actions/toggleActivityBarVisibility.ts | 2 +- .../browser/actions/toggleSidebarPosition.ts | 2 +- .../actions/toggleStatusbarVisibility.ts | 2 +- .../browser/actions/toggleTabsVisibility.ts | 2 +- src/vs/workbench/browser/layout.ts | 8 ++-- .../parts/activitybar/activitybarActions.ts | 2 +- .../parts/activitybar/activitybarPart.ts | 2 +- .../parts/editor/editorGroupsControl.ts | 16 +++---- .../browser/parts/editor/editorPart.ts | 14 +++---- .../browser/parts/editor/rangeDecorations.ts | 4 +- .../browser/parts/editor/textDiffEditor.ts | 6 +-- .../browser/parts/panel/panelActions.ts | 8 ++-- .../parts/quickopen/quickOpenController.ts | 4 +- .../browser/parts/statusbar/statusbarPart.ts | 4 +- .../browser/parts/titlebar/titlebarPart.ts | 8 ++-- .../workbench/browser/parts/views/treeView.ts | 4 +- .../common/editor/editorStacksModel.ts | 2 +- src/vs/workbench/common/memento.ts | 2 +- src/vs/workbench/electron-browser/actions.ts | 12 +++--- src/vs/workbench/electron-browser/window.ts | 2 +- .../workbench/electron-browser/workbench.ts | 20 ++++----- .../electron-browser/accessibility.ts | 8 ++-- .../electron-browser/menuPreventer.ts | 2 +- .../electron-browser/selectionClipboard.ts | 2 +- .../textMate/inspectTMScopes.ts | 4 +- .../toggleMultiCursorModifier.ts | 2 +- .../electron-browser/toggleWordWrap.ts | 2 +- .../electron-browser/wordWrapMigration.ts | 4 +- .../parts/debug/browser/debugActionItems.ts | 2 +- .../parts/debug/browser/debugActionsWidget.ts | 2 +- .../parts/debug/common/debugModel.ts | 4 +- .../debug/electron-browser/debugViewer.ts | 24 +++++------ .../debug/electron-browser/debugViews.ts | 10 ++--- .../parts/debug/electron-browser/repl.ts | 8 ++-- .../debug/electron-browser/replViewer.ts | 10 ++--- .../statusbarColorProvider.ts | 2 +- .../workbench/parts/debug/node/v8Protocol.ts | 2 +- .../electron-browser/terminalService.ts | 6 +-- .../extensions/browser/dependenciesViewer.ts | 4 +- .../extensions/browser/extensionsActions.ts | 42 +++++++++---------- .../node/extensionsWorkbenchService.ts | 2 +- .../files/electron-browser/explorerViewlet.ts | 2 +- .../files/electron-browser/fileActions.ts | 6 +-- .../electron-browser/views/explorerView.ts | 8 ++-- .../electron-browser/views/explorerViewer.ts | 8 ++-- .../electron-browser/views/openEditorsView.ts | 4 +- .../views/openEditorsViewer.ts | 4 +- .../markers/browser/markersTreeViewer.ts | 6 +-- .../parts/output/browser/outputServices.ts | 2 +- .../parts/output/common/outputLinkProvider.ts | 2 +- .../preferences/browser/keybindingWidgets.ts | 6 +-- .../browser/keybindingsEditorContribution.ts | 2 +- .../browser/preferencesRenderers.ts | 12 +++--- .../electron-browser/dirtydiffDecorator.ts | 2 +- .../parts/scm/electron-browser/scmActivity.ts | 4 +- .../search/browser/openAnythingHandler.ts | 8 ++-- .../parts/search/browser/openSymbolHandler.ts | 2 +- .../parts/search/browser/searchResultsView.ts | 8 ++-- .../parts/search/browser/searchViewlet.ts | 4 +- .../parts/search/browser/searchWidget.ts | 4 +- .../parts/search/common/searchModel.ts | 6 +-- .../electron-browser/insertSnippet.ts | 2 +- .../electron-browser/tabCompletion.ts | 2 +- .../parts/tasks/browser/quickOpen.ts | 4 +- .../electron-browser/task.contribution.ts | 6 +-- ...supportedWorkspaceSettings.contribution.ts | 2 +- .../parts/update/electron-browser/update.ts | 8 ++-- .../electron-browser/gettingStarted.ts | 2 +- .../configuration/node/configuration.ts | 2 +- .../files/electron-browser/fileService.ts | 4 +- .../services/files/node/fileService.ts | 4 +- .../node/watcher/nsfw/nsfwWatcherService.ts | 2 +- .../files/node/watcher/nsfw/watcherService.ts | 2 +- .../watcher/unix/chokidarWatcherService.ts | 4 +- .../files/node/watcher/unix/watcherService.ts | 2 +- .../watcher/win32/csharpWatcherService.ts | 2 +- .../history/electron-browser/history.ts | 10 ++--- .../services/search/node/rawSearchService.ts | 6 +-- .../services/search/node/ripgrepTextSearch.ts | 4 +- .../services/search/node/textSearch.ts | 2 +- .../electron-browser/textFileService.ts | 2 +- .../workspace/node/workspaceEditingService.ts | 2 +- test/smoke/src/areas/editor/editor.ts | 8 ++-- test/smoke/src/areas/editor/peek.ts | 8 ++-- test/smoke/src/areas/explorer/explorer.ts | 4 +- test/smoke/src/helpers/screenshot.ts | 2 +- test/smoke/src/spectron/application.ts | 2 +- 162 files changed, 363 insertions(+), 363 deletions(-) diff --git a/extensions/git/src/autofetch.ts b/extensions/git/src/autofetch.ts index a984a20c6b6..741188de75d 100644 --- a/extensions/git/src/autofetch.ts +++ b/extensions/git/src/autofetch.ts @@ -12,7 +12,7 @@ import { eventToPromise, filterEvent } from './util'; export class AutoFetcher { - private static Period = 3 * 60 * 1000 /* three minutes */; + private static readonly Period = 3 * 60 * 1000 /* three minutes */; private _onDidChange = new EventEmitter(); private onDidChange = this._onDidChange.event; diff --git a/src/vs/base/browser/touch.ts b/src/vs/base/browser/touch.ts index f30394017ec..27b3fb546bf 100644 --- a/src/vs/base/browser/touch.ts +++ b/src/vs/base/browser/touch.ts @@ -67,8 +67,8 @@ interface TouchEvent extends Event { export class Gesture implements IDisposable { - private static HOLD_DELAY = 700; - private static SCROLL_FRICTION = -0.005; + private static readonly HOLD_DELAY = 700; + private static readonly SCROLL_FRICTION = -0.005; private targetElement: HTMLElement; private callOnTarget: IDisposable[]; diff --git a/src/vs/base/browser/ui/contextview/contextview.ts b/src/vs/base/browser/ui/contextview/contextview.ts index f6ee0abf9d8..ce822b10a45 100644 --- a/src/vs/base/browser/ui/contextview/contextview.ts +++ b/src/vs/base/browser/ui/contextview/contextview.ts @@ -104,8 +104,8 @@ function layout(view: ISize, around: IView, viewport: IView, anchorPosition: Anc export class ContextView { - private static BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur']; - private static BUBBLE_DOWN_EVENTS = ['click']; + private static readonly BUBBLE_UP_EVENTS = ['click', 'keydown', 'focus', 'blur']; + private static readonly BUBBLE_DOWN_EVENTS = ['click']; private $container: Builder; private $view: Builder; diff --git a/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts b/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts index 543e921c680..9f1e41502d2 100644 --- a/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts +++ b/src/vs/base/browser/ui/resourceviewer/resourceViewer.ts @@ -110,12 +110,12 @@ function imageSrc(descriptor: IResourceDescriptor): string { */ export class ResourceViewer { - private static KB = 1024; - private static MB = ResourceViewer.KB * ResourceViewer.KB; - private static GB = ResourceViewer.MB * ResourceViewer.KB; - private static TB = ResourceViewer.GB * ResourceViewer.KB; + private static readonly KB = 1024; + private static readonly MB = ResourceViewer.KB * ResourceViewer.KB; + private static readonly GB = ResourceViewer.MB * ResourceViewer.KB; + private static readonly TB = ResourceViewer.GB * ResourceViewer.KB; - private static MAX_IMAGE_SIZE = ResourceViewer.MB; // showing images inline is memory intense, so we have a limit + private static readonly MAX_IMAGE_SIZE = ResourceViewer.MB; // showing images inline is memory intense, so we have a limit public static show( descriptor: IResourceDescriptor, diff --git a/src/vs/base/browser/ui/splitview/panelview.ts b/src/vs/base/browser/ui/splitview/panelview.ts index bd225da8d24..eafc85d142a 100644 --- a/src/vs/base/browser/ui/splitview/panelview.ts +++ b/src/vs/base/browser/ui/splitview/panelview.ts @@ -32,7 +32,7 @@ export interface IPanelStyles { export abstract class Panel implements IView { - private static HEADER_SIZE = 22; + private static readonly HEADER_SIZE = 22; protected _expanded: boolean; private expandedSize: number | undefined = undefined; @@ -226,7 +226,7 @@ interface IDndContext { class PanelDraggable implements IDisposable { - private static DefaultDragOverBackgroundColor = new Color(new RGBA(128, 128, 128, 0.5)); + private static readonly DefaultDragOverBackgroundColor = new Color(new RGBA(128, 128, 128, 0.5)); // see https://github.com/Microsoft/vscode/issues/14470 private dragOverCounter = 0; diff --git a/src/vs/base/common/event.ts b/src/vs/base/common/event.ts index ca48a8ff9b9..2f67b009aa5 100644 --- a/src/vs/base/common/event.ts +++ b/src/vs/base/common/event.ts @@ -57,7 +57,7 @@ export interface EmitterOptions { */ export class Emitter { - private static _noop = function () { }; + private static readonly _noop = function () { }; private _event: Event; private _listeners: LinkedList; diff --git a/src/vs/base/common/map.ts b/src/vs/base/common/map.ts index e5b413dde70..04186a763cd 100644 --- a/src/vs/base/common/map.ts +++ b/src/vs/base/common/map.ts @@ -78,8 +78,8 @@ export class StringIterator implements IKeyIterator { export class PathIterator implements IKeyIterator { - private static _fwd = '/'.charCodeAt(0); - private static _bwd = '\\'.charCodeAt(0); + private static readonly _fwd = '/'.charCodeAt(0); + private static readonly _bwd = '\\'.charCodeAt(0); private _value: string; private _from: number; diff --git a/src/vs/base/common/uuid.ts b/src/vs/base/common/uuid.ts index 704882a545c..0ea80f24c49 100644 --- a/src/vs/base/common/uuid.ts +++ b/src/vs/base/common/uuid.ts @@ -28,9 +28,9 @@ class ValueUUID implements UUID { class V4UUID extends ValueUUID { - private static _chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; + private static readonly _chars = ['0', '1', '2', '3', '4', '5', '6', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f']; - private static _timeHighBits = ['8', '9', 'a', 'b']; + private static readonly _timeHighBits = ['8', '9', 'a', 'b']; private static _oneOf(array: string[]): string { return array[Math.floor(array.length * Math.random())]; diff --git a/src/vs/base/node/processes.ts b/src/vs/base/node/processes.ts index 22c6164f4c8..7aa6034bba6 100644 --- a/src/vs/base/node/processes.ts +++ b/src/vs/base/node/processes.ts @@ -275,7 +275,7 @@ export abstract class AbstractProcess { // Default is to do nothing. } - private static regexp = /^[^"].* .*[^"]/; + private static readonly regexp = /^[^"].* .*[^"]/; private ensureQuotes(value: string) { if (AbstractProcess.regexp.test(value)) { return { diff --git a/src/vs/base/parts/ipc/node/ipc.net.ts b/src/vs/base/parts/ipc/node/ipc.net.ts index a080e193cb7..95d16bf6d81 100644 --- a/src/vs/base/parts/ipc/node/ipc.net.ts +++ b/src/vs/base/parts/ipc/node/ipc.net.ts @@ -25,7 +25,7 @@ export function generateRandomPipeName(): string { export class Protocol implements IMessagePassingProtocol { - private static _headerLen = 17; + private static readonly _headerLen = 17; private _onMessage = new Emitter(); diff --git a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts index 6a0ed9e9a70..0fa4964c675 100644 --- a/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts +++ b/src/vs/base/parts/quickopen/browser/quickOpenWidget.ts @@ -95,8 +95,8 @@ const DEFAULT_INPUT_ARIA_LABEL = nls.localize('quickOpenAriaLabel', "Quick picke export class QuickOpenWidget implements IModelProvider { - private static MAX_WIDTH = 600; // Max total width of quick open widget - private static MAX_ITEMS_HEIGHT = 20 * 22; // Max height of item list below input field + private static readonly MAX_WIDTH = 600; // Max total width of quick open widget + private static readonly MAX_ITEMS_HEIGHT = 20 * 22; // Max height of item list below input field private isDisposed: boolean; private options: IQuickOpenOptions; diff --git a/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts b/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts index 2f56affc386..1b9fb52e8ab 100644 --- a/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts +++ b/src/vs/code/electron-browser/contrib/nodeCachedDataCleaner.ts @@ -14,7 +14,7 @@ import product from 'vs/platform/node/product'; export class NodeCachedDataCleaner { - private static _DataMaxAge = product.nameLong.indexOf('Insiders') >= 0 + private static readonly _DataMaxAge = product.nameLong.indexOf('Insiders') >= 0 ? 1000 * 60 * 60 * 24 * 7 // roughly 1 week : 1000 * 60 * 60 * 24 * 30 * 3; // roughly 3 months diff --git a/src/vs/code/electron-main/app.ts b/src/vs/code/electron-main/app.ts index 7ff0d490785..71b1557292d 100644 --- a/src/vs/code/electron-main/app.ts +++ b/src/vs/code/electron-main/app.ts @@ -56,7 +56,7 @@ import { touch } from 'vs/base/node/pfs'; export class CodeApplication { - private static APP_ICON_REFRESH_KEY = 'macOSAppIconRefresh3'; + private static readonly APP_ICON_REFRESH_KEY = 'macOSAppIconRefresh3'; private toDispose: IDisposable[]; private windowsMainService: IWindowsMainService; diff --git a/src/vs/code/electron-main/keyboard.ts b/src/vs/code/electron-main/keyboard.ts index d7d10e70d7b..fbec79fd50f 100644 --- a/src/vs/code/electron-main/keyboard.ts +++ b/src/vs/code/electron-main/keyboard.ts @@ -48,7 +48,7 @@ export interface IKeybinding { export class KeybindingsResolver { - private static lastKnownKeybindingsMapStorageKey = 'lastKnownKeybindings'; + private static readonly lastKnownKeybindingsMapStorageKey = 'lastKnownKeybindings'; private commandIds: Set; private keybindings: { [commandId: string]: IKeybinding }; diff --git a/src/vs/code/electron-main/menus.ts b/src/vs/code/electron-main/menus.ts index 2a978aaa8e4..4e437f30c19 100644 --- a/src/vs/code/electron-main/menus.ts +++ b/src/vs/code/electron-main/menus.ts @@ -38,7 +38,7 @@ const telemetryFrom = 'menu'; export class CodeMenu { - private static MAX_MENU_RECENT_ENTRIES = 10; + private static readonly MAX_MENU_RECENT_ENTRIES = 10; private keys = [ 'files.autoSave', diff --git a/src/vs/code/electron-main/window.ts b/src/vs/code/electron-main/window.ts index 7af88a8432c..f89884a9179 100644 --- a/src/vs/code/electron-main/window.ts +++ b/src/vs/code/electron-main/window.ts @@ -75,12 +75,12 @@ export class CodeWindow implements ICodeWindow { public static readonly themeStorageKey = 'theme'; public static readonly themeBackgroundStorageKey = 'themeBackground'; - private static DEFAULT_BG_LIGHT = '#FFFFFF'; - private static DEFAULT_BG_DARK = '#1E1E1E'; - private static DEFAULT_BG_HC_BLACK = '#000000'; + private static readonly DEFAULT_BG_LIGHT = '#FFFFFF'; + private static readonly DEFAULT_BG_DARK = '#1E1E1E'; + private static readonly DEFAULT_BG_HC_BLACK = '#000000'; - private static MIN_WIDTH = 200; - private static MIN_HEIGHT = 120; + private static readonly MIN_WIDTH = 200; + private static readonly MIN_HEIGHT = 120; private hiddenTitleBarStyle: boolean; private showTimeoutHandle: any; diff --git a/src/vs/code/electron-main/windows.ts b/src/vs/code/electron-main/windows.ts index 52acb412424..14825f0daf4 100644 --- a/src/vs/code/electron-main/windows.ts +++ b/src/vs/code/electron-main/windows.ts @@ -107,7 +107,7 @@ export class WindowsManager implements IWindowsMainService { _serviceBrand: any; - private static windowsStateStorageKey = 'windowsState'; + private static readonly windowsStateStorageKey = 'windowsState'; private static WINDOWS: CodeWindow[] = []; @@ -1582,7 +1582,7 @@ interface IInternalNativeOpenDialogOptions extends INativeOpenDialogOptions { class FileDialog { - private static workingDirPickerStorageKey = 'pickerWorkingDir'; + private static readonly workingDirPickerStorageKey = 'pickerWorkingDir'; constructor( private environmentService: IEnvironmentService, diff --git a/src/vs/editor/browser/controller/mouseHandler.ts b/src/vs/editor/browser/controller/mouseHandler.ts index 982043e7e5f..efe3c993f16 100644 --- a/src/vs/editor/browser/controller/mouseHandler.ts +++ b/src/vs/editor/browser/controller/mouseHandler.ts @@ -494,7 +494,7 @@ class MouseDownOperation extends Disposable { class MouseDownState { - private static CLEAR_MOUSE_DOWN_COUNT_TIME = 400; // ms + private static readonly CLEAR_MOUSE_DOWN_COUNT_TIME = 400; // ms private _altKey: boolean; public get altKey(): boolean { return this._altKey; } diff --git a/src/vs/editor/browser/controller/textAreaState.ts b/src/vs/editor/browser/controller/textAreaState.ts index 1ed13e35d2c..f3016187590 100644 --- a/src/vs/editor/browser/controller/textAreaState.ts +++ b/src/vs/editor/browser/controller/textAreaState.ts @@ -215,7 +215,7 @@ export class TextAreaState { } export class PagedScreenReaderStrategy { - private static _LINES_PER_PAGE = 10; + private static readonly _LINES_PER_PAGE = 10; private static _getPageOfLine(lineNumber: number): number { return Math.floor((lineNumber - 1) / PagedScreenReaderStrategy._LINES_PER_PAGE); diff --git a/src/vs/editor/browser/view/viewLayer.ts b/src/vs/editor/browser/view/viewLayer.ts index e323b4f9109..d895de58a98 100644 --- a/src/vs/editor/browser/view/viewLayer.ts +++ b/src/vs/editor/browser/view/viewLayer.ts @@ -535,7 +535,7 @@ class ViewLayerRenderer { } } - private static _sb = createStringBuilder(100000); + private static readonly _sb = createStringBuilder(100000); private _finishRendering(ctx: IRendererContext, domNodeIsEmpty: boolean, deltaTop: number[]): void { diff --git a/src/vs/editor/browser/viewParts/lines/viewLines.ts b/src/vs/editor/browser/viewParts/lines/viewLines.ts index 1979f4da935..762433ff412 100644 --- a/src/vs/editor/browser/viewParts/lines/viewLines.ts +++ b/src/vs/editor/browser/viewParts/lines/viewLines.ts @@ -60,7 +60,7 @@ export class ViewLines extends ViewPart implements IVisibleLinesHost, /** * Adds this ammount of pixels to the right of lines (no-one wants to type near the edge of the viewport) */ - private static HORIZONTAL_EXTRA_PX = 30; + private static readonly HORIZONTAL_EXTRA_PX = 30; private readonly _linesContent: FastDomNode; private readonly _textRangeRestingSpot: HTMLElement; diff --git a/src/vs/editor/browser/viewParts/selections/selections.ts b/src/vs/editor/browser/viewParts/selections/selections.ts index e8df43bc602..13fe621bd2b 100644 --- a/src/vs/editor/browser/viewParts/selections/selections.ts +++ b/src/vs/editor/browser/viewParts/selections/selections.ts @@ -66,14 +66,14 @@ const isIEWithZoomingIssuesNearRoundedBorders = browser.isEdgeOrIE; export class SelectionsOverlay extends DynamicViewOverlay { - private static SELECTION_CLASS_NAME = 'selected-text'; - private static SELECTION_TOP_LEFT = 'top-left-radius'; - private static SELECTION_BOTTOM_LEFT = 'bottom-left-radius'; - private static SELECTION_TOP_RIGHT = 'top-right-radius'; - private static SELECTION_BOTTOM_RIGHT = 'bottom-right-radius'; - private static EDITOR_BACKGROUND_CLASS_NAME = 'monaco-editor-background'; + private static readonly SELECTION_CLASS_NAME = 'selected-text'; + private static readonly SELECTION_TOP_LEFT = 'top-left-radius'; + private static readonly SELECTION_BOTTOM_LEFT = 'bottom-left-radius'; + private static readonly SELECTION_TOP_RIGHT = 'top-right-radius'; + private static readonly SELECTION_BOTTOM_RIGHT = 'bottom-right-radius'; + private static readonly EDITOR_BACKGROUND_CLASS_NAME = 'monaco-editor-background'; - private static ROUNDED_PIECE_WIDTH = 10; + private static readonly ROUNDED_PIECE_WIDTH = 10; private _context: ViewContext; private _lineHeight: number; diff --git a/src/vs/editor/browser/widget/diffEditorWidget.ts b/src/vs/editor/browser/widget/diffEditorWidget.ts index e23bc31b2fc..34bfc9c3f15 100644 --- a/src/vs/editor/browser/widget/diffEditorWidget.ts +++ b/src/vs/editor/browser/widget/diffEditorWidget.ts @@ -137,9 +137,9 @@ let DIFF_EDITOR_ID = 0; export class DiffEditorWidget extends Disposable implements editorBrowser.IDiffEditor { - private static ONE_OVERVIEW_WIDTH = 15; + private static readonly ONE_OVERVIEW_WIDTH = 15; public static readonly ENTIRE_DIFF_OVERVIEW_WIDTH = 30; - private static UPDATE_DIFF_DECORATIONS_DELAY = 200; // ms + private static readonly UPDATE_DIFF_DECORATIONS_DELAY = 200; // ms private readonly _onDidDispose: Emitter = this._register(new Emitter()); public readonly onDidDispose: Event = this._onDidDispose.event; diff --git a/src/vs/editor/common/model/editableTextModel.ts b/src/vs/editor/common/model/editableTextModel.ts index 47ae67b6b5d..f91f7844d95 100644 --- a/src/vs/editor/common/model/editableTextModel.ts +++ b/src/vs/editor/common/model/editableTextModel.ts @@ -727,7 +727,7 @@ export class EditableTextModel extends TextModelWithDecorations implements edito }); } - private static _DECORATION_OPTION = ModelDecorationOptions.register({ + private static readonly _DECORATION_OPTION = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.AlwaysGrowsWhenTypingAtEdges }); diff --git a/src/vs/editor/common/model/textModel.ts b/src/vs/editor/common/model/textModel.ts index 167bffc42ea..b144154c927 100644 --- a/src/vs/editor/common/model/textModel.ts +++ b/src/vs/editor/common/model/textModel.ts @@ -28,9 +28,9 @@ export interface ITextModelCreationData { } export class TextModel extends Disposable implements editorCommon.ITextModel { - private static MODEL_SYNC_LIMIT = 50 * 1024 * 1024; // 50 MB - private static MODEL_TOKENIZATION_LIMIT = 20 * 1024 * 1024; // 20 MB - private static MANY_MANY_LINES = 300 * 1000; // 300K lines + private static readonly MODEL_SYNC_LIMIT = 50 * 1024 * 1024; // 50 MB + private static readonly MODEL_TOKENIZATION_LIMIT = 20 * 1024 * 1024; // 20 MB + private static readonly MANY_MANY_LINES = 300 * 1000; // 300K lines public static DEFAULT_CREATION_OPTIONS: editorCommon.ITextModelCreationOptions = { tabSize: EDITOR_MODEL_DEFAULTS.tabSize, diff --git a/src/vs/editor/common/model/textModelWithTokens.ts b/src/vs/editor/common/model/textModelWithTokens.ts index a1ad4ea52b4..4e1404c0fa5 100644 --- a/src/vs/editor/common/model/textModelWithTokens.ts +++ b/src/vs/editor/common/model/textModelWithTokens.ts @@ -62,7 +62,7 @@ class ModelTokensChangedEventBuilder { export class TextModelWithTokens extends TextModel implements editorCommon.ITokenizedModel { - private static MODE_TOKENIZATION_FAILED_MSG = nls.localize('mode.tokenizationSupportFailed', "The mode has failed while tokenizing the input."); + private static readonly MODE_TOKENIZATION_FAILED_MSG = nls.localize('mode.tokenizationSupportFailed', "The mode has failed while tokenizing the input."); private readonly _onDidChangeLanguage: Emitter = this._register(new Emitter()); public readonly onDidChangeLanguage: Event = this._onDidChangeLanguage.event; diff --git a/src/vs/editor/common/services/editorSimpleWorker.ts b/src/vs/editor/common/services/editorSimpleWorker.ts index 2fb6bc92b07..169df1f0de1 100644 --- a/src/vs/editor/common/services/editorSimpleWorker.ts +++ b/src/vs/editor/common/services/editorSimpleWorker.ts @@ -342,7 +342,7 @@ export abstract class BaseEditorSimpleWorker { // ---- BEGIN minimal edits --------------------------------------------------------------- - private static _diffLimit = 10000; + private static readonly _diffLimit = 10000; public computeMoreMinimalEdits(modelUrl: string, edits: TextEdit[]): TPromise { const model = this._getModel(modelUrl); diff --git a/src/vs/editor/contrib/bracketMatching/bracketMatching.ts b/src/vs/editor/contrib/bracketMatching/bracketMatching.ts index a69964423ed..fbd1a37d39c 100644 --- a/src/vs/editor/contrib/bracketMatching/bracketMatching.ts +++ b/src/vs/editor/contrib/bracketMatching/bracketMatching.ts @@ -57,7 +57,7 @@ class BracketsData { } export class BracketMatchingController extends Disposable implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.bracketMatchingController'; + private static readonly ID = 'editor.contrib.bracketMatchingController'; public static get(editor: ICodeEditor): BracketMatchingController { return editor.getContribution(BracketMatchingController.ID); @@ -148,7 +148,7 @@ export class BracketMatchingController extends Disposable implements editorCommo this._editor.revealRange(newSelections[0]); } - private static _DECORATION_OPTIONS = ModelDecorationOptions.register({ + private static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'bracket-match' }); diff --git a/src/vs/editor/contrib/bracketMatching/test/bracketMatching.test.ts b/src/vs/editor/contrib/bracketMatching/test/bracketMatching.test.ts index fc86a0c998b..7e7d5b977ec 100644 --- a/src/vs/editor/contrib/bracketMatching/test/bracketMatching.test.ts +++ b/src/vs/editor/contrib/bracketMatching/test/bracketMatching.test.ts @@ -16,7 +16,7 @@ import { BracketMatchingController } from 'vs/editor/contrib/bracketMatching/bra suite('bracket matching', () => { class BracketMode extends MockMode { - private static _id = new LanguageIdentifier('bracketMode', 3); + private static readonly _id = new LanguageIdentifier('bracketMode', 3); constructor() { super(BracketMode._id); diff --git a/src/vs/editor/contrib/colorPicker/colorPickerWidget.ts b/src/vs/editor/contrib/colorPicker/colorPickerWidget.ts index 53fe9074f0e..65d66dd8b10 100644 --- a/src/vs/editor/contrib/colorPicker/colorPickerWidget.ts +++ b/src/vs/editor/contrib/colorPicker/colorPickerWidget.ts @@ -328,7 +328,7 @@ class HueStrip extends Strip { export class ColorPickerWidget extends Widget { - private static ID = 'editor.contrib.colorPickerWidget'; + private static readonly ID = 'editor.contrib.colorPickerWidget'; body: ColorPickerBody; diff --git a/src/vs/editor/contrib/contextmenu/contextmenu.ts b/src/vs/editor/contrib/contextmenu/contextmenu.ts index 4eca41216e0..c3028475d32 100644 --- a/src/vs/editor/contrib/contextmenu/contextmenu.ts +++ b/src/vs/editor/contrib/contextmenu/contextmenu.ts @@ -28,7 +28,7 @@ export interface IPosition { export class ContextMenuController implements IEditorContribution { - private static ID = 'editor.contrib.contextmenu'; + private static readonly ID = 'editor.contrib.contextmenu'; public static get(editor: ICodeEditor): ContextMenuController { return editor.getContribution(ContextMenuController.ID); diff --git a/src/vs/editor/contrib/cursorUndo/cursorUndo.ts b/src/vs/editor/contrib/cursorUndo/cursorUndo.ts index 728f8939dbc..7311bead7b0 100644 --- a/src/vs/editor/contrib/cursorUndo/cursorUndo.ts +++ b/src/vs/editor/contrib/cursorUndo/cursorUndo.ts @@ -36,7 +36,7 @@ class CursorState { export class CursorUndoController extends Disposable implements IEditorContribution { - private static ID = 'editor.contrib.cursorUndoController'; + private static readonly ID = 'editor.contrib.cursorUndoController'; public static get(editor: ICodeEditor): CursorUndoController { return editor.getContribution(CursorUndoController.ID); diff --git a/src/vs/editor/contrib/dnd/dnd.ts b/src/vs/editor/contrib/dnd/dnd.ts index 9f5e0cb1b5b..19189da8f19 100644 --- a/src/vs/editor/contrib/dnd/dnd.ts +++ b/src/vs/editor/contrib/dnd/dnd.ts @@ -21,7 +21,7 @@ import { ModelDecorationOptions } from 'vs/editor/common/model/textModelWithDeco export class DragAndDropController implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.dragAndDrop'; + private static readonly ID = 'editor.contrib.dragAndDrop'; private _editor: ICodeEditor; private _toUnhook: IDisposable[]; @@ -161,7 +161,7 @@ export class DragAndDropController implements editorCommon.IEditorContribution { this._mouseDown = false; } - private static _DECORATION_OPTIONS = ModelDecorationOptions.register({ + private static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({ className: 'dnd-target' }); diff --git a/src/vs/editor/contrib/find/findController.ts b/src/vs/editor/contrib/find/findController.ts index 17992f8c756..b58be0c4c3d 100644 --- a/src/vs/editor/contrib/find/findController.ts +++ b/src/vs/editor/contrib/find/findController.ts @@ -58,7 +58,7 @@ export interface IFindStartOptions { export class CommonFindController extends Disposable implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.findController'; + private static readonly ID = 'editor.contrib.findController'; protected _editor: ICodeEditor; private _findWidgetVisible: IContextKey; diff --git a/src/vs/editor/contrib/find/findDecorations.ts b/src/vs/editor/contrib/find/findDecorations.ts index 479716f2f87..8c9d2dd5f30 100644 --- a/src/vs/editor/contrib/find/findDecorations.ts +++ b/src/vs/editor/contrib/find/findDecorations.ts @@ -221,7 +221,7 @@ export class FindDecorations implements IDisposable { return result; } - private static _CURRENT_FIND_MATCH_DECORATION = ModelDecorationOptions.register({ + private static readonly _CURRENT_FIND_MATCH_DECORATION = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'currentFindMatch', showIfCollapsed: true, @@ -232,7 +232,7 @@ export class FindDecorations implements IDisposable { } }); - private static _FIND_MATCH_DECORATION = ModelDecorationOptions.register({ + private static readonly _FIND_MATCH_DECORATION = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'findMatch', showIfCollapsed: true, @@ -243,13 +243,13 @@ export class FindDecorations implements IDisposable { } }); - private static _FIND_MATCH_NO_OVERVIEW_DECORATION = ModelDecorationOptions.register({ + private static readonly _FIND_MATCH_NO_OVERVIEW_DECORATION = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'findMatch', showIfCollapsed: true }); - private static _FIND_MATCH_ONLY_OVERVIEW_DECORATION = ModelDecorationOptions.register({ + private static readonly _FIND_MATCH_ONLY_OVERVIEW_DECORATION = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, overviewRuler: { color: themeColorFromId(editorFindMatchHighlight), @@ -258,13 +258,13 @@ export class FindDecorations implements IDisposable { } }); - private static _RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({ + private static readonly _RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'rangeHighlight', isWholeLine: true }); - private static _FIND_SCOPE_DECORATION = ModelDecorationOptions.register({ + private static readonly _FIND_SCOPE_DECORATION = ModelDecorationOptions.register({ className: 'findScope', isWholeLine: true }); diff --git a/src/vs/editor/contrib/find/findOptionsWidget.ts b/src/vs/editor/contrib/find/findOptionsWidget.ts index ada5ef1977a..fcf2d486513 100644 --- a/src/vs/editor/contrib/find/findOptionsWidget.ts +++ b/src/vs/editor/contrib/find/findOptionsWidget.ts @@ -18,7 +18,7 @@ import { inputActiveOptionBorder, editorWidgetBackground, contrastBorder, widget export class FindOptionsWidget extends Widget implements IOverlayWidget { - private static ID = 'editor.contrib.findOptionsWidget'; + private static readonly ID = 'editor.contrib.findOptionsWidget'; private _editor: ICodeEditor; private _state: FindReplaceState; diff --git a/src/vs/editor/contrib/find/findWidget.ts b/src/vs/editor/contrib/find/findWidget.ts index 745a82c5970..2d023dd3903 100644 --- a/src/vs/editor/contrib/find/findWidget.ts +++ b/src/vs/editor/contrib/find/findWidget.ts @@ -80,7 +80,7 @@ export class FindWidgetViewZone implements IViewZone { } export class FindWidget extends Widget implements IOverlayWidget, IHorizontalSashLayoutProvider { - private static ID = 'editor.contrib.findWidget'; + private static readonly ID = 'editor.contrib.findWidget'; private _codeEditor: ICodeEditor; private _state: FindReplaceState; private _controller: IFindController; diff --git a/src/vs/editor/contrib/folding/folding.ts b/src/vs/editor/contrib/folding/folding.ts index aa47e770c3a..7f1d4e94571 100644 --- a/src/vs/editor/contrib/folding/folding.ts +++ b/src/vs/editor/contrib/folding/folding.ts @@ -549,7 +549,7 @@ class UnfoldAllAction extends FoldingAction { } class FoldLevelAction extends FoldingAction { - private static ID_PREFIX = 'editor.foldLevel'; + private static readonly ID_PREFIX = 'editor.foldLevel'; public static readonly ID = (level: number) => FoldLevelAction.ID_PREFIX + level; private getFoldingLevel() { diff --git a/src/vs/editor/contrib/format/formatActions.ts b/src/vs/editor/contrib/format/formatActions.ts index 0d43ace7915..52114dd943e 100644 --- a/src/vs/editor/contrib/format/formatActions.ts +++ b/src/vs/editor/contrib/format/formatActions.ts @@ -56,7 +56,7 @@ function alertFormattingEdits(edits: editorCommon.ISingleEditOperation[]): void class FormatOnType implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.autoFormat'; + private static readonly ID = 'editor.contrib.autoFormat'; private editor: ICodeEditor; private workerService: IEditorWorkerService; @@ -181,7 +181,7 @@ class FormatOnType implements editorCommon.IEditorContribution { class FormatOnPaste implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.formatOnPaste'; + private static readonly ID = 'editor.contrib.formatOnPaste'; private editor: ICodeEditor; private workerService: IEditorWorkerService; diff --git a/src/vs/editor/contrib/goToDeclaration/goToDeclarationMouse.ts b/src/vs/editor/contrib/goToDeclaration/goToDeclarationMouse.ts index 904c1c7abcd..d454d647dc3 100644 --- a/src/vs/editor/contrib/goToDeclaration/goToDeclarationMouse.ts +++ b/src/vs/editor/contrib/goToDeclaration/goToDeclarationMouse.ts @@ -28,7 +28,7 @@ import { ClickLinkGesture, ClickLinkMouseEvent, ClickLinkKeyboardEvent } from 'v class GotoDefinitionWithMouseEditorContribution implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.gotodefinitionwithmouse'; + private static readonly ID = 'editor.contrib.gotodefinitionwithmouse'; static MAX_SOURCE_PREVIEW_LINES = 8; private editor: ICodeEditor; diff --git a/src/vs/editor/contrib/gotoError/gotoError.ts b/src/vs/editor/contrib/gotoError/gotoError.ts index adce72acc48..758634a1f00 100644 --- a/src/vs/editor/contrib/gotoError/gotoError.ts +++ b/src/vs/editor/contrib/gotoError/gotoError.ts @@ -428,7 +428,7 @@ class MarkerNavigationAction extends EditorAction { class MarkerController implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.markerController'; + private static readonly ID = 'editor.contrib.markerController'; public static get(editor: ICodeEditor): MarkerController { return editor.getContribution(MarkerController.ID); diff --git a/src/vs/editor/contrib/hover/hover.ts b/src/vs/editor/contrib/hover/hover.ts index ec544bd9e23..047e21db91b 100644 --- a/src/vs/editor/contrib/hover/hover.ts +++ b/src/vs/editor/contrib/hover/hover.ts @@ -26,7 +26,7 @@ import { MarkdownRenderer } from 'vs/editor/contrib/markdown/markdownRenderer'; export class ModesHoverController implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.hover'; + private static readonly ID = 'editor.contrib.hover'; private _editor: ICodeEditor; private _toUnhook: IDisposable[]; diff --git a/src/vs/editor/contrib/hover/modesContentHover.ts b/src/vs/editor/contrib/hover/modesContentHover.ts index 9fe860b1722..00ec6881e85 100644 --- a/src/vs/editor/contrib/hover/modesContentHover.ts +++ b/src/vs/editor/contrib/hover/modesContentHover.ts @@ -405,7 +405,7 @@ export class ModesContentHoverWidget extends ContentHoverWidget { this._isChangingDecorations = false; } - private static _DECORATION_OPTIONS = ModelDecorationOptions.register({ + private static readonly _DECORATION_OPTIONS = ModelDecorationOptions.register({ className: 'hoverHighlight' }); } diff --git a/src/vs/editor/contrib/inPlaceReplace/inPlaceReplace.ts b/src/vs/editor/contrib/inPlaceReplace/inPlaceReplace.ts index 53ce3951234..988586c8339 100644 --- a/src/vs/editor/contrib/inPlaceReplace/inPlaceReplace.ts +++ b/src/vs/editor/contrib/inPlaceReplace/inPlaceReplace.ts @@ -23,13 +23,13 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; class InPlaceReplaceController implements IEditorContribution { - private static ID = 'editor.contrib.inPlaceReplaceController'; + private static readonly ID = 'editor.contrib.inPlaceReplaceController'; static get(editor: ICodeEditor): InPlaceReplaceController { return editor.getContribution(InPlaceReplaceController.ID); } - private static DECORATION = ModelDecorationOptions.register({ + private static readonly DECORATION = ModelDecorationOptions.register({ className: 'valueSetReplacement' }); diff --git a/src/vs/editor/contrib/indentation/indentation.ts b/src/vs/editor/contrib/indentation/indentation.ts index 62d445e94d2..0ff2954e47b 100644 --- a/src/vs/editor/contrib/indentation/indentation.ts +++ b/src/vs/editor/contrib/indentation/indentation.ts @@ -372,7 +372,7 @@ export class AutoIndentOnPasteCommand implements ICommand { } export class AutoIndentOnPaste implements IEditorContribution { - private static ID = 'editor.contrib.autoIndentOnPaste'; + private static readonly ID = 'editor.contrib.autoIndentOnPaste'; private editor: ICodeEditor; private callOnDispose: IDisposable[]; diff --git a/src/vs/editor/contrib/linesOperations/test/moveLinesCommand.test.ts b/src/vs/editor/contrib/linesOperations/test/moveLinesCommand.test.ts index e117b39dc6a..9d3726bb4a3 100644 --- a/src/vs/editor/contrib/linesOperations/test/moveLinesCommand.test.ts +++ b/src/vs/editor/contrib/linesOperations/test/moveLinesCommand.test.ts @@ -260,7 +260,7 @@ suite('Editor Contrib - Move Lines Command', () => { }); class IndentRulesMode extends MockMode { - private static _id = new LanguageIdentifier('moveLinesIndentMode', 7); + private static readonly _id = new LanguageIdentifier('moveLinesIndentMode', 7); constructor(indentationRules: IndentationRule) { super(IndentRulesMode._id); this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), { diff --git a/src/vs/editor/contrib/message/messageController.ts b/src/vs/editor/contrib/message/messageController.ts index fb0754ebeeb..90982184a1c 100644 --- a/src/vs/editor/contrib/message/messageController.ts +++ b/src/vs/editor/contrib/message/messageController.ts @@ -22,7 +22,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe export class MessageController implements editorCommon.IEditorContribution { - private static _id = 'editor.contrib.messageController'; + private static readonly _id = 'editor.contrib.messageController'; static CONTEXT_SNIPPET_MODE = new RawContextKey('messageVisible', false); diff --git a/src/vs/editor/contrib/multicursor/multicursor.ts b/src/vs/editor/contrib/multicursor/multicursor.ts index ff3dbae754b..9b1083bbf0f 100644 --- a/src/vs/editor/contrib/multicursor/multicursor.ts +++ b/src/vs/editor/contrib/multicursor/multicursor.ts @@ -303,7 +303,7 @@ export class MultiCursorSession { export class MultiCursorSelectionController extends Disposable implements IEditorContribution { - private static ID = 'editor.contrib.multiCursorController'; + private static readonly ID = 'editor.contrib.multiCursorController'; private readonly _editor: ICodeEditor; private _ignoreSelectionChange: boolean; @@ -654,7 +654,7 @@ class SelectionHighlighterState { } export class SelectionHighlighter extends Disposable implements IEditorContribution { - private static ID = 'editor.contrib.selectionHighlighter'; + private static readonly ID = 'editor.contrib.selectionHighlighter'; private editor: ICodeEditor; private _isEnabled: boolean; @@ -860,7 +860,7 @@ export class SelectionHighlighter extends Disposable implements IEditorContribut this.decorations = this.editor.deltaDecorations(this.decorations, decorations); } - private static _SELECTION_HIGHLIGHT_OVERVIEW = ModelDecorationOptions.register({ + private static readonly _SELECTION_HIGHLIGHT_OVERVIEW = ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'selectionHighlight', overviewRuler: { @@ -870,7 +870,7 @@ export class SelectionHighlighter extends Disposable implements IEditorContribut } }); - private static _SELECTION_HIGHLIGHT = ModelDecorationOptions.register({ + private static readonly _SELECTION_HIGHLIGHT = ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'selectionHighlight', }); diff --git a/src/vs/editor/contrib/parameterHints/parameterHints.ts b/src/vs/editor/contrib/parameterHints/parameterHints.ts index bfd30a88a58..2e4aacfd04d 100644 --- a/src/vs/editor/contrib/parameterHints/parameterHints.ts +++ b/src/vs/editor/contrib/parameterHints/parameterHints.ts @@ -19,7 +19,7 @@ import { KeybindingsRegistry } from 'vs/platform/keybinding/common/keybindingsRe class ParameterHintsController implements IEditorContribution { - private static ID = 'editor.controller.parameterHints'; + private static readonly ID = 'editor.controller.parameterHints'; public static get(editor: ICodeEditor): ParameterHintsController { return editor.getContribution(ParameterHintsController.ID); diff --git a/src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts b/src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts index 141dba30f81..4392d12f485 100644 --- a/src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts +++ b/src/vs/editor/contrib/parameterHints/parameterHintsWidget.ts @@ -170,7 +170,7 @@ export class ParameterHintsModel extends Disposable { export class ParameterHintsWidget implements IContentWidget, IDisposable { - private static ID = 'editor.widget.parameterHintsWidget'; + private static readonly ID = 'editor.widget.parameterHintsWidget'; private markdownRenderer: MarkdownRenderer; private model: ParameterHintsModel; diff --git a/src/vs/editor/contrib/quickFix/quickFixCommands.ts b/src/vs/editor/contrib/quickFix/quickFixCommands.ts index 52dd8e1bf8b..6f16b6e1610 100644 --- a/src/vs/editor/contrib/quickFix/quickFixCommands.ts +++ b/src/vs/editor/contrib/quickFix/quickFixCommands.ts @@ -27,7 +27,7 @@ import { ITextModelService } from 'vs/editor/common/services/resolverService'; export class QuickFixController implements IEditorContribution { - private static ID = 'editor.contrib.quickFixController'; + private static readonly ID = 'editor.contrib.quickFixController'; public static get(editor: ICodeEditor): QuickFixController { return editor.getContribution(QuickFixController.ID); diff --git a/src/vs/editor/contrib/referenceSearch/referenceSearch.ts b/src/vs/editor/contrib/referenceSearch/referenceSearch.ts index 39d7e332ef3..b0aafa03a89 100644 --- a/src/vs/editor/contrib/referenceSearch/referenceSearch.ts +++ b/src/vs/editor/contrib/referenceSearch/referenceSearch.ts @@ -34,7 +34,7 @@ const defaultReferenceSearchOptions: RequestOptions = { export class ReferenceController implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.referenceController'; + private static readonly ID = 'editor.contrib.referenceController'; constructor( editor: ICodeEditor, diff --git a/src/vs/editor/contrib/referenceSearch/referencesController.ts b/src/vs/editor/contrib/referenceSearch/referencesController.ts index 5eb98b7e9dc..f4c10cdbb60 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesController.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesController.ts @@ -38,7 +38,7 @@ export interface RequestOptions { export class ReferencesController implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.referencesController'; + private static readonly ID = 'editor.contrib.referencesController'; private _editor: ICodeEditor; private _widget: ReferenceWidget; diff --git a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts index a59115af0b6..4b2d75c1b2d 100644 --- a/src/vs/editor/contrib/referenceSearch/referencesWidget.ts +++ b/src/vs/editor/contrib/referenceSearch/referencesWidget.ts @@ -45,7 +45,7 @@ import URI from 'vs/base/common/uri'; class DecorationsManager implements IDisposable { - private static DecorationOptions = ModelDecorationOptions.register({ + private static readonly DecorationOptions = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'reference-decoration' }); @@ -419,7 +419,7 @@ class OneReferenceTemplate { class Renderer implements tree.IRenderer { - private static _ids = { + private static readonly _ids = { FileReferences: 'FileReferences', OneReference: 'OneReference' }; diff --git a/src/vs/editor/contrib/rename/rename.ts b/src/vs/editor/contrib/rename/rename.ts index 986cc839661..a4b7c5c4409 100644 --- a/src/vs/editor/contrib/rename/rename.ts +++ b/src/vs/editor/contrib/rename/rename.ts @@ -85,7 +85,7 @@ const CONTEXT_RENAME_INPUT_VISIBLE = new RawContextKey('renameInputVisi class RenameController implements IEditorContribution { - private static ID = 'editor.contrib.renameController'; + private static readonly ID = 'editor.contrib.renameController'; public static get(editor: ICodeEditor): RenameController { return editor.getContribution(RenameController.ID); diff --git a/src/vs/editor/contrib/smartSelect/smartSelect.ts b/src/vs/editor/contrib/smartSelect/smartSelect.ts index 2fbbc1e2cc9..abc6dd3176c 100644 --- a/src/vs/editor/contrib/smartSelect/smartSelect.ts +++ b/src/vs/editor/contrib/smartSelect/smartSelect.ts @@ -42,7 +42,7 @@ var ignoreSelection = false; class SmartSelectController implements IEditorContribution { - private static ID = 'editor.contrib.smartSelectController'; + private static readonly ID = 'editor.contrib.smartSelectController'; public static get(editor: ICodeEditor): SmartSelectController { return editor.getContribution(SmartSelectController.ID); diff --git a/src/vs/editor/contrib/smartSelect/test/tokenSelectionSupport.test.ts b/src/vs/editor/contrib/smartSelect/test/tokenSelectionSupport.test.ts index f646c429cb7..e773a399966 100644 --- a/src/vs/editor/contrib/smartSelect/test/tokenSelectionSupport.test.ts +++ b/src/vs/editor/contrib/smartSelect/test/tokenSelectionSupport.test.ts @@ -18,7 +18,7 @@ import { TestConfigurationService } from 'vs/platform/configuration/test/common/ class MockJSMode extends MockMode { - private static _id = new LanguageIdentifier('mockJSMode', 3); + private static readonly _id = new LanguageIdentifier('mockJSMode', 3); constructor() { super(MockJSMode._id); diff --git a/src/vs/editor/contrib/wordHighlighter/wordHighlighter.ts b/src/vs/editor/contrib/wordHighlighter/wordHighlighter.ts index c36f7d4b4f7..e833c79b7df 100644 --- a/src/vs/editor/contrib/wordHighlighter/wordHighlighter.ts +++ b/src/vs/editor/contrib/wordHighlighter/wordHighlighter.ts @@ -362,7 +362,7 @@ class WordHighlighter { } } - private static _WRITE_OPTIONS = ModelDecorationOptions.register({ + private static readonly _WRITE_OPTIONS = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'wordHighlightStrong', overviewRuler: { @@ -372,7 +372,7 @@ class WordHighlighter { } }); - private static _TEXT_OPTIONS = ModelDecorationOptions.register({ + private static readonly _TEXT_OPTIONS = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'selectionHighlight', overviewRuler: { @@ -382,7 +382,7 @@ class WordHighlighter { } }); - private static _REGULAR_OPTIONS = ModelDecorationOptions.register({ + private static readonly _REGULAR_OPTIONS = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'wordHighlight', overviewRuler: { @@ -400,7 +400,7 @@ class WordHighlighter { class WordHighlighterContribution implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.wordHighlighter'; + private static readonly ID = 'editor.contrib.wordHighlighter'; public static get(editor: ICodeEditor): WordHighlighterContribution { return editor.getContribution(WordHighlighterContribution.ID); diff --git a/src/vs/editor/contrib/zoneWidget/zoneWidget.ts b/src/vs/editor/contrib/zoneWidget/zoneWidget.ts index c64950b8877..dca1d69a836 100644 --- a/src/vs/editor/contrib/zoneWidget/zoneWidget.ts +++ b/src/vs/editor/contrib/zoneWidget/zoneWidget.ts @@ -104,7 +104,7 @@ export class OverlayWidgetDelegate implements IOverlayWidget { class Arrow { - private static _IdGenerator = new IdGenerator('.arrow-decoration-'); + private static readonly _IdGenerator = new IdGenerator('.arrow-decoration-'); private readonly _ruleName = Arrow._IdGenerator.nextId(); private _decorations: string[] = []; diff --git a/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts b/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts index 81c1edc58ad..44f2fca8421 100644 --- a/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts +++ b/src/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.ts @@ -36,7 +36,7 @@ const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new RawContextKey('accessi class AccessibilityHelpController extends Disposable implements IEditorContribution { - private static ID = 'editor.contrib.accessibilityHelpController'; + private static readonly ID = 'editor.contrib.accessibilityHelpController'; public static get(editor: ICodeEditor): AccessibilityHelpController { return editor.getContribution( @@ -103,9 +103,9 @@ function getSelectionLabel(selections: Selection[], charactersSelected: number): } class AccessibilityHelpWidget extends Widget implements IOverlayWidget { - private static ID = 'editor.contrib.accessibilityHelpWidget'; - private static WIDTH = 500; - private static HEIGHT = 300; + private static readonly ID = 'editor.contrib.accessibilityHelpWidget'; + private static readonly WIDTH = 500; + private static readonly HEIGHT = 300; private _editor: ICodeEditor; private _domNode: FastDomNode; diff --git a/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts b/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts index 638baec1ff4..102e9827c98 100644 --- a/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts +++ b/src/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.ts @@ -15,7 +15,7 @@ import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; export class IPadShowKeyboard implements IEditorContribution { - private static ID = 'editor.contrib.iPadShowKeyboard'; + private static readonly ID = 'editor.contrib.iPadShowKeyboard'; private editor: ICodeEditor; private widget: ShowKeyboardWidget; @@ -61,7 +61,7 @@ export class IPadShowKeyboard implements IEditorContribution { class ShowKeyboardWidget implements IOverlayWidget { - private static ID = 'editor.contrib.ShowKeyboardWidget'; + private static readonly ID = 'editor.contrib.ShowKeyboardWidget'; private editor: ICodeEditor; diff --git a/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts index 20a67ba096b..142d72355e0 100644 --- a/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts +++ b/src/vs/editor/standalone/browser/inspectTokens/inspectTokens.ts @@ -26,7 +26,7 @@ import { editorHoverBackground, editorHoverBorder } from 'vs/platform/theme/comm class InspectTokensController extends Disposable implements IEditorContribution { - private static ID = 'editor.contrib.inspectTokens'; + private static readonly ID = 'editor.contrib.inspectTokens'; public static get(editor: ICodeEditor): InspectTokensController { return editor.getContribution(InspectTokensController.ID); @@ -160,7 +160,7 @@ function getSafeTokenizationSupport(languageIdentifier: LanguageIdentifier): ITo class InspectTokensWidget extends Disposable implements IContentWidget { - private static _ID = 'editor.contrib.inspectTokensWidget'; + private static readonly _ID = 'editor.contrib.inspectTokensWidget'; // Editor.IContentWidget.allowEditorOverflow public allowEditorOverflow = true; diff --git a/src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts b/src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts index 86018b3082f..34154c4a710 100644 --- a/src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts +++ b/src/vs/editor/standalone/browser/quickOpen/editorQuickOpen.ts @@ -23,7 +23,7 @@ export interface IQuickOpenControllerOpts { export class QuickOpenController implements editorCommon.IEditorContribution, IDecorator { - private static ID = 'editor.controller.quickOpenController'; + private static readonly ID = 'editor.controller.quickOpenController'; public static get(editor: ICodeEditor): QuickOpenController { return editor.getContribution(QuickOpenController.ID); @@ -93,7 +93,7 @@ export class QuickOpenController implements editorCommon.IEditorContribution, ID this.widget.show(''); } - private static _RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({ + private static readonly _RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({ className: 'rangeHighlight', isWholeLine: true }); diff --git a/src/vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts b/src/vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts index abae373223b..ea3d4dcc5c2 100644 --- a/src/vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts +++ b/src/vs/editor/standalone/browser/quickOpen/quickOpenEditorWidget.ts @@ -19,7 +19,7 @@ export interface IQuickOpenEditorWidgetOptions { export class QuickOpenEditorWidget implements IOverlayWidget { - private static ID = 'editor.contrib.quickOpenEditorWidget'; + private static readonly ID = 'editor.contrib.quickOpenEditorWidget'; private codeEditor: ICodeEditor; private themeService: IThemeService; diff --git a/src/vs/editor/standalone/browser/simpleServices.ts b/src/vs/editor/standalone/browser/simpleServices.ts index c004a52d4ac..c316839a206 100644 --- a/src/vs/editor/standalone/browser/simpleServices.ts +++ b/src/vs/editor/standalone/browser/simpleServices.ts @@ -237,7 +237,7 @@ export class SimpleMessageService implements IMessageService { public _serviceBrand: any; - private static Empty = function () { /* nothing */ }; + private static readonly Empty = function () { /* nothing */ }; public show(sev: Severity, message: any): () => void { diff --git a/src/vs/editor/standalone/common/monarch/monarchLexer.ts b/src/vs/editor/standalone/common/monarch/monarchLexer.ts index c50d02a8129..ca20f1dbf5a 100644 --- a/src/vs/editor/standalone/common/monarch/monarchLexer.ts +++ b/src/vs/editor/standalone/common/monarch/monarchLexer.ts @@ -25,7 +25,7 @@ const CACHE_STACK_DEPTH = 5; */ class MonarchStackElementFactory { - private static _INSTANCE = new MonarchStackElementFactory(CACHE_STACK_DEPTH); + private static readonly _INSTANCE = new MonarchStackElementFactory(CACHE_STACK_DEPTH); public static create(parent: MonarchStackElement, state: string): MonarchStackElement { return this._INSTANCE.create(parent, state); } @@ -156,7 +156,7 @@ class EmbeddedModeData { */ class MonarchLineStateFactory { - private static _INSTANCE = new MonarchLineStateFactory(CACHE_STACK_DEPTH); + private static readonly _INSTANCE = new MonarchLineStateFactory(CACHE_STACK_DEPTH); public static create(stack: MonarchStackElement, embeddedModeData: EmbeddedModeData): MonarchLineState { return this._INSTANCE.create(stack, embeddedModeData); } diff --git a/src/vs/editor/test/browser/commands/shiftCommand.test.ts b/src/vs/editor/test/browser/commands/shiftCommand.test.ts index 3db612e98c5..c110ad37d80 100644 --- a/src/vs/editor/test/browser/commands/shiftCommand.test.ts +++ b/src/vs/editor/test/browser/commands/shiftCommand.test.ts @@ -30,7 +30,7 @@ export function createSingleEditOp(text: string, positionLineNumber: number, pos class DocBlockCommentMode extends MockMode { - private static _id = new LanguageIdentifier('commentMode', 3); + private static readonly _id = new LanguageIdentifier('commentMode', 3); constructor() { super(DocBlockCommentMode._id); diff --git a/src/vs/editor/test/browser/controller/cursor.test.ts b/src/vs/editor/test/browser/controller/cursor.test.ts index 4e64db7b685..d33f5cf7360 100644 --- a/src/vs/editor/test/browser/controller/cursor.test.ts +++ b/src/vs/editor/test/browser/controller/cursor.test.ts @@ -1092,7 +1092,7 @@ suite('Editor Controller - Cursor', () => { class SurroundingMode extends MockMode { - private static _id = new LanguageIdentifier('surroundingMode', 3); + private static readonly _id = new LanguageIdentifier('surroundingMode', 3); constructor() { super(SurroundingMode._id); @@ -1103,7 +1103,7 @@ class SurroundingMode extends MockMode { } class OnEnterMode extends MockMode { - private static _id = new LanguageIdentifier('onEnterMode', 3); + private static readonly _id = new LanguageIdentifier('onEnterMode', 3); constructor(indentAction: IndentAction, outdentCurrentLine?: boolean) { super(OnEnterMode._id); @@ -1120,7 +1120,7 @@ class OnEnterMode extends MockMode { } class IndentRulesMode extends MockMode { - private static _id = new LanguageIdentifier('indentRulesMode', 4); + private static readonly _id = new LanguageIdentifier('indentRulesMode', 4); constructor(indentationRules: IndentationRule) { super(IndentRulesMode._id); this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), { @@ -3177,7 +3177,7 @@ suite('Editor Controller - Indentation Rules', () => { test('issue #36090: JS: editor.autoIndent seems to be broken', () => { class JSMode extends MockMode { - private static _id = new LanguageIdentifier('indentRulesMode', 4); + private static readonly _id = new LanguageIdentifier('indentRulesMode', 4); constructor() { super(JSMode._id); this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), { @@ -3264,7 +3264,7 @@ suite('Editor Controller - Indentation Rules', () => { test('issue #38261: TAB key results in bizarre indentation in C++ mode ', () => { class CppMode extends MockMode { - private static _id = new LanguageIdentifier('indentRulesMode', 4); + private static readonly _id = new LanguageIdentifier('indentRulesMode', 4); constructor() { super(CppMode._id); this._register(LanguageConfigurationRegistry.register(this.getLanguageIdentifier(), { @@ -3348,7 +3348,7 @@ function usingCursor(opts: ICursorOpts, callback: (model: Model, cursor: Cursor) class ElectricCharMode extends MockMode { - private static _id = new LanguageIdentifier('electricCharMode', 3); + private static readonly _id = new LanguageIdentifier('electricCharMode', 3); constructor() { super(ElectricCharMode._id); @@ -3606,7 +3606,7 @@ suite('autoClosingPairs', () => { class AutoClosingMode extends MockMode { - private static _id = new LanguageIdentifier('autoClosingMode', 5); + private static readonly _id = new LanguageIdentifier('autoClosingMode', 5); constructor() { super(AutoClosingMode._id); diff --git a/src/vs/editor/test/common/commentMode.ts b/src/vs/editor/test/common/commentMode.ts index 232906169e1..ced7ed30006 100644 --- a/src/vs/editor/test/common/commentMode.ts +++ b/src/vs/editor/test/common/commentMode.ts @@ -10,7 +10,7 @@ import { LanguageIdentifier } from 'vs/editor/common/modes'; import { MockMode } from 'vs/editor/test/common/mocks/mockMode'; export class CommentMode extends MockMode { - private static _id = new LanguageIdentifier('commentMode', 3); + private static readonly _id = new LanguageIdentifier('commentMode', 3); constructor(commentsConfig: CommentRule) { super(CommentMode._id); diff --git a/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts b/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts index 8d7712ba504..7bc91ada333 100644 --- a/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts +++ b/src/vs/editor/test/common/modes/textToHtmlTokenizer.test.ts @@ -197,7 +197,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => { class Mode extends MockMode { - private static _id = new LanguageIdentifier('textToHtmlTokenizerMode', 3); + private static readonly _id = new LanguageIdentifier('textToHtmlTokenizerMode', 3); constructor() { super(Mode._id); diff --git a/src/vs/platform/history/electron-main/historyMainService.ts b/src/vs/platform/history/electron-main/historyMainService.ts index 40fdc0b0802..069fa2c4733 100644 --- a/src/vs/platform/history/electron-main/historyMainService.ts +++ b/src/vs/platform/history/electron-main/historyMainService.ts @@ -28,10 +28,10 @@ export interface ILegacyRecentlyOpened extends IRecentlyOpened { export class HistoryMainService implements IHistoryMainService { - private static MAX_TOTAL_RECENT_ENTRIES = 100; - private static MAX_MACOS_DOCK_RECENT_ENTRIES = 10; + private static readonly MAX_TOTAL_RECENT_ENTRIES = 100; + private static readonly MAX_MACOS_DOCK_RECENT_ENTRIES = 10; - private static recentlyOpenedStorageKey = 'openedPathsList'; + private static readonly recentlyOpenedStorageKey = 'openedPathsList'; _serviceBrand: any; diff --git a/src/vs/platform/integrity/node/integrityServiceImpl.ts b/src/vs/platform/integrity/node/integrityServiceImpl.ts index 1800587520e..33ce7582d89 100644 --- a/src/vs/platform/integrity/node/integrityServiceImpl.ts +++ b/src/vs/platform/integrity/node/integrityServiceImpl.ts @@ -22,7 +22,7 @@ interface IStorageData { } class IntegrityStorage { - private static KEY = 'integrityService'; + private static readonly KEY = 'integrityService'; private _storageService: IStorageService; private _value: IStorageData; diff --git a/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts index 28bf62c5654..d9b3be30cfd 100644 --- a/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts +++ b/src/vs/platform/lifecycle/electron-main/lifecycleMain.ts @@ -74,7 +74,7 @@ export class LifecycleService implements ILifecycleService { _serviceBrand: any; - private static QUIT_FROM_RESTART_MARKER = 'quit.from.restart'; // use a marker to find out if the session was restarted + private static readonly QUIT_FROM_RESTART_MARKER = 'quit.from.restart'; // use a marker to find out if the session was restarted private windowToCloseRequest: { [windowId: string]: boolean }; private quitRequested: boolean; diff --git a/src/vs/workbench/api/electron-browser/mainThreadTelemetry.ts b/src/vs/workbench/api/electron-browser/mainThreadTelemetry.ts index 215f3b95b86..9e51c857b52 100644 --- a/src/vs/workbench/api/electron-browser/mainThreadTelemetry.ts +++ b/src/vs/workbench/api/electron-browser/mainThreadTelemetry.ts @@ -11,7 +11,7 @@ import { extHostNamedCustomer } from 'vs/workbench/api/electron-browser/extHostC @extHostNamedCustomer(MainContext.MainThreadTelemetry) export class MainThreadTelemetry implements MainThreadTelemetryShape { - private static _name = 'pluginHostTelemetry'; + private static readonly _name = 'pluginHostTelemetry'; constructor( extHostContext: IExtHostContext, diff --git a/src/vs/workbench/api/node/extHostTextEditor.ts b/src/vs/workbench/api/node/extHostTextEditor.ts index 9872ac721fd..0f70aa99ad0 100644 --- a/src/vs/workbench/api/node/extHostTextEditor.ts +++ b/src/vs/workbench/api/node/extHostTextEditor.ts @@ -20,7 +20,7 @@ import { IRange } from 'vs/editor/common/core/range'; export class TextEditorDecorationType implements vscode.TextEditorDecorationType { - private static _Keys = new IdGenerator('TextEditorDecorationType'); + private static readonly _Keys = new IdGenerator('TextEditorDecorationType'); private _proxy: MainThreadEditorsShape; public key: string; diff --git a/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts b/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts index 6d693cf8d9b..a201dbe174b 100644 --- a/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts +++ b/src/vs/workbench/browser/actions/toggleActivityBarVisibility.ts @@ -18,7 +18,7 @@ export class ToggleActivityBarVisibilityAction extends Action { public static readonly ID = 'workbench.action.toggleActivityBarVisibility'; public static readonly LABEL = nls.localize('toggleActivityBar', "Toggle Activity Bar Visibility"); - private static activityBarVisibleKey = 'workbench.activityBar.visible'; + private static readonly activityBarVisibleKey = 'workbench.activityBar.visible'; constructor( id: string, diff --git a/src/vs/workbench/browser/actions/toggleSidebarPosition.ts b/src/vs/workbench/browser/actions/toggleSidebarPosition.ts index dc71a8e1e7a..2dc5bab450f 100644 --- a/src/vs/workbench/browser/actions/toggleSidebarPosition.ts +++ b/src/vs/workbench/browser/actions/toggleSidebarPosition.ts @@ -18,7 +18,7 @@ export class ToggleSidebarPositionAction extends Action { public static readonly ID = 'workbench.action.toggleSidebarPosition'; public static readonly LABEL = nls.localize('toggleLocation', "Toggle Side Bar Location"); - private static sidebarPositionConfigurationKey = 'workbench.sideBar.location'; + private static readonly sidebarPositionConfigurationKey = 'workbench.sideBar.location'; constructor( id: string, diff --git a/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts b/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts index 5fb61d0ba96..1cbd330b34c 100644 --- a/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts +++ b/src/vs/workbench/browser/actions/toggleStatusbarVisibility.ts @@ -18,7 +18,7 @@ export class ToggleStatusbarVisibilityAction extends Action { public static readonly ID = 'workbench.action.toggleStatusbarVisibility'; public static readonly LABEL = nls.localize('toggleStatusbar', "Toggle Status Bar Visibility"); - private static statusbarVisibleKey = 'workbench.statusBar.visible'; + private static readonly statusbarVisibleKey = 'workbench.statusBar.visible'; constructor( id: string, diff --git a/src/vs/workbench/browser/actions/toggleTabsVisibility.ts b/src/vs/workbench/browser/actions/toggleTabsVisibility.ts index e8c7e263abb..e094cff637e 100644 --- a/src/vs/workbench/browser/actions/toggleTabsVisibility.ts +++ b/src/vs/workbench/browser/actions/toggleTabsVisibility.ts @@ -18,7 +18,7 @@ export class ToggleTabsVisibilityAction extends Action { public static readonly ID = 'workbench.action.toggleTabsVisibility'; public static readonly LABEL = nls.localize('toggleTabs', "Toggle Tab Visibility"); - private static tabsVisibleKey = 'workbench.editor.showTabs'; + private static readonly tabsVisibleKey = 'workbench.editor.showTabs'; constructor( id: string, diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts index fc989a6fd5c..d04e8eefb73 100644 --- a/src/vs/workbench/browser/layout.ts +++ b/src/vs/workbench/browser/layout.ts @@ -49,10 +49,10 @@ interface PartLayoutInfo { */ export class WorkbenchLayout implements IVerticalSashLayoutProvider, IHorizontalSashLayoutProvider { - private static sashXOneWidthSettingsKey = 'workbench.sidebar.width'; - private static sashXTwoWidthSettingsKey = 'workbench.panel.width'; - private static sashYHeightSettingsKey = 'workbench.panel.height'; - private static panelSizeBeforeMaximizedKey = 'workbench.panel.sizeBeforeMaximized'; + private static readonly sashXOneWidthSettingsKey = 'workbench.sidebar.width'; + private static readonly sashXTwoWidthSettingsKey = 'workbench.panel.width'; + private static readonly sashYHeightSettingsKey = 'workbench.panel.height'; + private static readonly panelSizeBeforeMaximizedKey = 'workbench.panel.sizeBeforeMaximized'; private parent: Builder; private workbenchContainer: Builder; diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts index dcb5207ab72..9bb1df4387a 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarActions.ts @@ -25,7 +25,7 @@ import { ActivityAction, ActivityActionItem, ICompositeBarColors } from 'vs/work export class ViewletActivityAction extends ActivityAction { - private static preventDoubleClickDelay = 300; + private static readonly preventDoubleClickDelay = 300; private lastRun: number = 0; diff --git a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts index 299431306fe..e703469831b 100644 --- a/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts +++ b/src/vs/workbench/browser/parts/activitybar/activitybarPart.ts @@ -33,7 +33,7 @@ import { ToggleCompositePinnedAction } from 'vs/workbench/browser/parts/composit export class ActivitybarPart extends Part { private static readonly PINNED_VIEWLETS = 'workbench.activity.pinnedViewlets'; - private static COLORS = { + private static readonly COLORS = { backgroundColor: ACTIVITY_BAR_FOREGROUND, badgeBackground: ACTIVITY_BAR_BADGE_BACKGROUND, badgeForeground: ACTIVITY_BAR_BADGE_FOREGROUND, diff --git a/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts b/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts index 975592c816a..6664ed4e02f 100644 --- a/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts +++ b/src/vs/workbench/browser/parts/editor/editorGroupsControl.ts @@ -97,17 +97,17 @@ export interface IEditorGroupsControl { */ export class EditorGroupsControl extends Themable implements IEditorGroupsControl, IVerticalSashLayoutProvider, IHorizontalSashLayoutProvider { - private static TITLE_AREA_CONTROL_KEY = '__titleAreaControl'; - private static PROGRESS_BAR_CONTROL_KEY = '__progressBar'; - private static INSTANTIATION_SERVICE_KEY = '__instantiationService'; + private static readonly TITLE_AREA_CONTROL_KEY = '__titleAreaControl'; + private static readonly PROGRESS_BAR_CONTROL_KEY = '__progressBar'; + private static readonly INSTANTIATION_SERVICE_KEY = '__instantiationService'; - private static MIN_EDITOR_WIDTH = 170; - private static MIN_EDITOR_HEIGHT = 70; + private static readonly MIN_EDITOR_WIDTH = 170; + private static readonly MIN_EDITOR_HEIGHT = 70; - private static EDITOR_TITLE_HEIGHT = 35; + private static readonly EDITOR_TITLE_HEIGHT = 35; - private static SNAP_TO_MINIMIZED_THRESHOLD_WIDTH = 50; - private static SNAP_TO_MINIMIZED_THRESHOLD_HEIGHT = 20; + private static readonly SNAP_TO_MINIMIZED_THRESHOLD_WIDTH = 50; + private static readonly SNAP_TO_MINIMIZED_THRESHOLD_HEIGHT = 20; private stacks: IEditorStacksModel; diff --git a/src/vs/workbench/browser/parts/editor/editorPart.ts b/src/vs/workbench/browser/parts/editor/editorPart.ts index cb7ee57811c..48e81a3e15d 100644 --- a/src/vs/workbench/browser/parts/editor/editorPart.ts +++ b/src/vs/workbench/browser/parts/editor/editorPart.ts @@ -81,14 +81,14 @@ export class EditorPart extends Part implements IEditorPart, IEditorGroupService public _serviceBrand: any; - private static GROUP_LEFT = nls.localize('groupOneVertical', "Left"); - private static GROUP_CENTER = nls.localize('groupTwoVertical', "Center"); - private static GROUP_RIGHT = nls.localize('groupThreeVertical', "Right"); - private static GROUP_TOP = nls.localize('groupOneHorizontal', "Top"); - private static GROUP_MIDDLE = nls.localize('groupTwoHorizontal', "Center"); - private static GROUP_BOTTOM = nls.localize('groupThreeHorizontal', "Bottom"); + private static readonly GROUP_LEFT = nls.localize('groupOneVertical', "Left"); + private static readonly GROUP_CENTER = nls.localize('groupTwoVertical', "Center"); + private static readonly GROUP_RIGHT = nls.localize('groupThreeVertical', "Right"); + private static readonly GROUP_TOP = nls.localize('groupOneHorizontal', "Top"); + private static readonly GROUP_MIDDLE = nls.localize('groupTwoHorizontal', "Center"); + private static readonly GROUP_BOTTOM = nls.localize('groupThreeHorizontal', "Bottom"); - private static EDITOR_PART_UI_STATE_STORAGE_KEY = 'editorpart.uiState'; + private static readonly EDITOR_PART_UI_STATE_STORAGE_KEY = 'editorpart.uiState'; private dimension: Dimension; private editorGroupsControl: IEditorGroupsControl; diff --git a/src/vs/workbench/browser/parts/editor/rangeDecorations.ts b/src/vs/workbench/browser/parts/editor/rangeDecorations.ts index 1034ac20a27..e1b0e1ddd58 100644 --- a/src/vs/workbench/browser/parts/editor/rangeDecorations.ts +++ b/src/vs/workbench/browser/parts/editor/rangeDecorations.ts @@ -92,13 +92,13 @@ export class RangeHighlightDecorations implements IDisposable { this.editorDisposables = []; } - private static _WHOLE_LINE_RANGE_HIGHLIGHT = ModelDecorationOptions.register({ + private static readonly _WHOLE_LINE_RANGE_HIGHLIGHT = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'rangeHighlight', isWholeLine: true }); - private static _RANGE_HIGHLIGHT = ModelDecorationOptions.register({ + private static readonly _RANGE_HIGHLIGHT = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'rangeHighlight' }); diff --git a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts index ed2a3f17979..d940c64917c 100644 --- a/src/vs/workbench/browser/parts/editor/textDiffEditor.ts +++ b/src/vs/workbench/browser/parts/editor/textDiffEditor.ts @@ -341,9 +341,9 @@ class NavigateAction extends Action { } class ToggleEditorModeAction extends Action { - private static ID = 'toggle.diff.editorMode'; - private static INLINE_LABEL = nls.localize('inlineDiffLabel', "Switch to Inline View"); - private static SIDEBYSIDE_LABEL = nls.localize('sideBySideDiffLabel', "Switch to Side by Side View"); + private static readonly ID = 'toggle.diff.editorMode'; + private static readonly INLINE_LABEL = nls.localize('inlineDiffLabel', "Switch to Inline View"); + private static readonly SIDEBYSIDE_LABEL = nls.localize('sideBySideDiffLabel', "Switch to Side by Side View"); constructor(private editor: TextDiffEditor) { super(ToggleEditorModeAction.ID); diff --git a/src/vs/workbench/browser/parts/panel/panelActions.ts b/src/vs/workbench/browser/parts/panel/panelActions.ts index 6ae2b0592d7..e97e283ff42 100644 --- a/src/vs/workbench/browser/parts/panel/panelActions.ts +++ b/src/vs/workbench/browser/parts/panel/panelActions.ts @@ -85,8 +85,8 @@ export class TogglePanelPositionAction extends Action { public static readonly ID = 'workbench.action.togglePanelPosition'; public static readonly LABEL = nls.localize('toggledPanelPosition', "Toggle Panel Position"); - private static MOVE_TO_RIGHT_LABEL = nls.localize('moveToRight', "Move to Right"); - private static MOVE_TO_BOTTOM_LABEL = nls.localize('moveToBottom', "Move to Bottom"); + private static readonly MOVE_TO_RIGHT_LABEL = nls.localize('moveToRight', "Move to Right"); + private static readonly MOVE_TO_BOTTOM_LABEL = nls.localize('moveToBottom', "Move to Bottom"); private toDispose: IDisposable[]; constructor( @@ -121,8 +121,8 @@ export class ToggleMaximizedPanelAction extends Action { public static readonly ID = 'workbench.action.toggleMaximizedPanel'; public static readonly LABEL = nls.localize('toggleMaximizedPanel', "Toggle Maximized Panel"); - private static MAXIMIZE_LABEL = nls.localize('maximizePanel', "Maximize Panel Size"); - private static RESTORE_LABEL = nls.localize('minimizePanel', "Restore Panel Size"); + private static readonly MAXIMIZE_LABEL = nls.localize('maximizePanel', "Maximize Panel Size"); + private static readonly RESTORE_LABEL = nls.localize('minimizePanel', "Restore Panel Size"); private toDispose: IDisposable[]; constructor( diff --git a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts index 5de3fd3bfb6..c301f8d29e3 100644 --- a/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts +++ b/src/vs/workbench/browser/parts/quickopen/quickOpenController.ts @@ -77,11 +77,11 @@ interface IInternalPickOptions { export class QuickOpenController extends Component implements IQuickOpenService { - private static MAX_SHORT_RESPONSE_TIME = 500; + private static readonly MAX_SHORT_RESPONSE_TIME = 500; public _serviceBrand: any; - private static ID = 'workbench.component.quickopen'; + private static readonly ID = 'workbench.component.quickopen'; private _onShow: Emitter; private _onHide: Emitter; diff --git a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts index 3b34b1cb77b..b694e1d7efe 100644 --- a/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts +++ b/src/vs/workbench/browser/parts/statusbar/statusbarPart.ts @@ -36,8 +36,8 @@ export class StatusbarPart extends Part implements IStatusbarService { public _serviceBrand: any; - private static PRIORITY_PROP = 'priority'; - private static ALIGNMENT_PROP = 'alignment'; + private static readonly PRIORITY_PROP = 'priority'; + private static readonly ALIGNMENT_PROP = 'alignment'; private statusItemsContainer: Builder; private statusMsgDispose: IDisposable; diff --git a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts index f7f6d7ee3d3..bd5633c031b 100644 --- a/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts +++ b/src/vs/workbench/browser/parts/titlebar/titlebarPart.ts @@ -39,10 +39,10 @@ export class TitlebarPart extends Part implements ITitleService { public _serviceBrand: any; - private static NLS_UNSUPPORTED = nls.localize('patchedWindowTitle', "[Unsupported]"); - private static NLS_EXTENSION_HOST = nls.localize('devExtensionWindowTitlePrefix', "[Extension Development Host]"); - private static TITLE_DIRTY = '\u25cf '; - private static TITLE_SEPARATOR = isMacintosh ? ' — ' : ' - '; // macOS uses special - separator + private static readonly NLS_UNSUPPORTED = nls.localize('patchedWindowTitle', "[Unsupported]"); + private static readonly NLS_EXTENSION_HOST = nls.localize('devExtensionWindowTitlePrefix', "[Extension Development Host]"); + private static readonly TITLE_DIRTY = '\u25cf '; + private static readonly TITLE_SEPARATOR = isMacintosh ? ' — ' : ' - '; // macOS uses special - separator private titleContainer: Builder; private title: Builder; diff --git a/src/vs/workbench/browser/parts/views/treeView.ts b/src/vs/workbench/browser/parts/views/treeView.ts index 30d2e6856e2..d7bee751d17 100644 --- a/src/vs/workbench/browser/parts/views/treeView.ts +++ b/src/vs/workbench/browser/parts/views/treeView.ts @@ -255,8 +255,8 @@ interface ITreeExplorerTemplateData { class TreeRenderer implements IRenderer { - private static ITEM_HEIGHT = 22; - private static TREE_TEMPLATE_ID = 'treeExplorer'; + private static readonly ITEM_HEIGHT = 22; + private static readonly TREE_TEMPLATE_ID = 'treeExplorer'; constructor( @IThemeService private themeService: IThemeService) { } diff --git a/src/vs/workbench/common/editor/editorStacksModel.ts b/src/vs/workbench/common/editor/editorStacksModel.ts index 78891b8d501..7a980df5af7 100644 --- a/src/vs/workbench/common/editor/editorStacksModel.ts +++ b/src/vs/workbench/common/editor/editorStacksModel.ts @@ -700,7 +700,7 @@ interface ISerializedEditorStacksModel { export class EditorStacksModel implements IEditorStacksModel { - private static STORAGE_KEY = 'editorStacks.model'; + private static readonly STORAGE_KEY = 'editorStacks.model'; private toDispose: IDisposable[]; private loaded: boolean; diff --git a/src/vs/workbench/common/memento.ts b/src/vs/workbench/common/memento.ts index eff56087e98..60067a20425 100644 --- a/src/vs/workbench/common/memento.ts +++ b/src/vs/workbench/common/memento.ts @@ -32,7 +32,7 @@ export class Memento { private static globalMementos: { [id: string]: ScopedMemento } = {}; private static workspaceMementos: { [id: string]: ScopedMemento } = {}; - private static COMMON_PREFIX = 'memento/'; + private static readonly COMMON_PREFIX = 'memento/'; private id: string; diff --git a/src/vs/workbench/electron-browser/actions.ts b/src/vs/workbench/electron-browser/actions.ts index 89a04934480..cae8f800d69 100644 --- a/src/vs/workbench/electron-browser/actions.ts +++ b/src/vs/workbench/electron-browser/actions.ts @@ -152,7 +152,7 @@ export class ToggleMenuBarAction extends Action { static ID = 'workbench.action.toggleMenuBar'; static LABEL = nls.localize('toggleMenuBar', "Toggle Menu Bar"); - private static menuBarVisibilityKey = 'window.menuBarVisibility'; + private static readonly menuBarVisibilityKey = 'window.menuBarVisibility'; constructor( id: string, @@ -196,7 +196,7 @@ export class ToggleDevToolsAction extends Action { } export abstract class BaseZoomAction extends Action { - private static SETTING_KEY = 'window.zoomLevel'; + private static readonly SETTING_KEY = 'window.zoomLevel'; constructor( id: string, @@ -1100,7 +1100,7 @@ export class KeybindingsReferenceAction extends Action { public static readonly ID = 'workbench.action.keybindingsReference'; public static readonly LABEL = nls.localize('keybindingsReference', "Keyboard Shortcuts Reference"); - private static URL = isLinux ? product.keyboardShortcutsUrlLinux : isMacintosh ? product.keyboardShortcutsUrlMac : product.keyboardShortcutsUrlWin; + private static readonly URL = isLinux ? product.keyboardShortcutsUrlLinux : isMacintosh ? product.keyboardShortcutsUrlMac : product.keyboardShortcutsUrlWin; public static readonly AVAILABLE = !!KeybindingsReferenceAction.URL; constructor( @@ -1121,7 +1121,7 @@ export class OpenDocumentationUrlAction extends Action { public static readonly ID = 'workbench.action.openDocumentationUrl'; public static readonly LABEL = nls.localize('openDocumentationUrl', "Documentation"); - private static URL = product.documentationUrl; + private static readonly URL = product.documentationUrl; public static readonly AVAILABLE = !!OpenDocumentationUrlAction.URL; constructor( @@ -1142,7 +1142,7 @@ export class OpenIntroductoryVideosUrlAction extends Action { public static readonly ID = 'workbench.action.openIntroductoryVideosUrl'; public static readonly LABEL = nls.localize('openIntroductoryVideosUrl', "Introductory Videos"); - private static URL = product.introductoryVideosUrl; + private static readonly URL = product.introductoryVideosUrl; public static readonly AVAILABLE = !!OpenIntroductoryVideosUrlAction.URL; constructor( @@ -1163,7 +1163,7 @@ export class OpenTipsAndTricksUrlAction extends Action { public static readonly ID = 'workbench.action.openTipsAndTricksUrl'; public static readonly LABEL = nls.localize('openTipsAndTricksUrl', "Tips and Tricks"); - private static URL = product.tipsAndTricksUrl; + private static readonly URL = product.tipsAndTricksUrl; public static readonly AVAILABLE = !!OpenTipsAndTricksUrlAction.URL; constructor( diff --git a/src/vs/workbench/electron-browser/window.ts b/src/vs/workbench/electron-browser/window.ts index f7ca48b2098..c6808d83187 100644 --- a/src/vs/workbench/electron-browser/window.ts +++ b/src/vs/workbench/electron-browser/window.ts @@ -60,7 +60,7 @@ const TextInputActions: IAction[] = [ export class ElectronWindow extends Themable { - private static AUTO_SAVE_SETTING = 'files.autoSave'; + private static readonly AUTO_SAVE_SETTING = 'files.autoSave'; private touchBarUpdater: RunOnceScheduler; private touchBarMenu: IMenu; diff --git a/src/vs/workbench/electron-browser/workbench.ts b/src/vs/workbench/electron-browser/workbench.ts index ac402789f8c..52f9f210d19 100644 --- a/src/vs/workbench/electron-browser/workbench.ts +++ b/src/vs/workbench/electron-browser/workbench.ts @@ -140,19 +140,19 @@ const Identifiers = { */ export class Workbench implements IPartService { - private static sidebarHiddenStorageKey = 'workbench.sidebar.hidden'; - private static sidebarRestoreStorageKey = 'workbench.sidebar.restore'; - private static panelHiddenStorageKey = 'workbench.panel.hidden'; - private static zenModeActiveStorageKey = 'workbench.zenmode.active'; - private static panelPositionStorageKey = 'workbench.panel.location'; + private static readonly sidebarHiddenStorageKey = 'workbench.sidebar.hidden'; + private static readonly sidebarRestoreStorageKey = 'workbench.sidebar.restore'; + private static readonly panelHiddenStorageKey = 'workbench.panel.hidden'; + private static readonly zenModeActiveStorageKey = 'workbench.zenmode.active'; + private static readonly panelPositionStorageKey = 'workbench.panel.location'; - private static sidebarPositionConfigurationKey = 'workbench.sideBar.location'; - private static statusbarVisibleConfigurationKey = 'workbench.statusBar.visible'; - private static activityBarVisibleConfigurationKey = 'workbench.activityBar.visible'; + private static readonly sidebarPositionConfigurationKey = 'workbench.sideBar.location'; + private static readonly statusbarVisibleConfigurationKey = 'workbench.statusBar.visible'; + private static readonly activityBarVisibleConfigurationKey = 'workbench.activityBar.visible'; - private static closeWhenEmptyConfigurationKey = 'window.closeWhenEmpty'; + private static readonly closeWhenEmptyConfigurationKey = 'window.closeWhenEmpty'; - private static fontAliasingConfigurationKey = 'workbench.fontAliasing'; + private static readonly fontAliasingConfigurationKey = 'workbench.fontAliasing'; private _onTitleBarVisibilityChange: Emitter; diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts b/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts index da83137738d..bfc2994524a 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/accessibility.ts @@ -36,7 +36,7 @@ const CONTEXT_ACCESSIBILITY_WIDGET_VISIBLE = new RawContextKey('accessi class AccessibilityHelpController extends Disposable implements IEditorContribution { - private static ID = 'editor.contrib.accessibilityHelpController'; + private static readonly ID = 'editor.contrib.accessibilityHelpController'; public static get(editor: ICodeEditor): AccessibilityHelpController { return editor.getContribution(AccessibilityHelpController.ID); @@ -70,9 +70,9 @@ class AccessibilityHelpController extends Disposable implements IEditorContribut class AccessibilityHelpWidget extends Widget implements IOverlayWidget { - private static ID = 'editor.contrib.accessibilityHelpWidget'; - private static WIDTH = 500; - private static HEIGHT = 300; + private static readonly ID = 'editor.contrib.accessibilityHelpWidget'; + private static readonly WIDTH = 500; + private static readonly HEIGHT = 300; private _editor: ICodeEditor; private _domNode: FastDomNode; diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/menuPreventer.ts b/src/vs/workbench/parts/codeEditor/electron-browser/menuPreventer.ts index 6dc70ac4c86..be8c1221f25 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/menuPreventer.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/menuPreventer.ts @@ -15,7 +15,7 @@ import { registerEditorContribution } from 'vs/editor/browser/editorExtensions'; */ export class MenuPreventer extends Disposable implements IEditorContribution { - private static ID = 'editor.contrib.menuPreventer'; + private static readonly ID = 'editor.contrib.menuPreventer'; private _editor: ICodeEditor; private _altListeningMouse: boolean; diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/selectionClipboard.ts b/src/vs/workbench/parts/codeEditor/electron-browser/selectionClipboard.ts index 7b62f5c3740..f3187ce413d 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/selectionClipboard.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/selectionClipboard.ts @@ -19,7 +19,7 @@ import { ICursorSelectionChangedEvent } from 'vs/editor/common/controller/cursor export class SelectionClipboard extends Disposable implements IEditorContribution { - private static ID = 'editor.contrib.selectionClipboard'; + private static readonly ID = 'editor.contrib.selectionClipboard'; constructor(editor: ICodeEditor, @IContextKeyService contextKeyService: IContextKeyService) { super(); diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts b/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts index b585f503955..a2aa7d6a068 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/textMate/inspectTMScopes.ts @@ -31,7 +31,7 @@ import { editorHoverBackground, editorHoverBorder } from 'vs/platform/theme/comm class InspectTMScopesController extends Disposable implements IEditorContribution { - private static ID = 'editor.contrib.inspectTMScopes'; + private static readonly ID = 'editor.contrib.inspectTMScopes'; public static get(editor: ICodeEditor): InspectTMScopesController { return editor.getContribution(InspectTMScopesController.ID); @@ -170,7 +170,7 @@ function renderTokenText(tokenText: string): string { class InspectTMScopesWidget extends Disposable implements IContentWidget { - private static _ID = 'editor.contrib.inspectTMScopesWidget'; + private static readonly _ID = 'editor.contrib.inspectTMScopesWidget'; // Editor.IContentWidget.allowEditorOverflow public readonly allowEditorOverflow = true; diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts b/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts index 9da1ef9d88d..e7b79739e01 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/toggleMultiCursorModifier.ts @@ -17,7 +17,7 @@ export class ToggleMultiCursorModifierAction extends Action { public static readonly ID = 'workbench.action.toggleMultiCursorModifier'; public static readonly LABEL = nls.localize('toggleLocation', "Toggle Multi-Cursor Modifier"); - private static multiCursorModifierConfigurationKey = 'editor.multiCursorModifier'; + private static readonly multiCursorModifierConfigurationKey = 'editor.multiCursorModifier'; constructor( id: string, diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts index 2db0fe76780..d21f8d8e060 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/toggleWordWrap.ts @@ -176,7 +176,7 @@ class ToggleWordWrapAction extends EditorAction { class ToggleWordWrapController extends Disposable implements IEditorContribution { - private static _ID = 'editor.contrib.toggleWordWrapController'; + private static readonly _ID = 'editor.contrib.toggleWordWrapController'; constructor( private readonly editor: ICodeEditor, diff --git a/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.ts b/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.ts index 197566cced6..023bb504812 100644 --- a/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.ts +++ b/src/vs/workbench/parts/codeEditor/electron-browser/wordWrapMigration.ts @@ -22,7 +22,7 @@ interface IStorageData { } class WordWrapMigrationStorage { - private static KEY = 'wordWrapMigration'; + private static readonly KEY = 'wordWrapMigration'; private _storageService: IStorageService; private _value: IStorageData; @@ -56,7 +56,7 @@ class WordWrapMigrationStorage { class WordWrapMigrationController extends Disposable implements IEditorContribution { - private static ID = 'editor.contrib.wordWrapMigrationController'; + private static readonly ID = 'editor.contrib.wordWrapMigrationController'; private static _checked = false; constructor( diff --git a/src/vs/workbench/parts/debug/browser/debugActionItems.ts b/src/vs/workbench/parts/debug/browser/debugActionItems.ts index e0e11dc6a69..914a20cfadd 100644 --- a/src/vs/workbench/parts/debug/browser/debugActionItems.ts +++ b/src/vs/workbench/parts/debug/browser/debugActionItems.ts @@ -24,7 +24,7 @@ const $ = dom.$; export class StartDebugActionItem implements IActionItem { - private static SEPARATOR = '─────────'; + private static readonly SEPARATOR = '─────────'; public actionRunner: IActionRunner; private container: HTMLElement; diff --git a/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts b/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts index 167b04280c9..59eeb60e6b0 100644 --- a/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts +++ b/src/vs/workbench/parts/debug/browser/debugActionsWidget.ts @@ -39,7 +39,7 @@ export const debugToolBarBackground = registerColor('debugToolBar.background', { }, localize('debugToolBarBackground', "Debug toolbar background color.")); export class DebugActionsWidget extends Themable implements IWorkbenchContribution { - private static ID = 'debug.actionsWidget'; + private static readonly ID = 'debug.actionsWidget'; private $el: builder.Builder; private dragArea: builder.Builder; diff --git a/src/vs/workbench/parts/debug/common/debugModel.ts b/src/vs/workbench/parts/debug/common/debugModel.ts index c8ef0226454..8ca94fe2f2d 100644 --- a/src/vs/workbench/parts/debug/common/debugModel.ts +++ b/src/vs/workbench/parts/debug/common/debugModel.ts @@ -58,7 +58,7 @@ export class SimpleReplElement extends AbstractReplElement { export class RawObjectReplElement extends AbstractReplElement implements IExpression { - private static MAX_CHILDREN = 1000; // upper bound of children per value + private static readonly MAX_CHILDREN = 1000; // upper bound of children per value constructor(public name: string, public valueObj: any, source?: IReplElementSource, public annotation?: string) { super(source); @@ -104,7 +104,7 @@ export class ExpressionContainer implements IExpressionContainer { public static allValues: Map = new Map(); // Use chunks to support variable paging #9537 - private static BASE_CHUNK_SIZE = 100; + private static readonly BASE_CHUNK_SIZE = 100; public valueChanged: boolean; private _value: string; diff --git a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts index 1fb7bb0b6eb..4f7156c1cbc 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugViewer.ts @@ -444,11 +444,11 @@ interface IStackFrameTemplateData { export class CallStackRenderer implements IRenderer { - private static THREAD_TEMPLATE_ID = 'thread'; - private static STACK_FRAME_TEMPLATE_ID = 'stackFrame'; - private static ERROR_TEMPLATE_ID = 'error'; - private static LOAD_MORE_TEMPLATE_ID = 'loadMore'; - private static PROCESS_TEMPLATE_ID = 'process'; + private static readonly THREAD_TEMPLATE_ID = 'thread'; + private static readonly STACK_FRAME_TEMPLATE_ID = 'stackFrame'; + private static readonly ERROR_TEMPLATE_ID = 'error'; + private static readonly LOAD_MORE_TEMPLATE_ID = 'loadMore'; + private static readonly PROCESS_TEMPLATE_ID = 'process'; constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService, @@ -691,8 +691,8 @@ export interface IVariableTemplateData { export class VariablesRenderer implements IRenderer { - private static SCOPE_TEMPLATE_ID = 'scope'; - private static VARIABLE_TEMPLATE_ID = 'variable'; + private static readonly SCOPE_TEMPLATE_ID = 'scope'; + private static readonly VARIABLE_TEMPLATE_ID = 'variable'; constructor( @debug.IDebugService private debugService: debug.IDebugService, @@ -883,8 +883,8 @@ interface IWatchExpressionTemplateData { export class WatchExpressionsRenderer implements IRenderer { - private static WATCH_EXPRESSION_TEMPLATE_ID = 'watchExpression'; - private static VARIABLE_TEMPLATE_ID = 'variables'; + private static readonly WATCH_EXPRESSION_TEMPLATE_ID = 'watchExpression'; + private static readonly VARIABLE_TEMPLATE_ID = 'variables'; private toDispose: lifecycle.IDisposable[]; constructor( @@ -1124,9 +1124,9 @@ interface IBreakpointTemplateData extends IBaseBreakpointTemplateData { export class BreakpointsRenderer implements IRenderer { - private static EXCEPTION_BREAKPOINT_TEMPLATE_ID = 'exceptionBreakpoint'; - private static FUNCTION_BREAKPOINT_TEMPLATE_ID = 'functionBreakpoint'; - private static BREAKPOINT_TEMPLATE_ID = 'breakpoint'; + private static readonly EXCEPTION_BREAKPOINT_TEMPLATE_ID = 'exceptionBreakpoint'; + private static readonly FUNCTION_BREAKPOINT_TEMPLATE_ID = 'functionBreakpoint'; + private static readonly BREAKPOINT_TEMPLATE_ID = 'breakpoint'; constructor( @IWorkspaceContextService private contextService: IWorkspaceContextService, diff --git a/src/vs/workbench/parts/debug/electron-browser/debugViews.ts b/src/vs/workbench/parts/debug/electron-browser/debugViews.ts index b2324b2b712..e457ed0cf80 100644 --- a/src/vs/workbench/parts/debug/electron-browser/debugViews.ts +++ b/src/vs/workbench/parts/debug/electron-browser/debugViews.ts @@ -42,7 +42,7 @@ const twistiePixels = 20; export class VariablesView extends ViewsViewletPanel { - private static MEMENTO = 'variablesview.memento'; + private static readonly MEMENTO = 'variablesview.memento'; private onFocusStackFrameScheduler: RunOnceScheduler; private variablesFocusedContext: IContextKey; private settings: any; @@ -153,7 +153,7 @@ export class VariablesView extends ViewsViewletPanel { export class WatchExpressionsView extends ViewsViewletPanel { - private static MEMENTO = 'watchexpressionsview.memento'; + private static readonly MEMENTO = 'watchexpressionsview.memento'; private onWatchExpressionsUpdatedScheduler: RunOnceScheduler; private toReveal: IExpression; private watchExpressionsFocusedContext: IContextKey; @@ -245,7 +245,7 @@ export class WatchExpressionsView extends ViewsViewletPanel { export class CallStackView extends ViewsViewletPanel { - private static MEMENTO = 'callstackview.memento'; + private static readonly MEMENTO = 'callstackview.memento'; private pauseMessage: builder.Builder; private pauseMessageLabel: builder.Builder; private onCallStackChangeScheduler: RunOnceScheduler; @@ -381,8 +381,8 @@ export class CallStackView extends ViewsViewletPanel { export class BreakpointsView extends ViewsViewletPanel { - private static MAX_VISIBLE_FILES = 9; - private static MEMENTO = 'breakopintsview.memento'; + private static readonly MAX_VISIBLE_FILES = 9; + private static readonly MEMENTO = 'breakopintsview.memento'; private breakpointsFocusedContext: IContextKey; private settings: any; diff --git a/src/vs/workbench/parts/debug/electron-browser/repl.ts b/src/vs/workbench/parts/debug/electron-browser/repl.ts index eb89872ba9b..3d8dba4e41e 100644 --- a/src/vs/workbench/parts/debug/electron-browser/repl.ts +++ b/src/vs/workbench/parts/debug/electron-browser/repl.ts @@ -66,12 +66,12 @@ export interface IPrivateReplService { export class Repl extends Panel implements IPrivateReplService { public _serviceBrand: any; - private static HALF_WIDTH_TYPICAL = 'n'; + private static readonly HALF_WIDTH_TYPICAL = 'n'; private static HISTORY: ReplHistory; - private static REFRESH_DELAY = 500; // delay in ms to refresh the repl for new elements to show - private static REPL_INPUT_INITIAL_HEIGHT = 19; - private static REPL_INPUT_MAX_HEIGHT = 170; + private static readonly REFRESH_DELAY = 500; // delay in ms to refresh the repl for new elements to show + private static readonly REPL_INPUT_INITIAL_HEIGHT = 19; + private static readonly REPL_INPUT_MAX_HEIGHT = 170; private tree: ITree; private renderer: ReplExpressionsRenderer; diff --git a/src/vs/workbench/parts/debug/electron-browser/replViewer.ts b/src/vs/workbench/parts/debug/electron-browser/replViewer.ts index d1224cbfe6a..d761ceea00e 100644 --- a/src/vs/workbench/parts/debug/electron-browser/replViewer.ts +++ b/src/vs/workbench/parts/debug/electron-browser/replViewer.ts @@ -80,12 +80,12 @@ interface IRawObjectReplTemplateData { export class ReplExpressionsRenderer implements IRenderer { - private static VARIABLE_TEMPLATE_ID = 'variable'; - private static EXPRESSION_TEMPLATE_ID = 'expressionRepl'; - private static SIMPLE_REPL_ELEMENT_TEMPLATE_ID = 'simpleReplElement'; - private static RAW_OBJECT_REPL_ELEMENT_TEMPLATE_ID = 'rawObject'; + private static readonly VARIABLE_TEMPLATE_ID = 'variable'; + private static readonly EXPRESSION_TEMPLATE_ID = 'expressionRepl'; + private static readonly SIMPLE_REPL_ELEMENT_TEMPLATE_ID = 'simpleReplElement'; + private static readonly RAW_OBJECT_REPL_ELEMENT_TEMPLATE_ID = 'rawObject'; - private static LINE_HEIGHT_PX = 18; + private static readonly LINE_HEIGHT_PX = 18; private width: number; private characterWidth: number; diff --git a/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts b/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts index a49f5ec93e9..54b01cf1f2c 100644 --- a/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts +++ b/src/vs/workbench/parts/debug/electron-browser/statusbarColorProvider.ts @@ -34,7 +34,7 @@ export const STATUS_BAR_DEBUGGING_BORDER = registerColor('statusBar.debuggingBor }, localize('statusBarDebuggingBorder', "Status bar border color separating to the sidebar and editor when a program is being debugged. The status bar is shown in the bottom of the window")); export class StatusBarColorProvider extends Themable implements IWorkbenchContribution { - private static ID = 'debug.statusbarColorProvider'; + private static readonly ID = 'debug.statusbarColorProvider'; constructor( @IThemeService themeService: IThemeService, diff --git a/src/vs/workbench/parts/debug/node/v8Protocol.ts b/src/vs/workbench/parts/debug/node/v8Protocol.ts index 33a40bc0362..1287d8fb924 100644 --- a/src/vs/workbench/parts/debug/node/v8Protocol.ts +++ b/src/vs/workbench/parts/debug/node/v8Protocol.ts @@ -9,7 +9,7 @@ import { canceled } from 'vs/base/common/errors'; export abstract class V8Protocol { - private static TWO_CRLF = '\r\n\r\n'; + private static readonly TWO_CRLF = '\r\n\r\n'; private outputStream: stream.Writable; private sequence: number; diff --git a/src/vs/workbench/parts/execution/electron-browser/terminalService.ts b/src/vs/workbench/parts/execution/electron-browser/terminalService.ts index 4c2ef371872..f8dd3a66f5f 100644 --- a/src/vs/workbench/parts/execution/electron-browser/terminalService.ts +++ b/src/vs/workbench/parts/execution/electron-browser/terminalService.ts @@ -28,7 +28,7 @@ enum WinSpawnType { export class WinTerminalService implements ITerminalService { public _serviceBrand: any; - private static CMD = 'cmd.exe'; + private static readonly CMD = 'cmd.exe'; constructor( @IConfigurationService private _configurationService: IConfigurationService @@ -114,7 +114,7 @@ export class WinTerminalService implements ITerminalService { export class MacTerminalService implements ITerminalService { public _serviceBrand: any; - private static OSASCRIPT = '/usr/bin/osascript'; // osascript is the AppleScript interpreter on OS X + private static readonly OSASCRIPT = '/usr/bin/osascript'; // osascript is the AppleScript interpreter on OS X constructor( @IConfigurationService private _configurationService: IConfigurationService @@ -199,7 +199,7 @@ export class MacTerminalService implements ITerminalService { export class LinuxTerminalService implements ITerminalService { public _serviceBrand: any; - private static WAIT_MESSAGE = nls.localize('press.any.key', "Press any key to continue..."); + private static readonly WAIT_MESSAGE = nls.localize('press.any.key', "Press any key to continue..."); constructor( @IConfigurationService private _configurationService: IConfigurationService diff --git a/src/vs/workbench/parts/extensions/browser/dependenciesViewer.ts b/src/vs/workbench/parts/extensions/browser/dependenciesViewer.ts index 8b3168e0665..b4c3abe5334 100644 --- a/src/vs/workbench/parts/extensions/browser/dependenciesViewer.ts +++ b/src/vs/workbench/parts/extensions/browser/dependenciesViewer.ts @@ -55,8 +55,8 @@ export class DataSource implements IDataSource { export class Renderer implements IRenderer { - private static EXTENSION_TEMPLATE_ID = 'extension-template'; - private static UNKNOWN_EXTENSION_TEMPLATE_ID = 'unknown-extension-template'; + private static readonly EXTENSION_TEMPLATE_ID = 'extension-template'; + private static readonly UNKNOWN_EXTENSION_TEMPLATE_ID = 'unknown-extension-template'; constructor( @IInstantiationService private instantiationService: IInstantiationService) { } diff --git a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts index 853830a99a4..0e60baf613b 100644 --- a/src/vs/workbench/parts/extensions/browser/extensionsActions.ts +++ b/src/vs/workbench/parts/extensions/browser/extensionsActions.ts @@ -44,11 +44,11 @@ import { PagedModel } from 'vs/base/common/paging'; export class InstallAction extends Action { - private static InstallLabel = localize('installAction', "Install"); - private static InstallingLabel = localize('installing', "Installing"); + private static readonly InstallLabel = localize('installAction', "Install"); + private static readonly InstallingLabel = localize('installing', "Installing"); - private static Class = 'extension-action prominent install'; - private static InstallingClass = 'extension-action install installing'; + private static readonly Class = 'extension-action prominent install'; + private static readonly InstallingClass = 'extension-action install installing'; private disposables: IDisposable[] = []; private _extension: IExtension; @@ -98,11 +98,11 @@ export class InstallAction extends Action { export class UninstallAction extends Action { - private static UninstallLabel = localize('uninstallAction', "Uninstall"); - private static UninstallingLabel = localize('Uninstalling', "Uninstalling"); + private static readonly UninstallLabel = localize('uninstallAction', "Uninstall"); + private static readonly UninstallingLabel = localize('Uninstalling', "Uninstalling"); - private static UninstallClass = 'extension-action uninstall'; - private static UnInstallingClass = 'extension-action uninstall uninstalling'; + private static readonly UninstallClass = 'extension-action uninstall'; + private static readonly UnInstallingClass = 'extension-action uninstall uninstalling'; private disposables: IDisposable[] = []; private _extension: IExtension; @@ -163,7 +163,7 @@ export class UninstallAction extends Action { export class CombinedInstallAction extends Action { - private static NoExtensionClass = 'extension-action prominent install no-extension'; + private static readonly NoExtensionClass = 'extension-action prominent install no-extension'; private installAction: InstallAction; private uninstallAction: UninstallAction; private disposables: IDisposable[] = []; @@ -239,9 +239,9 @@ export class CombinedInstallAction extends Action { export class UpdateAction extends Action { - private static EnabledClass = 'extension-action prominent update'; - private static DisabledClass = `${UpdateAction.EnabledClass} disabled`; - private static Label = localize('updateAction', "Update"); + private static readonly EnabledClass = 'extension-action prominent update'; + private static readonly DisabledClass = `${UpdateAction.EnabledClass} disabled`; + private static readonly Label = localize('updateAction', "Update"); private disposables: IDisposable[] = []; private _extension: IExtension; @@ -349,8 +349,8 @@ export class ManageExtensionAction extends Action { static ID = 'extensions.manage'; - private static Class = 'extension-action manage'; - private static HideManageExtensionClass = `${ManageExtensionAction.Class} hide`; + private static readonly Class = 'extension-action manage'; + private static readonly HideManageExtensionClass = `${ManageExtensionAction.Class} hide`; private _actionItem: DropDownMenuActionItem; get actionItem(): IActionItem { return this._actionItem; } @@ -489,8 +489,8 @@ export class EnableGloballyAction extends Action implements IExtensionAction { export class EnableAction extends Action { static ID = 'extensions.enable'; - private static EnabledClass = 'extension-action prominent enable'; - private static DisabledClass = `${EnableAction.EnabledClass} disabled`; + private static readonly EnabledClass = 'extension-action prominent enable'; + private static readonly DisabledClass = `${EnableAction.EnabledClass} disabled`; private disposables: IDisposable[] = []; @@ -624,8 +624,8 @@ export class DisableAction extends Action { static ID = 'extensions.disable'; - private static EnabledClass = 'extension-action disable'; - private static DisabledClass = `${DisableAction.EnabledClass} disabled`; + private static readonly EnabledClass = 'extension-action disable'; + private static readonly DisabledClass = `${DisableAction.EnabledClass} disabled`; private disposables: IDisposable[] = []; private _actionItem: DropDownMenuActionItem; @@ -781,8 +781,8 @@ export class UpdateAllAction extends Action { export class ReloadAction extends Action { - private static EnabledClass = 'extension-action reload'; - private static DisabledClass = `${ReloadAction.EnabledClass} disabled`; + private static readonly EnabledClass = 'extension-action reload'; + private static readonly DisabledClass = `${ReloadAction.EnabledClass} disabled`; private disposables: IDisposable[] = []; private _extension: IExtension; @@ -1508,7 +1508,7 @@ export class ConfigureWorkspaceFolderRecommendedExtensionsAction extends Abstrac export class BuiltinStatusLabelAction extends Action { - private static Class = 'extension-action built-in-status'; + private static readonly Class = 'extension-action built-in-status'; private _extension: IExtension; get extension(): IExtension { return this._extension; } diff --git a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts index bd7aeab4eb9..9644aa18617 100644 --- a/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts +++ b/src/vs/workbench/parts/extensions/node/extensionsWorkbenchService.ts @@ -314,7 +314,7 @@ function toTelemetryEventName(operation: Operation) { export class ExtensionsWorkbenchService implements IExtensionsWorkbenchService { - private static SyncPeriod = 1000 * 60 * 60 * 12; // 12 hours + private static readonly SyncPeriod = 1000 * 60 * 60 * 12; // 12 hours _serviceBrand: any; private stateProvider: IExtensionStateProvider; diff --git a/src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts b/src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts index 9837557f688..e06c2e39dc9 100644 --- a/src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts +++ b/src/vs/workbench/parts/files/electron-browser/explorerViewlet.ts @@ -35,7 +35,7 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView export class ExplorerViewlet extends PersistentViewsViewlet implements IExplorerViewlet { - private static EXPLORER_VIEWS_STATE = 'workbench.explorer.views.state'; + private static readonly EXPLORER_VIEWS_STATE = 'workbench.explorer.views.state'; private viewletState: FileViewletState; private viewletVisibleContextKey: IContextKey; diff --git a/src/vs/workbench/parts/files/electron-browser/fileActions.ts b/src/vs/workbench/parts/files/electron-browser/fileActions.ts index d1cdc937a2b..5dbf38e4515 100644 --- a/src/vs/workbench/parts/files/electron-browser/fileActions.ts +++ b/src/vs/workbench/parts/files/electron-browser/fileActions.ts @@ -626,7 +626,7 @@ export class CreateFolderAction extends BaseCreateAction { export class BaseDeleteFileAction extends BaseFileAction { - private static CONFIRM_DELETE_SETTING_KEY = 'explorer.confirmDelete'; + private static readonly CONFIRM_DELETE_SETTING_KEY = 'explorer.confirmDelete'; private tree: ITree; private useTrash: boolean; @@ -1994,7 +1994,7 @@ export class CompareWithSavedAction extends Action { public static readonly ID = 'workbench.files.action.compareWithSaved'; public static readonly LABEL = nls.localize('compareWithSaved', "Compare Active File with Saved"); - private static SCHEME = 'showModifications'; + private static readonly SCHEME = 'showModifications'; private resource: URI; private toDispose: IDisposable[]; @@ -2052,7 +2052,7 @@ export class CompareWithClipboardAction extends Action { public static readonly ID = 'workbench.files.action.compareWithClipboard'; public static readonly LABEL = nls.localize('compareWithClipboard', "Compare Active File with Clipboard"); - private static SCHEME = 'clipboardCompare'; + private static readonly SCHEME = 'clipboardCompare'; private registrationDisposal: IDisposable; diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts index b9855ff254f..9ac2116768f 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerView.ts @@ -55,11 +55,11 @@ export interface IExplorerViewOptions extends IViewletViewOptions { export class ExplorerView extends ViewsViewletPanel implements IExplorerView { public static ID: string = 'workbench.explorer.fileView'; - private static EXPLORER_FILE_CHANGES_REACT_DELAY = 500; // delay in ms to react to file changes to give our internal events a chance to react first - private static EXPLORER_FILE_CHANGES_REFRESH_DELAY = 100; // delay in ms to refresh the explorer from disk file changes + private static readonly EXPLORER_FILE_CHANGES_REACT_DELAY = 500; // delay in ms to react to file changes to give our internal events a chance to react first + private static readonly EXPLORER_FILE_CHANGES_REFRESH_DELAY = 100; // delay in ms to refresh the explorer from disk file changes - private static MEMENTO_LAST_ACTIVE_FILE_RESOURCE = 'explorer.memento.lastActiveFileResource'; - private static MEMENTO_EXPANDED_FOLDER_RESOURCES = 'explorer.memento.expandedFolderResources'; + private static readonly MEMENTO_LAST_ACTIVE_FILE_RESOURCE = 'explorer.memento.lastActiveFileResource'; + private static readonly MEMENTO_EXPANDED_FOLDER_RESOURCES = 'explorer.memento.expandedFolderResources'; public readonly id: string = ExplorerView.ID; diff --git a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts index 94e7686903d..766fcc010ad 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/explorerViewer.ts @@ -272,8 +272,8 @@ export interface IFileTemplateData { // Explorer Renderer export class FileRenderer implements IRenderer { - private static ITEM_HEIGHT = 22; - private static FILE_TEMPLATE_ID = 'file'; + private static readonly ITEM_HEIGHT = 22; + private static readonly FILE_TEMPLATE_ID = 'file'; private state: FileViewletState; private config: IFilesConfiguration; @@ -670,7 +670,7 @@ export class FileSorter implements ISorter { // Explorer Filter export class FileFilter implements IFilter { - private static MAX_SIBLINGS_FILTER_THRESHOLD = 2000; + private static readonly MAX_SIBLINGS_FILTER_THRESHOLD = 2000; private hiddenExpressionPerRoot: Map; private workspaceFolderChangeListener: IDisposable; @@ -733,7 +733,7 @@ export class FileFilter implements IFilter { // Explorer Drag And Drop Controller export class FileDragAndDrop extends SimpleFileResourceDragAndDrop { - private static CONFIRM_DND_SETTING_KEY = 'explorer.confirmDragAndDrop'; + private static readonly CONFIRM_DND_SETTING_KEY = 'explorer.confirmDragAndDrop'; private toDispose: IDisposable[]; private dropEnabled: boolean; diff --git a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts index 532be0fe3ed..31a79eec423 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/openEditorsView.ts @@ -38,8 +38,8 @@ const $ = dom.$; export class OpenEditorsView extends ViewsViewletPanel { - private static DEFAULT_VISIBLE_OPEN_EDITORS = 9; - private static DEFAULT_DYNAMIC_HEIGHT = true; + private static readonly DEFAULT_VISIBLE_OPEN_EDITORS = 9; + private static readonly DEFAULT_DYNAMIC_HEIGHT = true; static ID = 'workbench.explorer.openEditorsView'; static NAME = nls.localize({ key: 'openEditors', comment: ['Open is an adjective'] }, "Open Editors"); diff --git a/src/vs/workbench/parts/files/electron-browser/views/openEditorsViewer.ts b/src/vs/workbench/parts/files/electron-browser/views/openEditorsViewer.ts index 04642da5929..6c0ac532f9a 100644 --- a/src/vs/workbench/parts/files/electron-browser/views/openEditorsViewer.ts +++ b/src/vs/workbench/parts/files/electron-browser/views/openEditorsViewer.ts @@ -81,8 +81,8 @@ interface IEditorGroupTemplateData { export class Renderer implements IRenderer { public static readonly ITEM_HEIGHT = 22; - private static EDITOR_GROUP_TEMPLATE_ID = 'editorgroup'; - private static OPEN_EDITOR_TEMPLATE_ID = 'openeditor'; + private static readonly EDITOR_GROUP_TEMPLATE_ID = 'editorgroup'; + private static readonly OPEN_EDITOR_TEMPLATE_ID = 'openeditor'; constructor( private actionProvider: ActionProvider, diff --git a/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts b/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts index 25a1ac2c337..cd1b0bf7e0c 100644 --- a/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts +++ b/src/vs/workbench/parts/markers/browser/markersTreeViewer.ts @@ -75,9 +75,9 @@ export class DataSource implements IDataSource { export class Renderer implements IRenderer { - private static RESOURCE_TEMPLATE_ID = 'resource-template'; - private static FILE_RESOURCE_TEMPLATE_ID = 'file-resource-template'; - private static MARKER_TEMPLATE_ID = 'marker-template'; + private static readonly RESOURCE_TEMPLATE_ID = 'resource-template'; + private static readonly FILE_RESOURCE_TEMPLATE_ID = 'file-resource-template'; + private static readonly MARKER_TEMPLATE_ID = 'marker-template'; constructor( @IInstantiationService private instantiationService: IInstantiationService, diff --git a/src/vs/workbench/parts/output/browser/outputServices.ts b/src/vs/workbench/parts/output/browser/outputServices.ts index 37aa71b666d..f89599c5d41 100644 --- a/src/vs/workbench/parts/output/browser/outputServices.ts +++ b/src/vs/workbench/parts/output/browser/outputServices.ts @@ -232,7 +232,7 @@ export class OutputService implements IOutputService { class OutputContentProvider implements ITextModelContentProvider { - private static OUTPUT_DELAY = 300; + private static readonly OUTPUT_DELAY = 300; private bufferedOutput = new Map(); private appendOutputScheduler: { [channel: string]: RunOnceScheduler; }; diff --git a/src/vs/workbench/parts/output/common/outputLinkProvider.ts b/src/vs/workbench/parts/output/common/outputLinkProvider.ts index 817e5e9b973..8f2b9dba601 100644 --- a/src/vs/workbench/parts/output/common/outputLinkProvider.ts +++ b/src/vs/workbench/parts/output/common/outputLinkProvider.ts @@ -18,7 +18,7 @@ import { IDisposable, dispose } from 'vs/base/common/lifecycle'; export class OutputLinkProvider { - private static DISPOSE_WORKER_TIME = 3 * 60 * 1000; // dispose worker after 3 minutes of inactivity + private static readonly DISPOSE_WORKER_TIME = 3 * 60 * 1000; // dispose worker after 3 minutes of inactivity private worker: MonacoWebWorker; private disposeWorkerScheduler: RunOnceScheduler; diff --git a/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts b/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts index bc66340307a..596eb146690 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingWidgets.ts @@ -132,8 +132,8 @@ class KeybindingInputWidget extends Widget { export class DefineKeybindingWidget extends Widget { - private static WIDTH = 400; - private static HEIGHT = 90; + private static readonly WIDTH = 400; + private static readonly HEIGHT = 90; private _domNode: FastDomNode; private _keybindingInputWidget: KeybindingInputWidget; @@ -251,7 +251,7 @@ export class DefineKeybindingWidget extends Widget { export class DefineKeybindingOverlayWidget extends Disposable implements IOverlayWidget { - private static ID = 'editor.contrib.defineKeybindingWidget'; + private static readonly ID = 'editor.contrib.defineKeybindingWidget'; private readonly _widget: DefineKeybindingWidget; diff --git a/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts b/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts index 2aec6d2ad96..c6ab6b76c58 100644 --- a/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts +++ b/src/vs/workbench/parts/preferences/browser/keybindingsEditorContribution.ts @@ -36,7 +36,7 @@ const INTERESTING_FILE = /keybindings\.json$/; export class DefineKeybindingController extends Disposable implements editorCommon.IEditorContribution { - private static ID = 'editor.contrib.defineKeybinding'; + private static readonly ID = 'editor.contrib.defineKeybinding'; public static get(editor: ICodeEditor): DefineKeybindingController { return editor.getContribution(DefineKeybindingController.ID); diff --git a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts index 6ac64cedd83..7db9cd818f8 100644 --- a/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts +++ b/src/vs/workbench/parts/preferences/browser/preferencesRenderers.ts @@ -557,8 +557,8 @@ export class HiddenAreasRenderer extends Disposable { } export class FeedbackWidgetRenderer extends Disposable { - private static DEFAULT_COMMENT_TEXT = 'Replace this comment with any text feedback.'; - private static INSTRUCTION_TEXT = [ + private static readonly DEFAULT_COMMENT_TEXT = 'Replace this comment with any text feedback.'; + private static readonly INSTRUCTION_TEXT = [ '// Modify the "resultScores" section to contain only your expected results. Assign scores to indicate their relevance.', '// Results present in "resultScores" will be automatically "boosted" for this query, if they are not already at the top of the result set.', '// Add phrase pairs to the "alts" section to have them considered to be synonyms in queries.' @@ -843,7 +843,7 @@ export class HighlightMatchesRenderer extends Disposable { } } - private static _FIND_MATCH = ModelDecorationOptions.register({ + private static readonly _FIND_MATCH = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'findMatch' }); @@ -1233,14 +1233,14 @@ class UnsupportedSettingsRenderer extends Disposable { super.dispose(); } - private static _DIM_CONFIGUARATION_ = ModelDecorationOptions.register({ + private static readonly _DIM_CONFIGUARATION_ = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, inlineClassName: 'dim-configuration', beforeContentClassName: 'unsupportedWorkbenhSettingInfo', hoverMessage: new MarkdownString().appendText(nls.localize('unsupportedWorkbenchSetting', "This setting cannot be applied now. It will be applied when you open this folder directly.")) }); - private static _DIM_CONFIGUARATION_DEV_MODE = ModelDecorationOptions.register({ + private static readonly _DIM_CONFIGUARATION_DEV_MODE = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, inlineClassName: 'dim-configuration', beforeContentClassName: 'unsupportedWorkbenhSettingInfo', @@ -1283,7 +1283,7 @@ class WorkspaceConfigurationRenderer extends Disposable { } } - private static _DIM_CONFIGURATION_ = ModelDecorationOptions.register({ + private static readonly _DIM_CONFIGURATION_ = ModelDecorationOptions.register({ stickiness: editorCommon.TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, inlineClassName: 'dim-configuration' }); diff --git a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts index cabe0f7a005..ee02edfd04b 100644 --- a/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts +++ b/src/vs/workbench/parts/scm/electron-browser/dirtydiffDecorator.ts @@ -454,7 +454,7 @@ KeybindingsRegistry.registerCommandAndKeybindingRule({ export class DirtyDiffController implements IEditorContribution { - private static ID = 'editor.contrib.dirtydiff'; + private static readonly ID = 'editor.contrib.dirtydiff'; static get(editor: ICodeEditor): DirtyDiffController { return editor.getContribution(DirtyDiffController.ID); diff --git a/src/vs/workbench/parts/scm/electron-browser/scmActivity.ts b/src/vs/workbench/parts/scm/electron-browser/scmActivity.ts index 2e4409f9500..48d62e13cc0 100644 --- a/src/vs/workbench/parts/scm/electron-browser/scmActivity.ts +++ b/src/vs/workbench/parts/scm/electron-browser/scmActivity.ts @@ -18,7 +18,7 @@ import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment } export class StatusUpdater implements IWorkbenchContribution { - private static ID = 'vs.scm.statusUpdater'; + private static readonly ID = 'vs.scm.statusUpdater'; private badgeDisposable: IDisposable = EmptyDisposable; private disposables: IDisposable[] = []; @@ -78,7 +78,7 @@ export class StatusUpdater implements IWorkbenchContribution { export class StatusBarController implements IWorkbenchContribution { - private static ID = 'vs.scm.statusBarController'; + private static readonly ID = 'vs.scm.statusBarController'; private statusBarDisposable: IDisposable = EmptyDisposable; private focusDisposable: IDisposable = EmptyDisposable; diff --git a/src/vs/workbench/parts/search/browser/openAnythingHandler.ts b/src/vs/workbench/parts/search/browser/openAnythingHandler.ts index 02c4d96dbe4..c7ac091d433 100644 --- a/src/vs/workbench/parts/search/browser/openAnythingHandler.ts +++ b/src/vs/workbench/parts/search/browser/openAnythingHandler.ts @@ -113,12 +113,12 @@ export class OpenAnythingHandler extends QuickOpenHandler { public static readonly ID = 'workbench.picker.anything'; - private static LINE_COLON_PATTERN = /[#|:|\(](\d*)([#|:|,](\d*))?\)?$/; + private static readonly LINE_COLON_PATTERN = /[#|:|\(](\d*)([#|:|,](\d*))?\)?$/; - private static FILE_SEARCH_DELAY = 300; - private static SYMBOL_SEARCH_DELAY = 500; // go easier on those symbols! + private static readonly FILE_SEARCH_DELAY = 300; + private static readonly SYMBOL_SEARCH_DELAY = 500; // go easier on those symbols! - private static MAX_DISPLAYED_RESULTS = 512; + private static readonly MAX_DISPLAYED_RESULTS = 512; private openSymbolHandler: OpenSymbolHandler; private openFileHandler: OpenFileHandler; diff --git a/src/vs/workbench/parts/search/browser/openSymbolHandler.ts b/src/vs/workbench/parts/search/browser/openSymbolHandler.ts index 5beb64bb53b..88401644d73 100644 --- a/src/vs/workbench/parts/search/browser/openSymbolHandler.ts +++ b/src/vs/workbench/parts/search/browser/openSymbolHandler.ts @@ -132,7 +132,7 @@ export class OpenSymbolHandler extends QuickOpenHandler { public static readonly ID = 'workbench.picker.symbols'; - private static SEARCH_DELAY = 500; // This delay accommodates for the user typing a word and then stops typing to start searching + private static readonly SEARCH_DELAY = 500; // This delay accommodates for the user typing a word and then stops typing to start searching private delayer: ThrottledDelayer; private options: IOpenSymbolOptions; diff --git a/src/vs/workbench/parts/search/browser/searchResultsView.ts b/src/vs/workbench/parts/search/browser/searchResultsView.ts index b38570f3db1..5641193f2b1 100644 --- a/src/vs/workbench/parts/search/browser/searchResultsView.ts +++ b/src/vs/workbench/parts/search/browser/searchResultsView.ts @@ -26,7 +26,7 @@ import { FileKind } from 'vs/platform/files/common/files'; export class SearchDataSource implements IDataSource { - private static AUTOEXPAND_CHILD_LIMIT = 10; + private static readonly AUTOEXPAND_CHILD_LIMIT = 10; private includeFolderMatch: boolean; private listener: IDisposable; @@ -148,9 +148,9 @@ interface IMatchTemplate { export class SearchRenderer extends Disposable implements IRenderer { - private static FOLDER_MATCH_TEMPLATE_ID = 'folderMatch'; - private static FILE_MATCH_TEMPLATE_ID = 'fileMatch'; - private static MATCH_TEMPLATE_ID = 'match'; + private static readonly FOLDER_MATCH_TEMPLATE_ID = 'folderMatch'; + private static readonly FILE_MATCH_TEMPLATE_ID = 'fileMatch'; + private static readonly MATCH_TEMPLATE_ID = 'match'; constructor( actionRunner: IActionRunner, diff --git a/src/vs/workbench/parts/search/browser/searchViewlet.ts b/src/vs/workbench/parts/search/browser/searchViewlet.ts index 7a78bb4f08f..43c2dae7fbd 100644 --- a/src/vs/workbench/parts/search/browser/searchViewlet.ts +++ b/src/vs/workbench/parts/search/browser/searchViewlet.ts @@ -65,8 +65,8 @@ import { isDiffEditor, isCodeEditor, ICodeEditor } from 'vs/editor/browser/edito export class SearchViewlet extends Viewlet { - private static MAX_TEXT_RESULTS = 10000; - private static SHOW_REPLACE_STORAGE_KEY = 'vs.search.show.replace'; + private static readonly MAX_TEXT_RESULTS = 10000; + private static readonly SHOW_REPLACE_STORAGE_KEY = 'vs.search.show.replace'; private isDisposed: boolean; diff --git a/src/vs/workbench/parts/search/browser/searchWidget.ts b/src/vs/workbench/parts/search/browser/searchWidget.ts index c67ae8580d4..1231f3f464c 100644 --- a/src/vs/workbench/parts/search/browser/searchWidget.ts +++ b/src/vs/workbench/parts/search/browser/searchWidget.ts @@ -70,8 +70,8 @@ class ReplaceAllAction extends Action { export class SearchWidget extends Widget { - private static REPLACE_ALL_DISABLED_LABEL = nls.localize('search.action.replaceAll.disabled.label', "Replace All (Submit Search to Enable)"); - private static REPLACE_ALL_ENABLED_LABEL = (keyBindingService2: IKeybindingService): string => { + private static readonly REPLACE_ALL_DISABLED_LABEL = nls.localize('search.action.replaceAll.disabled.label', "Replace All (Submit Search to Enable)"); + private static readonly REPLACE_ALL_ENABLED_LABEL = (keyBindingService2: IKeybindingService): string => { let kb = keyBindingService2.lookupKeybinding(ReplaceAllAction.ID); return appendKeyBindingLabel(nls.localize('search.action.replaceAll.enabled.label', "Replace All"), kb, keyBindingService2); } diff --git a/src/vs/workbench/parts/search/common/searchModel.ts b/src/vs/workbench/parts/search/common/searchModel.ts index e72e2cd6338..508d6cac22a 100644 --- a/src/vs/workbench/parts/search/common/searchModel.ts +++ b/src/vs/workbench/parts/search/common/searchModel.ts @@ -93,7 +93,7 @@ export class Match { export class FileMatch extends Disposable { - private static _CURRENT_FIND_MATCH = ModelDecorationOptions.register({ + private static readonly _CURRENT_FIND_MATCH = ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'currentFindMatch', overviewRuler: { @@ -103,7 +103,7 @@ export class FileMatch extends Disposable { } }); - private static _FIND_MATCH = ModelDecorationOptions.register({ + private static readonly _FIND_MATCH = ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'findMatch', overviewRuler: { @@ -919,7 +919,7 @@ export class RangeHighlightDecorations implements IDisposable { } } - private static _RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({ + private static readonly _RANGE_HIGHLIGHT_DECORATION = ModelDecorationOptions.register({ stickiness: TrackedRangeStickiness.NeverGrowsWhenTypingAtEdges, className: 'rangeHighlight', isWholeLine: true diff --git a/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts b/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts index 659dd5e9249..47a5caff9bf 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/insertSnippet.ts @@ -39,7 +39,7 @@ class Args { return new Args(snippet, name, langId); } - private static _empty = new Args(undefined, undefined, undefined); + private static readonly _empty = new Args(undefined, undefined, undefined); private constructor( public readonly snippet: string, diff --git a/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts b/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts index 5855851deb8..f22cbfc986a 100644 --- a/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts +++ b/src/vs/workbench/parts/snippets/electron-browser/tabCompletion.ts @@ -26,7 +26,7 @@ import { ICodeEditor } from 'vs/editor/browser/editorBrowser'; export class TabCompletionController implements editorCommon.IEditorContribution { - private static ID = 'editor.tabCompletionController'; + private static readonly ID = 'editor.tabCompletionController'; static ContextKey = new RawContextKey('hasSnippetCompletions', undefined); public static get(editor: ICodeEditor): TabCompletionController { diff --git a/src/vs/workbench/parts/tasks/browser/quickOpen.ts b/src/vs/workbench/parts/tasks/browser/quickOpen.ts index 141fde0334b..e760a7201f8 100644 --- a/src/vs/workbench/parts/tasks/browser/quickOpen.ts +++ b/src/vs/workbench/parts/tasks/browser/quickOpen.ts @@ -161,8 +161,8 @@ export abstract class QuickOpenHandler extends Quickopen.QuickOpenHandler { class CustomizeTaskAction extends Action { - private static ID = 'workbench.action.tasks.customizeTask'; - private static LABEL = nls.localize('customizeTask', "Configure Task"); + private static readonly ID = 'workbench.action.tasks.customizeTask'; + private static readonly LABEL = nls.localize('customizeTask', "Configure Task"); constructor(private taskService: ITaskService, private quickOpenService: IQuickOpenService) { super(CustomizeTaskAction.ID, CustomizeTaskAction.LABEL); diff --git a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts index c61eabe12d2..55564f54c46 100644 --- a/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts +++ b/src/vs/workbench/parts/tasks/electron-browser/task.contribution.ts @@ -443,9 +443,9 @@ interface TaskQuickPickEntry extends IPickOpenEntry { class TaskService implements ITaskService { // private static autoDetectTelemetryName: string = 'taskServer.autoDetect'; - private static RecentlyUsedTasks_Key = 'workbench.tasks.recentlyUsedTasks'; - private static RanTaskBefore_Key = 'workbench.tasks.ranTaskBefore'; - private static IgnoreTask010DonotShowAgain_key = 'workbench.tasks.ignoreTask010Shown'; + private static readonly RecentlyUsedTasks_Key = 'workbench.tasks.recentlyUsedTasks'; + private static readonly RanTaskBefore_Key = 'workbench.tasks.ranTaskBefore'; + private static readonly IgnoreTask010DonotShowAgain_key = 'workbench.tasks.ignoreTask010Shown'; private static CustomizationTelemetryEventName: string = 'taskService.customize'; public static TemplateTelemetryEventName: string = 'taskService.template'; diff --git a/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.ts b/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.ts index 0e3b5756886..f5b9fb66d5b 100644 --- a/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.ts +++ b/src/vs/workbench/parts/trust/electron-browser/unsupportedWorkspaceSettings.contribution.ts @@ -23,7 +23,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace class UnsupportedWorkspaceSettingsContribution implements IWorkbenchContribution { - private static storageKey = 'workspace.settings.unsupported.warning'; + private static readonly storageKey = 'workspace.settings.unsupported.warning'; private toDispose: IDisposable[] = []; private isUntrusted = false; diff --git a/src/vs/workbench/parts/update/electron-browser/update.ts b/src/vs/workbench/parts/update/electron-browser/update.ts index 6643e018c5c..e1a74c0e6dc 100644 --- a/src/vs/workbench/parts/update/electron-browser/update.ts +++ b/src/vs/workbench/parts/update/electron-browser/update.ts @@ -196,7 +196,7 @@ const LinkAction = (id: string, message: string, licenseUrl: string) => new Acti export class ProductContribution implements IWorkbenchContribution { - private static KEY = 'releaseNotes/lastVersion'; + private static readonly KEY = 'releaseNotes/lastVersion'; getId() { return 'vs.product'; } constructor( @@ -256,9 +256,9 @@ class NeverShowAgain { export class Win3264BitContribution implements IWorkbenchContribution { - private static KEY = 'update/win32-64bits'; - private static URL = 'https://code.visualstudio.com/updates/v1_15#_windows-64-bit'; - private static INSIDER_URL = 'https://github.com/Microsoft/vscode-docs/blob/vnext/release-notes/v1_15.md#windows-64-bit'; + private static readonly KEY = 'update/win32-64bits'; + private static readonly URL = 'https://code.visualstudio.com/updates/v1_15#_windows-64-bit'; + private static readonly INSIDER_URL = 'https://github.com/Microsoft/vscode-docs/blob/vnext/release-notes/v1_15.md#windows-64-bit'; getId() { return 'vs.win32-64bit'; } diff --git a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts index 04541aa4295..09e2d3369b5 100644 --- a/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts +++ b/src/vs/workbench/parts/welcome/gettingStarted/electron-browser/gettingStarted.ts @@ -13,7 +13,7 @@ import product from 'vs/platform/node/product'; export class GettingStarted implements IWorkbenchContribution { - private static hideWelcomeSettingskey = 'workbench.hide.welcome'; + private static readonly hideWelcomeSettingskey = 'workbench.hide.welcome'; private welcomePageURL: string; private appName: string; diff --git a/src/vs/workbench/services/configuration/node/configuration.ts b/src/vs/workbench/services/configuration/node/configuration.ts index c2a571a8304..79e24da0d55 100644 --- a/src/vs/workbench/services/configuration/node/configuration.ts +++ b/src/vs/workbench/services/configuration/node/configuration.ts @@ -158,7 +158,7 @@ export class WorkspaceConfiguration extends Disposable { export class FolderConfiguration extends Disposable { - private static RELOAD_CONFIGURATION_DELAY = 50; + private static readonly RELOAD_CONFIGURATION_DELAY = 50; private bulkFetchFromWorkspacePromise: TPromise; private workspaceFilePathToConfiguration: { [relativeWorkspacePath: string]: TPromise }; diff --git a/src/vs/workbench/services/files/electron-browser/fileService.ts b/src/vs/workbench/services/files/electron-browser/fileService.ts index 808463d7d88..e6896e48d5a 100644 --- a/src/vs/workbench/services/files/electron-browser/fileService.ts +++ b/src/vs/workbench/services/files/electron-browser/fileService.ts @@ -30,8 +30,8 @@ export class FileService implements IFileService { public _serviceBrand: any; // If we run with .NET framework < 4.5, we need to detect this error to inform the user - private static NET_VERSION_ERROR = 'System.MissingMethodException'; - private static NET_VERSION_ERROR_IGNORE_KEY = 'ignoreNetVersionError'; + private static readonly NET_VERSION_ERROR = 'System.MissingMethodException'; + private static readonly NET_VERSION_ERROR_IGNORE_KEY = 'ignoreNetVersionError'; private raw: IFileService; diff --git a/src/vs/workbench/services/files/node/fileService.ts b/src/vs/workbench/services/files/node/fileService.ts index efd4248eadd..e2fb38062b7 100644 --- a/src/vs/workbench/services/files/node/fileService.ts +++ b/src/vs/workbench/services/files/node/fileService.ts @@ -103,8 +103,8 @@ export class FileService implements IFileService { public _serviceBrand: any; - private static FS_EVENT_DELAY = 50; // aggregate and only emit events when changes have stopped for this duration (in ms) - private static FS_REWATCH_DELAY = 300; // delay to rewatch a file that was renamed or deleted (in ms) + private static readonly FS_EVENT_DELAY = 50; // aggregate and only emit events when changes have stopped for this duration (in ms) + private static readonly FS_REWATCH_DELAY = 300; // delay to rewatch a file that was renamed or deleted (in ms) private tmpPath: string; private options: IFileServiceOptions; diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts b/src/vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts index 4aa52cb2544..3e17fc59357 100644 --- a/src/vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/nsfw/nsfwWatcherService.ts @@ -32,7 +32,7 @@ interface IPathWatcher { } export class NsfwWatcherService implements IWatcherService { - private static FS_EVENT_DELAY = 50; // aggregate and only emit events when changes have stopped for this duration (in ms) + private static readonly FS_EVENT_DELAY = 50; // aggregate and only emit events when changes have stopped for this duration (in ms) private _pathWatchers: { [watchPath: string]: IPathWatcher } = {}; private _watcherPromise: TPromise; diff --git a/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts b/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts index cde68eb3cc4..eb14be46361 100644 --- a/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/nsfw/watcherService.ts @@ -17,7 +17,7 @@ import { IConfigurationService } from 'vs/platform/configuration/common/configur import { IDisposable, dispose } from 'vs/base/common/lifecycle'; export class FileWatcher { - private static MAX_RESTARTS = 5; + private static readonly MAX_RESTARTS = 5; private service: WatcherChannelClient; private isDisposed: boolean; diff --git a/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts b/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts index 28d609c8e1f..808b863f0cc 100644 --- a/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/unix/chokidarWatcherService.ts @@ -22,8 +22,8 @@ import { IWatcherRequest, IWatcherService } from './watcher'; export class ChokidarWatcherService implements IWatcherService { - private static FS_EVENT_DELAY = 50; // aggregate and only emit events when changes have stopped for this duration (in ms) - private static EVENT_SPAM_WARNING_THRESHOLD = 60 * 1000; // warn after certain time span of event spam + private static readonly FS_EVENT_DELAY = 50; // aggregate and only emit events when changes have stopped for this duration (in ms) + private static readonly EVENT_SPAM_WARNING_THRESHOLD = 60 * 1000; // warn after certain time span of event spam private spamCheckStartTime: number; private spamWarningLogged: boolean; diff --git a/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts b/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts index 7c4917dc472..9377480d5bd 100644 --- a/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/unix/watcherService.ts @@ -16,7 +16,7 @@ import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace import { normalize } from 'path'; export class FileWatcher { - private static MAX_RESTARTS = 5; + private static readonly MAX_RESTARTS = 5; private isDisposed: boolean; private restartCounter: number; diff --git a/src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts b/src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts index d10e87c45ec..c86b93d43b7 100644 --- a/src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts +++ b/src/vs/workbench/services/files/node/watcher/win32/csharpWatcherService.ts @@ -16,7 +16,7 @@ import { IRawFileChange } from 'vs/workbench/services/files/node/watcher/common' export class OutOfProcessWin32FolderWatcher { - private static MAX_RESTARTS = 5; + private static readonly MAX_RESTARTS = 5; private static changeTypeMap: FileChangeType[] = [FileChangeType.UPDATED, FileChangeType.ADDED, FileChangeType.DELETED]; diff --git a/src/vs/workbench/services/history/electron-browser/history.ts b/src/vs/workbench/services/history/electron-browser/history.ts index 86b413f2331..e4659d11135 100644 --- a/src/vs/workbench/services/history/electron-browser/history.ts +++ b/src/vs/workbench/services/history/electron-browser/history.ts @@ -36,7 +36,7 @@ import { ResourceGlobMatcher } from 'vs/workbench/electron-browser/resources'; */ export class TextEditorState { - private static EDITOR_SELECTION_THRESHOLD = 10; // number of lines to move in editor to justify for new state + private static readonly EDITOR_SELECTION_THRESHOLD = 10; // number of lines to move in editor to justify for new state private textEditorSelection: ITextEditorSelection; @@ -174,10 +174,10 @@ export class HistoryService extends BaseHistoryService implements IHistoryServic public _serviceBrand: any; - private static STORAGE_KEY = 'history.entries'; - private static MAX_HISTORY_ITEMS = 200; - private static MAX_STACK_ITEMS = 20; - private static MAX_RECENTLY_CLOSED_EDITORS = 20; + private static readonly STORAGE_KEY = 'history.entries'; + private static readonly MAX_HISTORY_ITEMS = 200; + private static readonly MAX_STACK_ITEMS = 20; + private static readonly MAX_RECENTLY_CLOSED_EDITORS = 20; private stack: IStackEntry[]; private index: number; diff --git a/src/vs/workbench/services/search/node/rawSearchService.ts b/src/vs/workbench/services/search/node/rawSearchService.ts index 7c9b48747e2..b4956230b48 100644 --- a/src/vs/workbench/services/search/node/rawSearchService.ts +++ b/src/vs/workbench/services/search/node/rawSearchService.ts @@ -27,7 +27,7 @@ import { compareItemsByScore, IItemAccessor, ScorerCache, prepareQuery } from 'v export class SearchService implements IRawSearchService { - private static BATCH_SIZE = 512; + private static readonly BATCH_SIZE = 512; private caches: { [cacheKey: string]: Cache; } = Object.create(null); @@ -443,10 +443,10 @@ interface CacheStats { * If the batch isn't filled within some time, the callback is also called. */ class BatchedCollector { - private static TIMEOUT = 4000; + private static readonly TIMEOUT = 4000; // After RUN_TIMEOUT_UNTIL_COUNT items have been collected, stop flushing on timeout - private static START_BATCH_AFTER_COUNT = 50; + private static readonly START_BATCH_AFTER_COUNT = 50; private totalNumberCompleted = 0; private batch: T[] = []; diff --git a/src/vs/workbench/services/search/node/ripgrepTextSearch.ts b/src/vs/workbench/services/search/node/ripgrepTextSearch.ts index fcc960af59e..51e417436a9 100644 --- a/src/vs/workbench/services/search/node/ripgrepTextSearch.ts +++ b/src/vs/workbench/services/search/node/ripgrepTextSearch.ts @@ -160,8 +160,8 @@ export class RipgrepEngine { } export class RipgrepParser extends EventEmitter { - private static RESULT_REGEX = /^\u001b\[m(\d+)\u001b\[m:(.*)(\r?)/; - private static FILE_REGEX = /^\u001b\[m(.+)\u001b\[m$/; + private static readonly RESULT_REGEX = /^\u001b\[m(\d+)\u001b\[m:(.*)(\r?)/; + private static readonly FILE_REGEX = /^\u001b\[m(.+)\u001b\[m$/; public static readonly MATCH_START_MARKER = '\u001b[m\u001b[31m'; public static readonly MATCH_END_MARKER = '\u001b[m'; diff --git a/src/vs/workbench/services/search/node/textSearch.ts b/src/vs/workbench/services/search/node/textSearch.ts index 341b100b5aa..b5a62eb9023 100644 --- a/src/vs/workbench/services/search/node/textSearch.ts +++ b/src/vs/workbench/services/search/node/textSearch.ts @@ -17,7 +17,7 @@ import { ITextSearchWorkerProvider } from './textSearchWorkerProvider'; export class Engine implements ISearchEngine { - private static PROGRESS_FLUSH_CHUNK_SIZE = 50; // optimization: number of files to process before emitting progress event + private static readonly PROGRESS_FLUSH_CHUNK_SIZE = 50; // optimization: number of files to process before emitting progress event private config: IRawSearch; private walker: FileWalker; diff --git a/src/vs/workbench/services/textfile/electron-browser/textFileService.ts b/src/vs/workbench/services/textfile/electron-browser/textFileService.ts index e1fc0aaf12a..00fe49fd947 100644 --- a/src/vs/workbench/services/textfile/electron-browser/textFileService.ts +++ b/src/vs/workbench/services/textfile/electron-browser/textFileService.ts @@ -33,7 +33,7 @@ import { mnemonicButtonLabel } from 'vs/base/common/labels'; export class TextFileService extends AbstractTextFileService { - private static MAX_CONFIRM_FILES = 10; + private static readonly MAX_CONFIRM_FILES = 10; constructor( @IWorkspaceContextService contextService: IWorkspaceContextService, diff --git a/src/vs/workbench/services/workspace/node/workspaceEditingService.ts b/src/vs/workbench/services/workspace/node/workspaceEditingService.ts index 650625e7483..5803459ade3 100644 --- a/src/vs/workbench/services/workspace/node/workspaceEditingService.ts +++ b/src/vs/workbench/services/workspace/node/workspaceEditingService.ts @@ -35,7 +35,7 @@ export class WorkspaceEditingService implements IWorkspaceEditingService { public _serviceBrand: any; - private static INFO_MESSAGE_KEY = 'enterWorkspace.message'; + private static readonly INFO_MESSAGE_KEY = 'enterWorkspace.message'; constructor( @IJSONEditingService private jsonEditingService: IJSONEditingService, diff --git a/test/smoke/src/areas/editor/editor.ts b/test/smoke/src/areas/editor/editor.ts index 499f0fe6196..14c95e3ff6b 100644 --- a/test/smoke/src/areas/editor/editor.ts +++ b/test/smoke/src/areas/editor/editor.ts @@ -12,10 +12,10 @@ const RENAME_INPUT = `${RENAME_BOX} .rename-input`; export class Editor { - private static VIEW_LINES = '.monaco-editor .view-lines'; - private static LINE_NUMBERS = '.monaco-editor .margin .margin-view-overlays .line-numbers'; - private static FOLDING_EXPANDED = '.monaco-editor .margin .margin-view-overlays>:nth-child(${INDEX}) .folding'; - private static FOLDING_COLLAPSED = `${Editor.FOLDING_EXPANDED}.collapsed`; + private static readonly VIEW_LINES = '.monaco-editor .view-lines'; + private static readonly LINE_NUMBERS = '.monaco-editor .margin .margin-view-overlays .line-numbers'; + private static readonly FOLDING_EXPANDED = '.monaco-editor .margin .margin-view-overlays>:nth-child(${INDEX}) .folding'; + private static readonly FOLDING_COLLAPSED = `${Editor.FOLDING_EXPANDED}.collapsed`; constructor(private spectron: SpectronApplication) { } diff --git a/test/smoke/src/areas/editor/peek.ts b/test/smoke/src/areas/editor/peek.ts index 24e472c17ef..9c912821270 100644 --- a/test/smoke/src/areas/editor/peek.ts +++ b/test/smoke/src/areas/editor/peek.ts @@ -7,10 +7,10 @@ import { SpectronApplication } from '../../spectron/application'; export class References { - private static REFERENCES_WIDGET = '.monaco-editor .zone-widget .zone-widget-container.peekview-widget.reference-zone-widget.results-loaded'; - private static REFERENCES_TITLE_FILE_NAME = `${References.REFERENCES_WIDGET} .head .peekview-title .filename`; - private static REFERENCES_TITLE_COUNT = `${References.REFERENCES_WIDGET} .head .peekview-title .meta`; - private static REFERENCES = `${References.REFERENCES_WIDGET} .body .ref-tree.inline .monaco-tree-row .reference`; + private static readonly REFERENCES_WIDGET = '.monaco-editor .zone-widget .zone-widget-container.peekview-widget.reference-zone-widget.results-loaded'; + private static readonly REFERENCES_TITLE_FILE_NAME = `${References.REFERENCES_WIDGET} .head .peekview-title .filename`; + private static readonly REFERENCES_TITLE_COUNT = `${References.REFERENCES_WIDGET} .head .peekview-title .meta`; + private static readonly REFERENCES = `${References.REFERENCES_WIDGET} .body .ref-tree.inline .monaco-tree-row .reference`; constructor(private spectron: SpectronApplication) { } diff --git a/test/smoke/src/areas/explorer/explorer.ts b/test/smoke/src/areas/explorer/explorer.ts index 1dd454462ac..6159e62c45f 100644 --- a/test/smoke/src/areas/explorer/explorer.ts +++ b/test/smoke/src/areas/explorer/explorer.ts @@ -9,8 +9,8 @@ import { Viewlet } from '../workbench/viewlet'; export class Explorer extends Viewlet { - private static EXPLORER_VIEWLET = 'div[id="workbench.view.explorer"]'; - private static OPEN_EDITORS_VIEW = `${Explorer.EXPLORER_VIEWLET} .split-view-view:nth-child(1) .title`; + private static readonly EXPLORER_VIEWLET = 'div[id="workbench.view.explorer"]'; + private static readonly OPEN_EDITORS_VIEW = `${Explorer.EXPLORER_VIEWLET} .split-view-view:nth-child(1) .title`; constructor(spectron: SpectronApplication) { super(spectron); diff --git a/test/smoke/src/helpers/screenshot.ts b/test/smoke/src/helpers/screenshot.ts index 18a068ec388..f34118ae6c3 100644 --- a/test/smoke/src/helpers/screenshot.ts +++ b/test/smoke/src/helpers/screenshot.ts @@ -11,7 +11,7 @@ import { sanitize } from './utilities'; export class ScreenCapturer { - private static counter = 0; + private static readonly counter = 0; constructor( private application: Application, diff --git a/test/smoke/src/spectron/application.ts b/test/smoke/src/spectron/application.ts index 22c1c23010d..69da75eeb60 100644 --- a/test/smoke/src/spectron/application.ts +++ b/test/smoke/src/spectron/application.ts @@ -49,7 +49,7 @@ export interface SpectronApplicationOptions { */ export class SpectronApplication { - private static count = 0; + private static readonly count = 0; private _client: SpectronClient; private _workbench: Workbench;