File tree Expand file tree Collapse file tree 2 files changed +10
-17
lines changed Expand file tree Collapse file tree 2 files changed +10
-17
lines changed Original file line number Diff line number Diff line change 33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6- import { basename , join } from 'path' ;
6+ import { basename } from 'path' ;
77import { BaseEvent , WorkspaceInformationUpdated } from "../omnisharp/loggingEvents" ;
88import { BaseStatusBarItemObserver } from './BaseStatusBarItemObserver' ;
99import { EventType } from '../omnisharp/EventType' ;
@@ -27,22 +27,7 @@ export class ProjectStatusBarObserver extends BaseStatusBarItemObserver {
2727 let label : string ;
2828 let msbuild = event . info . MsBuild ;
2929 if ( msbuild && msbuild . SolutionPath ) {
30- if ( msbuild . SolutionPath . endsWith ( ".sln" ) ) {
31- label = basename ( msbuild . SolutionPath ) ;
32- }
33- else {
34- // a project file was open, determine which project
35- for ( const project of msbuild . Projects ) {
36- // Get the project name.
37- label = basename ( project . Path ) ;
38-
39- // The solution path is the folder containing the open project. Combine it with the
40- // project name and see if it matches the project's path.
41- if ( join ( msbuild . SolutionPath , label ) === project . Path ) {
42- break ;
43- }
44- }
45- }
30+ label = basename ( msbuild . SolutionPath ) ;
4631 this . SetAndShowStatusBar ( '$(file-directory) ' + label , 'o.pickProjectAndStart' ) ;
4732 }
4833 else {
Original file line number Diff line number Diff 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
565+ . find ( target => target . kind == LaunchTargetKind . Folder || 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 ] ) ;
You can’t perform that action at this time.
0 commit comments