Skip to content

Commit a60981d

Browse files
committed
Fix simple strict null errors in extensions
1 parent e97cf68 commit a60981d

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

src/vs/workbench/contrib/files/browser/views/explorerViewer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
660660

661661
return overwritePromise.then(res => {
662662
if (!res.confirmed) {
663-
return undefined;
663+
return [];
664664
}
665665

666666
// Run add in sequence
@@ -673,7 +673,7 @@ export class FileDragAndDrop implements ITreeDragAndDrop<ExplorerItem> {
673673
// if the target exists and is dirty, make sure to revert it. otherwise the dirty contents
674674
// of the target file would replace the contents of the added file. since we already
675675
// confirmed the overwrite before, this is OK.
676-
let revertPromise: Promise<ITextFileOperationResult> = Promise.resolve(null);
676+
let revertPromise: Promise<ITextFileOperationResult | null> = Promise.resolve(null);
677677
if (this.textFileService.isDirty(targetFile)) {
678678
revertPromise = this.textFileService.revertAll([targetFile], { soft: true });
679679
}

src/vs/workbench/services/extensions/node/extensionHostMain.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export class ExtensionHostMain {
5656

5757
constructor(protocol: IMessagePassingProtocol, initData: IInitData) {
5858
this._isTerminating = false;
59-
const uriTransformer: IURITransformer = null;
59+
const uriTransformer: IURITransformer | null = null;
6060
const rpcProtocol = new RPCProtocol(protocol, null, uriTransformer);
6161

6262
// ensure URIs are transformed and revived
@@ -117,7 +117,7 @@ export class ExtensionHostMain {
117117

118118
private _patchPatchedConsole(mainThreadConsole: MainThreadConsoleShape): void {
119119
// The console is already patched to use `process.send()`
120-
const nativeProcessSend = process.send;
120+
const nativeProcessSend = process.send!;
121121
process.send = (...args: any[]) => {
122122
if (args.length === 0 || !args[0] || args[0].type !== '__$console') {
123123
return nativeProcessSend.apply(process, args);

src/vs/workbench/services/extensions/node/extensionHostProcess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ let onTerminate = function () {
4545

4646
function createExtHostProtocol(): Promise<IMessagePassingProtocol> {
4747

48-
const pipeName = process.env.VSCODE_IPC_HOOK_EXTHOST;
48+
const pipeName = process.env.VSCODE_IPC_HOOK_EXTHOST!;
4949

5050
return new Promise<IMessagePassingProtocol>((resolve, reject) => {
5151

0 commit comments

Comments
 (0)