Skip to content

Commit 780a508

Browse files
committed
Strict init for tasks, file picker, and custom view
Part of microsoft#78168
1 parent 222401c commit 780a508

4 files changed

Lines changed: 29 additions & 29 deletions

File tree

src/vs/workbench/api/browser/mainThreadTask.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@ namespace TaskFilterDTO {
420420
@extHostNamedCustomer(MainContext.MainThreadTask)
421421
export class MainThreadTask implements MainThreadTaskShape {
422422

423-
private readonly _extHostContext: IExtHostContext;
423+
private readonly _extHostContext: IExtHostContext | undefined;
424424
private readonly _proxy: ExtHostTaskShape;
425425
private readonly _providers: Map<number, { disposable: IDisposable, provider: ITaskProvider }>;
426426

src/vs/workbench/api/common/extHostTreeViews.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ class ExtHostTreeView<T> extends Disposable {
247247
.then(treeNode => this.proxy.$reveal(this.viewId, treeNode.item, parentChain.map(p => p.item), { select, focus, expand })), error => this.logService.error(error));
248248
}
249249

250-
private _message: string | MarkdownString;
250+
private _message: string | MarkdownString = '';
251251
get message(): string | MarkdownString {
252252
return this._message;
253253
}
@@ -565,9 +565,9 @@ class ExtHostTreeView<T> extends Disposable {
565565
if (node) {
566566
if (node.children) {
567567
for (const child of node.children) {
568-
const childEleement = this.elements.get(child.item.handle);
569-
if (childEleement) {
570-
this.clear(childEleement);
568+
const childElement = this.elements.get(child.item.handle);
569+
if (childElement) {
570+
this.clear(childElement);
571571
}
572572
}
573573
}
@@ -583,9 +583,9 @@ class ExtHostTreeView<T> extends Disposable {
583583
if (node) {
584584
if (node.children) {
585585
for (const child of node.children) {
586-
const childEleement = this.elements.get(child.item.handle);
587-
if (childEleement) {
588-
this.clear(childEleement);
586+
const childElement = this.elements.get(child.item.handle);
587+
if (childElement) {
588+
this.clear(childElement);
589589
}
590590
}
591591
}

src/vs/workbench/contrib/tasks/node/processRunnerDetector.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ class RegexpTaskMatcher implements TaskDetectorMatcher {
5959
}
6060

6161
class GruntTaskMatcher implements TaskDetectorMatcher {
62-
private tasksStart: boolean;
63-
private tasksEnd: boolean;
64-
private descriptionOffset: number | null;
62+
private tasksStart!: boolean;
63+
private tasksEnd!: boolean;
64+
private descriptionOffset!: number | null;
6565

6666
init() {
6767
this.tasksStart = false;
@@ -179,7 +179,7 @@ export class ProcessRunnerDetector {
179179
commandExecutable, isShellCommand, config.matcher, ProcessRunnerDetector.DefaultProblemMatchers, list));
180180
} else {
181181
if (detectSpecific) {
182-
let detectorPromise: Promise<DetectorResult>;
182+
let detectorPromise: Promise<DetectorResult | null>;
183183
if ('gulp' === detectSpecific) {
184184
detectorPromise = this.tryDetectGulp(this._workspaceRoot, list);
185185
} else if ('jake' === detectSpecific) {
@@ -229,7 +229,7 @@ export class ProcessRunnerDetector {
229229
return result;
230230
}
231231

232-
private tryDetectGulp(workspaceFolder: IWorkspaceFolder, list: boolean): Promise<DetectorResult> {
232+
private tryDetectGulp(workspaceFolder: IWorkspaceFolder, list: boolean): Promise<DetectorResult | null> {
233233
return Promise.resolve(this.fileService.resolve(workspaceFolder.toResource('gulpfile.js'))).then((stat) => { // TODO@Dirk (https://github.com/Microsoft/vscode/issues/29454)
234234
let config = ProcessRunnerDetector.detectorConfig('gulp');
235235
let process = new LineProcess('gulp', [config.arg, '--no-color'], true, { cwd: this._cwd });
@@ -239,7 +239,7 @@ export class ProcessRunnerDetector {
239239
});
240240
}
241241

242-
private tryDetectGrunt(workspaceFolder: IWorkspaceFolder, list: boolean): Promise<DetectorResult> {
242+
private tryDetectGrunt(workspaceFolder: IWorkspaceFolder, list: boolean): Promise<DetectorResult | null> {
243243
return Promise.resolve(this.fileService.resolve(workspaceFolder.toResource('Gruntfile.js'))).then((stat) => { // TODO@Dirk (https://github.com/Microsoft/vscode/issues/29454)
244244
let config = ProcessRunnerDetector.detectorConfig('grunt');
245245
let process = new LineProcess('grunt', [config.arg, '--no-color'], true, { cwd: this._cwd });
@@ -249,7 +249,7 @@ export class ProcessRunnerDetector {
249249
});
250250
}
251251

252-
private tryDetectJake(workspaceFolder: IWorkspaceFolder, list: boolean): Promise<DetectorResult> {
252+
private tryDetectJake(workspaceFolder: IWorkspaceFolder, list: boolean): Promise<DetectorResult | null> {
253253
let run = () => {
254254
let config = ProcessRunnerDetector.detectorConfig('jake');
255255
let process = new LineProcess('jake', [config.arg], true, { cwd: this._cwd });

src/vs/workbench/services/dialogs/browser/remoteFileDialog.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,24 +46,24 @@ enum UpdateResult {
4646
}
4747

4848
export class RemoteFileDialog {
49-
private options: IOpenDialogOptions;
50-
private currentFolder: URI;
51-
private filePickBox: IQuickPick<FileQuickPickItem>;
52-
private hidden: boolean;
53-
private allowFileSelection: boolean;
54-
private allowFolderSelection: boolean;
49+
private options!: IOpenDialogOptions;
50+
private currentFolder!: URI;
51+
private filePickBox!: IQuickPick<FileQuickPickItem>;
52+
private hidden: boolean = false;
53+
private allowFileSelection: boolean = true;
54+
private allowFolderSelection: boolean = false;
5555
private remoteAuthority: string | undefined;
56-
private requiresTrailing: boolean;
56+
private requiresTrailing: boolean = false;
5757
private trailing: string | undefined;
5858
private scheme: string = REMOTE_HOST_SCHEME;
5959
private contextKey: IContextKey<boolean>;
60-
private userEnteredPathSegment: string;
61-
private autoCompletePathSegment: string;
62-
private activeItem: FileQuickPickItem;
63-
private userHome: URI;
60+
private userEnteredPathSegment: string = '';
61+
private autoCompletePathSegment: string = '';
62+
private activeItem: FileQuickPickItem | undefined;
63+
private userHome!: URI;
6464
private badPath: string | undefined;
65-
private remoteAgentEnvironment: IRemoteAgentEnvironment | null;
66-
private separator: string;
65+
private remoteAgentEnvironment: IRemoteAgentEnvironment | null | undefined;
66+
private separator: string = '/';
6767
private onBusyChangeEmitter = new Emitter<boolean>();
6868
private updatingPromise: CancelablePromise<void> | undefined;
6969

@@ -865,4 +865,4 @@ export class RemoteFileDialog {
865865
return undefined;
866866
}
867867
}
868-
}
868+
}

0 commit comments

Comments
 (0)