Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear nullability warnings in server/omnisharp.ts #5199

Merged
10 changes: 5 additions & 5 deletions src/features/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ async function pickProjectAndStart(server: OmniSharpServer, optionProvider: Opti
}

export async function showProjectSelector(server: OmniSharpServer, targets: LaunchTarget[]): Promise<void> {
return vscode.window.showQuickPick(targets, {
const launchTarget = await vscode.window.showQuickPick(targets, {
matchOnDescription: true,
placeHolder: `Select 1 of ${targets.length} projects`
}).then(async launchTarget => {
if (launchTarget) {
return server.restart(launchTarget);
}
});

if (launchTarget !== undefined) {
return server.restart(launchTarget);
}
}

interface Command {
Expand Down
4 changes: 2 additions & 2 deletions src/observers/OmnisharpDebugModeLoggerObserver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export class OmnisharpDebugModeLoggerObserver extends BaseLoggerObserver {
}

private handleOmnisharpServerRequestCancelled(event: OmnisharpServerRequestCancelled) {
this.logger.appendLine(`Cancelled request for ${event.command} (${event.id}).`);
this.logger.appendLine(`Cancelled request for ${event.command}${event.id ? ` (${event.id})` : ''}.`);
this.logger.appendLine();
}

Expand Down Expand Up @@ -101,4 +101,4 @@ export class OmnisharpDebugModeLoggerObserver extends BaseLoggerObserver {
default: throw new Error(`Unknown log level value: ${logLevel}`);
}
}
}
}
2 changes: 1 addition & 1 deletion src/omnisharp/loggingEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export class OmnisharpServerDequeueRequest implements BaseEvent {

export class OmnisharpServerRequestCancelled implements BaseEvent {
type = EventType.OmnisharpServerRequestCancelled;
constructor(public command: string, public id: number) { }
constructor(public command: string, public id: number | undefined) { }
}

export class OmnisharpServerProcessRequestStart implements BaseEvent {
Expand Down
Loading