mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 01:58:53 +01:00
Remove extra checks for non-nullable functions/properties (#94631)
TS 3.9 is smarter about catching cases where an if statement is always true. This revealed a few places in our codebase where we were checking to see if a function property exists before calling it, but the property is not nullable
This commit is contained in:
@@ -1072,11 +1072,9 @@ class DirectDebugAdapter extends AbstractDebugAdapter {
|
||||
constructor(private implementation: vscode.DebugAdapter) {
|
||||
super();
|
||||
|
||||
if (this.implementation.onDidSendMessage) {
|
||||
implementation.onDidSendMessage((message: vscode.DebugProtocolMessage) => {
|
||||
this.acceptMessage(message as DebugProtocol.ProtocolMessage);
|
||||
});
|
||||
}
|
||||
implementation.onDidSendMessage((message: vscode.DebugProtocolMessage) => {
|
||||
this.acceptMessage(message as DebugProtocol.ProtocolMessage);
|
||||
});
|
||||
}
|
||||
|
||||
startSession(): Promise<void> {
|
||||
@@ -1084,15 +1082,11 @@ class DirectDebugAdapter extends AbstractDebugAdapter {
|
||||
}
|
||||
|
||||
sendMessage(message: DebugProtocol.ProtocolMessage): void {
|
||||
if (this.implementation.handleMessage) {
|
||||
this.implementation.handleMessage(message);
|
||||
}
|
||||
this.implementation.handleMessage(message);
|
||||
}
|
||||
|
||||
stopSession(): Promise<void> {
|
||||
if (this.implementation.dispose) {
|
||||
this.implementation.dispose();
|
||||
}
|
||||
this.implementation.dispose();
|
||||
return Promise.resolve(undefined);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user