Skip to content

Commit a64910f

Browse files
authored
Merge pull request #5199 from 50Wliu/users/winstonliu/omnisharp-server-nullability
Clear nullability warnings in server/omnisharp.ts
2 parents f1f38b7 + 4c2dc12 commit a64910f

File tree

4 files changed

+155
-145
lines changed

4 files changed

+155
-145
lines changed

src/features/commands.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ async function pickProjectAndStart(server: OmniSharpServer, optionProvider: Opti
9797
}
9898

9999
export async function showProjectSelector(server: OmniSharpServer, targets: LaunchTarget[]): Promise<void> {
100-
return vscode.window.showQuickPick(targets, {
100+
const launchTarget = await vscode.window.showQuickPick(targets, {
101101
matchOnDescription: true,
102102
placeHolder: `Select 1 of ${targets.length} projects`
103-
}).then(async launchTarget => {
104-
if (launchTarget) {
105-
return server.restart(launchTarget);
106-
}
107103
});
104+
105+
if (launchTarget !== undefined) {
106+
return server.restart(launchTarget);
107+
}
108108
}
109109

110110
interface Command {

src/observers/OmnisharpDebugModeLoggerObserver.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class OmnisharpDebugModeLoggerObserver extends BaseLoggerObserver {
5757
}
5858

5959
private handleOmnisharpServerRequestCancelled(event: OmnisharpServerRequestCancelled) {
60-
this.logger.appendLine(`Cancelled request for ${event.command} (${event.id}).`);
60+
this.logger.appendLine(`Cancelled request for ${event.command}${event.id ? ` (${event.id})` : ''}.`);
6161
this.logger.appendLine();
6262
}
6363

@@ -101,4 +101,4 @@ export class OmnisharpDebugModeLoggerObserver extends BaseLoggerObserver {
101101
default: throw new Error(`Unknown log level value: ${logLevel}`);
102102
}
103103
}
104-
}
104+
}

src/omnisharp/loggingEvents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class OmnisharpServerDequeueRequest implements BaseEvent {
125125

126126
export class OmnisharpServerRequestCancelled implements BaseEvent {
127127
type = EventType.OmnisharpServerRequestCancelled;
128-
constructor(public command: string, public id: number) { }
128+
constructor(public command: string, public id: number | undefined) { }
129129
}
130130

131131
export class OmnisharpServerProcessRequestStart implements BaseEvent {

0 commit comments

Comments
 (0)