From a499987c4295da208df4f6a7bd3209a57d43cf52 Mon Sep 17 00:00:00 2001 From: Joey Robichaud Date: Tue, 3 Aug 2021 08:44:56 -0700 Subject: [PATCH] Restore launch target for workspace root when no solution present --- src/omnisharp/launcher.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/omnisharp/launcher.ts b/src/omnisharp/launcher.ts index 0f8a397b5..dcf9093f3 100644 --- a/src/omnisharp/launcher.ts +++ b/src/omnisharp/launcher.ts @@ -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({