Skip to content

Commit

Permalink
Merge pull request #5199 from 50Wliu/users/winstonliu/omnisharp-serve…
Browse files Browse the repository at this point in the history
…r-nullability

Clear nullability warnings in server/omnisharp.ts
  • Loading branch information
JoeRobich authored May 9, 2022
2 parents f1f38b7 + 4c2dc12 commit a64910f
Show file tree
Hide file tree
Showing 4 changed files with 155 additions and 145 deletions.
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

0 comments on commit a64910f

Please sign in to comment.