Skip to content

Commit e2b0f5a

Browse files
committed
When there are multiple targets found, open the first Folder or Solution target
1 parent f56356b commit e2b0f5a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/omnisharp/server.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,6 +559,14 @@ export class OmniSharpServer {
559559
}
560560
}
561561

562+
// To maintain previous behavior when there are mulitple targets available,
563+
// launch with first Solution or Folder target.
564+
const firstFolderOrSolutionTarget = launchTargets.find(target => target.kind == LaunchTargetKind.Folder)
565+
?? launchTargets.find(target => target.kind == LaunchTargetKind.Solution);
566+
if (firstFolderOrSolutionTarget) {
567+
return this.restart(firstFolderOrSolutionTarget);
568+
}
569+
562570
// When running integration tests, open the first launch target.
563571
if (process.env.RUNNING_INTEGRATION_TESTS === "true") {
564572
return this.restart(launchTargets[0]);

0 commit comments

Comments
 (0)