Skip to content

Commit b1d6c2e

Browse files
Consume new DotNetProjectSystem API shape from OmniSharp
1 parent be23a29 commit b1d6c2e

File tree

2 files changed

+30
-11
lines changed

2 files changed

+30
-11
lines changed

src/assets.ts

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,24 @@ function addLaunchJsonIfNecessary(info: protocol.DotNetWorkspaceInformation, pat
228228

229229
let targetFramework = '<target-framework>';
230230
let executableName = '<project-name.dll>';
231-
232-
let projectWithEntryPoint = info.Projects.find(project => project.EmitEntryPoint === true);
233231

234-
if (projectWithEntryPoint) {
235-
targetFramework = projectWithEntryPoint.TargetFramework.ShortName;
236-
executableName = path.basename(projectWithEntryPoint.CompilationOutputAssemblyFile);
232+
let done = false;
233+
for (var project of info.Projects) {
234+
for (var configuration of project.Configurations) {
235+
if (configuration.Name === "Debug" && configuration.EmitEntryPoint === true) {
236+
if (project.Frameworks.length > 0) {
237+
targetFramework = project.Frameworks[0].ShortName;
238+
executableName = path.basename(configuration.CompilationOutputAssemblyFile)
239+
}
240+
241+
done = true;
242+
break;
243+
}
244+
}
245+
246+
if (done) {
247+
break;
248+
}
237249
}
238250

239251
const launchJson = createLaunchJson(targetFramework, executableName);

src/protocol.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -263,19 +263,26 @@ export interface DnxFramework {
263263

264264
export interface DotNetWorkspaceInformation {
265265
Projects: DotNetProject[];
266+
RuntimePath: string;
266267
}
267268

268269
export interface DotNetProject {
269270
Path: string;
270-
Name: string;
271-
TargetFramework: DotNetFramework;
272-
CompilationOutputPath: string;
273-
CompilationOutputAssemblyFile: string;
274-
CompilationOutputPdbFile: string;
275-
EmitEntryPoint?: boolean;
271+
Name: string;
272+
ProjectSearchPaths: string[];
273+
Configurations: DotNetConfiguration[];
274+
Frameworks: DotNetFramework[];
276275
SourceFiles: string[];
277276
}
278277

278+
export interface DotNetConfiguration {
279+
Name: string;
280+
CompilationOutputPath: string;
281+
CompilationOutputAssemblyFile: string;
282+
CompilationOutputPdbFile: string;
283+
EmitEntryPoint?: boolean;
284+
}
285+
279286
export interface DotNetFramework {
280287
Name: string;
281288
FriendlyName: string;

0 commit comments

Comments
 (0)