Skip to content

Commit 4716afa

Browse files
committed
strcit null checks
#60565
1 parent 654015a commit 4716afa

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Diff for: src/tsconfig.strictNullChecks.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"./vs/base/common/winjs.base.d.ts",
7979
"./vs/base/common/winjs.polyfill.promise.ts",
8080
"./vs/base/common/worker/simpleWorker.ts",
81+
"./vs/workbench/common/resources.ts",
8182
"./vs/base/node/decoder.ts",
8283
"./vs/base/node/id.ts",
8384
"./vs/base/node/paths.ts",
@@ -313,4 +314,4 @@
313314
"exclude": [
314315
"./typings/require-monaco.d.ts"
315316
]
316-
}
317+
}

Diff for: src/vs/workbench/common/resources.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class ResourceContextKey extends Disposable implements IContextKey<URI> {
2525
private _resourceKey: IContextKey<URI>;
2626
private _schemeKey: IContextKey<string>;
2727
private _filenameKey: IContextKey<string>;
28-
private _langIdKey: IContextKey<string>;
28+
private _langIdKey: IContextKey<string | null>;
2929
private _extensionKey: IContextKey<string>;
3030
private _hasResource: IContextKey<boolean>;
3131
private _isfileSystemResource: IContextKey<boolean>;
@@ -58,7 +58,7 @@ export class ResourceContextKey extends Disposable implements IContextKey<URI> {
5858
this._resourceKey.set(value);
5959
this._schemeKey.set(value && value.scheme);
6060
this._filenameKey.set(value && paths.basename(value.fsPath));
61-
this._langIdKey.set(value && this._modeService.getModeIdByFilepathOrFirstLine(value.fsPath));
61+
this._langIdKey.set(value ? this._modeService.getModeIdByFilepathOrFirstLine(value.fsPath) : null);
6262
this._extensionKey.set(value && paths.extname(value.fsPath));
6363
this._hasResource.set(!!value);
6464
this._isfileSystemResource.set(value && this._fileService.canHandleResource(value));

0 commit comments

Comments
 (0)