Skip to content

Commit

Permalink
Restore launch target for workspace root when no solution present
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeRobich committed Aug 3, 2021
1 parent 39edaaa commit a499987
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/omnisharp/launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,19 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
const hasSlnFile = solutionTargets.length > 0;
const hasProjectJson = projectJsonTargets.length > 0;

// Add the root folder under the following circumstances:
// * If there are .csproj files, but no .sln or .slnf file, and none in the root.
// * If there are project.json files, but none in the root.
if ((hasCsProjFiles && !hasSlnFile) || (hasProjectJson && !hasProjectJsonAtRoot)) {
projectTargets.push({
label: path.basename(folderPath),
description: '',
target: folderPath,
directory: folderPath,
kind: LaunchTargetKind.Folder
});
}

// if we noticed any CSX file(s), add a single CSX-specific target pointing at the root folder
if (hasCSX) {
otherTargets.push({
Expand Down

0 comments on commit a499987

Please sign in to comment.