File tree Expand file tree Collapse file tree
src/CodingWithCalvin.MCPServer/Services Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -106,7 +106,32 @@ public async Task<List<ProjectInfo>> GetProjectsAsync()
106106
107107 foreach ( EnvDTE . Project project in dte . Solution . Projects )
108108 {
109- try
109+ CollectProjects ( project , projects ) ;
110+ }
111+
112+ return projects ;
113+ }
114+
115+ private static void CollectProjects ( EnvDTE . Project project , List < ProjectInfo > projects )
116+ {
117+ ThreadHelper . ThrowIfNotOnUIThread ( ) ;
118+
119+ try
120+ {
121+ if ( project . Kind == ProjectKinds . vsProjectKindSolutionFolder )
122+ {
123+ if ( project . ProjectItems != null )
124+ {
125+ foreach ( ProjectItem item in project . ProjectItems )
126+ {
127+ if ( item . SubProject != null )
128+ {
129+ CollectProjects ( item . SubProject , projects ) ;
130+ }
131+ }
132+ }
133+ }
134+ else
110135 {
111136 projects . Add ( new ProjectInfo
112137 {
@@ -115,13 +140,11 @@ public async Task<List<ProjectInfo>> GetProjectsAsync()
115140 Kind = project . Kind
116141 } ) ;
117142 }
118- catch ( Exception ex )
119- {
120- VsixTelemetry . TrackException ( ex ) ;
121- }
122143 }
123-
124- return projects ;
144+ catch ( Exception ex )
145+ {
146+ VsixTelemetry . TrackException ( ex ) ;
147+ }
125148 }
126149
127150 public async Task < List < DocumentInfo > > GetOpenDocumentsAsync ( )
You can’t perform that action at this time.
0 commit comments