Skip to content

Commit

Permalink
strictPropertyInitialization
Browse files Browse the repository at this point in the history
  • Loading branch information
isidorn committed Aug 5, 2019
1 parent f43b8f2 commit 6981de9
Show file tree
Hide file tree
Showing 11 changed files with 41 additions and 37 deletions.
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/browser/debugSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export class DebugSession implements IDebugSession {
private sources = new Map<string, Source>();
private threads = new Map<number, Thread>();
private rawListeners: IDisposable[] = [];
private fetchThreadsScheduler: RunOnceScheduler;
private fetchThreadsScheduler: RunOnceScheduler | undefined;
private repl: ReplModel;

private readonly _onDidChangeState = new Emitter<void>();
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/browser/debugStatus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { IWorkbenchContribution } from 'vs/workbench/common/contributions';

export class DebugStatusContribution implements IWorkbenchContribution {

private showInStatusBar: 'never' | 'always' | 'onFirstSessionStart';
private showInStatusBar!: 'never' | 'always' | 'onFirstSessionStart';
private toDispose: IDisposable[] = [];
private entryAccessor: IStatusbarEntryAccessor | undefined;

Expand Down
22 changes: 11 additions & 11 deletions src/vs/workbench/contrib/debug/browser/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,18 @@ export class Repl extends Panel implements IPrivateReplService, IHistoryNavigati
private static readonly REPL_INPUT_MAX_HEIGHT = 170;

private history: HistoryNavigator<string>;
private tree: WorkbenchAsyncDataTree<IDebugSession, IReplElement, FuzzyScore>;
private replDelegate: ReplDelegate;
private container: HTMLElement;
private replInput: CodeEditorWidget;
private replInputContainer: HTMLElement;
private dimension: dom.Dimension;
private tree!: WorkbenchAsyncDataTree<IDebugSession, IReplElement, FuzzyScore>;
private replDelegate!: ReplDelegate;
private container!: HTMLElement;
private replInput!: CodeEditorWidget;
private replInputContainer!: HTMLElement;
private dimension!: dom.Dimension;
private replInputHeight: number;
private model: ITextModel;
private historyNavigationEnablement: IContextKey<boolean>;
private scopedInstantiationService: IInstantiationService;
private replElementsChangeListener: IDisposable;
private styleElement: HTMLStyleElement;
private model!: ITextModel;
private historyNavigationEnablement!: IContextKey<boolean>;
private scopedInstantiationService!: IInstantiationService;
private replElementsChangeListener: IDisposable | undefined;
private styleElement: HTMLStyleElement | undefined;

constructor(
@IDebugService private readonly debugService: IDebugService,
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/debug/common/debug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ export function getStateLabel(state: State): string {
}
}

export class AdapterEndEvent {
export interface AdapterEndEvent {
error?: Error;
sessionLengthInSeconds: number;
emittedStopped: boolean;
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/debug/common/debugModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ export class ExpressionContainer implements IExpressionContainer {
// Use chunks to support variable paging #9537
private static readonly BASE_CHUNK_SIZE = 100;

public valueChanged: boolean;
private _value: string;
public valueChanged = false;
private _value: string = '';
protected children?: Promise<IExpression[]>;

constructor(
Expand Down Expand Up @@ -201,7 +201,7 @@ export class Expression extends ExpressionContainer implements IExpression {
static DEFAULT_VALUE = nls.localize('notAvailable', "not available");

public available: boolean;
public type: string;
public type: string | undefined;

constructor(public name: string, id = generateUuid()) {
super(undefined, 0, id);
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/files/browser/explorerViewlet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ import { IProgressService, ProgressLocation } from 'vs/platform/progress/common/

export class ExplorerViewletViewsContribution extends Disposable implements IWorkbenchContribution {

private openEditorsVisibleContextKey: IContextKey<boolean>;
private openEditorsVisibleContextKey!: IContextKey<boolean>;

constructor(
@IWorkspaceContextService private readonly workspaceContextService: IWorkspaceContextService,
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/files/browser/views/emptyView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ export class EmptyView extends ViewletPanel {
static readonly ID: string = 'workbench.explorer.emptyView';
static readonly NAME = nls.localize('noWorkspace', "No Folder Opened");

private button: Button;
private messageElement: HTMLElement;
private titleElement: HTMLElement;
private button!: Button;
private messageElement!: HTMLElement;
private titleElement!: HTMLElement;

constructor(
options: IViewletViewOptions,
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/files/browser/views/explorerView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ export class ExplorerView extends ViewletPanel {
static readonly ID: string = 'workbench.explorer.fileView';
static readonly TREE_VIEW_STATE_STORAGE_KEY: string = 'workbench.explorer.treeViewState';

private tree: WorkbenchAsyncDataTree<ExplorerItem | ExplorerItem[], ExplorerItem, FuzzyScore>;
private filter: FilesFilter;
private tree!: WorkbenchAsyncDataTree<ExplorerItem | ExplorerItem[], ExplorerItem, FuzzyScore>;
private filter!: FilesFilter;

private resourceContext: ResourceContextKey;
private folderContext: IContextKey<boolean>;
Expand All @@ -66,7 +66,7 @@ export class ExplorerView extends ViewletPanel {

// Refresh is needed on the initial explorer open
private shouldRefresh = true;
private dragHandler: DelayedDragHandler;
private dragHandler!: DelayedDragHandler;
private autoReveal = false;

constructor(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
private static readonly CONFIRM_DND_SETTING_KEY = 'explorer.confirmDragAndDrop';

private toDispose: IDisposable[];
private dropEnabled: boolean;
private dropEnabled = false;

constructor(
@INotificationService private notificationService: INotificationService,
Expand Down
22 changes: 13 additions & 9 deletions src/vs/workbench/contrib/files/browser/views/openEditorsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,16 +51,16 @@ export class OpenEditorsView extends ViewletPanel {
static readonly ID = 'workbench.explorer.openEditorsView';
static NAME = nls.localize({ key: 'openEditors', comment: ['Open is an adjective'] }, "Open Editors");

private dirtyCountElement: HTMLElement;
private dirtyCountElement!: HTMLElement;
private listRefreshScheduler: RunOnceScheduler;
private structuralRefreshDelay: number;
private list: WorkbenchList<OpenEditor | IEditorGroup>;
private listLabels: ResourceLabels;
private contributedContextMenu: IMenu;
private needsRefresh: boolean;
private resourceContext: ResourceContextKey;
private groupFocusedContext: IContextKey<boolean>;
private dirtyEditorFocusedContext: IContextKey<boolean>;
private list!: WorkbenchList<OpenEditor | IEditorGroup>;
private listLabels: ResourceLabels | undefined;
private contributedContextMenu!: IMenu;
private needsRefresh = false;
private resourceContext!: ResourceContextKey;
private groupFocusedContext!: IContextKey<boolean>;
private dirtyEditorFocusedContext!: IContextKey<boolean>;

constructor(
options: IViewletViewOptions,
Expand Down Expand Up @@ -466,9 +466,13 @@ interface IEditorGroupTemplateData {
}

class OpenEditorActionRunner extends ActionRunner {
public editor: OpenEditor;
public editor: OpenEditor | undefined;

run(action: IAction, context?: any): Promise<void> {
if (!this.editor) {
return Promise.resolve();
}

return super.run(action, { groupId: this.editor.groupId, editorIndex: this.editor.editorIndex });
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/contrib/files/common/explorerModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { IExplorerService } from 'vs/workbench/contrib/files/common/files';

export class ExplorerModel implements IDisposable {

private _roots: ExplorerItem[];
private _roots!: ExplorerItem[];
private _listener: IDisposable;
private _onDidChangeRoots = new Emitter<void>();

Expand Down Expand Up @@ -75,7 +75,7 @@ export class ExplorerModel implements IDisposable {

export class ExplorerItem {
private _isDirectoryResolved: boolean;
public isError: boolean;
public isError = false;

constructor(
public resource: URI,
Expand Down Expand Up @@ -367,4 +367,4 @@ export class NewExplorerItem extends ExplorerItem {
constructor(parent: ExplorerItem, isDirectory: boolean) {
super(URI.file(''), parent, isDirectory);
}
}
}

0 comments on commit 6981de9

Please sign in to comment.