Skip to content

Commit

Permalink
Reallow opening folder containing several csproj files
Browse files Browse the repository at this point in the history
369a904 removed the ability to
target a folder which does not contain any sln files but does
contain one or more csproj files in subdirectories.  This
commit re-enables this development mode.
  • Loading branch information
wuzzeb committed Jul 29, 2021
1 parent 10fc4db commit 00894e1
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)) {
otherTargets.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 00894e1

Please sign in to comment.