Skip to content

Commit a499987

Browse files
committed
Restore launch target for workspace root when no solution present
1 parent 39edaaa commit a499987

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/omnisharp/launcher.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,19 @@ export function resourcesAndFolderMapToLaunchTargets(resources: vscode.Uri[], wo
188188
const hasSlnFile = solutionTargets.length > 0;
189189
const hasProjectJson = projectJsonTargets.length > 0;
190190

191+
// Add the root folder under the following circumstances:
192+
// * If there are .csproj files, but no .sln or .slnf file, and none in the root.
193+
// * If there are project.json files, but none in the root.
194+
if ((hasCsProjFiles && !hasSlnFile) || (hasProjectJson && !hasProjectJsonAtRoot)) {
195+
projectTargets.push({
196+
label: path.basename(folderPath),
197+
description: '',
198+
target: folderPath,
199+
directory: folderPath,
200+
kind: LaunchTargetKind.Folder
201+
});
202+
}
203+
191204
// if we noticed any CSX file(s), add a single CSX-specific target pointing at the root folder
192205
if (hasCSX) {
193206
otherTargets.push({

0 commit comments

Comments
 (0)