提交 6981de9d 编写于 作者: I isidor

strictPropertyInitialization

#78168
上级 f43b8f28
......@@ -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>();
......
......@@ -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;
......
......@@ -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,
......
......@@ -133,7 +133,7 @@ export function getStateLabel(state: State): string {
}
}
export class AdapterEndEvent {
export interface AdapterEndEvent {
error?: Error;
sessionLengthInSeconds: number;
emittedStopped: boolean;
......
......@@ -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(
......@@ -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);
......
......@@ -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,
......
......@@ -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,
......
......@@ -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>;
......@@ -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(
......
......@@ -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,
......
......@@ -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,
......@@ -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 });
}
}
......
......@@ -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>();
......@@ -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,
......@@ -367,4 +367,4 @@ export class NewExplorerItem extends ExplorerItem {
constructor(parent: ExplorerItem, isDirectory: boolean) {
super(URI.file(''), parent, isDirectory);
}
}
\ No newline at end of file
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册