Strict null check mainThreadComments

This commit is contained in:
Matt Bierner 2019-03-18 21:40:11 -07:00
parent b6f756832e
commit c51f04c97a
2 changed files with 8 additions and 2 deletions

View file

@ -360,6 +360,7 @@
"./vs/workbench/test/common/memento.test.ts",
"./vs/workbench/test/common/notifications.test.ts",
"./vs/workbench/test/electron-browser/api/extHost.api.impl.test.ts",
"./vs/workbench/test/electron-browser/api/extHostApiCommands.test.ts",
"./vs/workbench/test/electron-browser/api/extHostCommands.test.ts",
"./vs/workbench/test/electron-browser/api/extHostConfiguration.test.ts",
"./vs/workbench/test/electron-browser/api/extHostDiagnostics.test.ts",
@ -388,6 +389,8 @@
"./vs/workbench/test/electron-browser/api/mock.ts",
"./vs/workbench/test/electron-browser/api/testRPCProtocol.ts",
"./vs/workbench/test/electron-browser/colorRegistry.releaseTest.ts",
"./vs/workbench/test/electron-browser/quickopen.perf.integrationTest.ts",
"./vs/workbench/test/electron-browser/textsearch.perf.integrationTest.ts",
"./vs/workbench/test/workbenchTestServices.ts"
],
"exclude": [

View file

@ -142,11 +142,11 @@ export class MainThreadCommentThread implements modes.CommentThread2 {
return this._additionalCommands;
}
set deleteCommand(newCommand: modes.Command) {
set deleteCommand(newCommand: modes.Command | undefined) {
this._deleteCommand = newCommand;
}
get deleteCommand(): modes.Command {
get deleteCommand(): modes.Command | undefined {
return this._deleteCommand;
}
@ -476,6 +476,9 @@ export class MainThreadComments extends Disposable implements MainThreadComments
$unregisterCommentController(handle: number): void {
const providerId = this._handlers.get(handle);
if (typeof providerId !== 'string') {
throw new Error('unknown handler');
}
this._commentService.unregisterCommentController(providerId);
this._handlers.delete(handle);
this._commentControllers.delete(handle);