Skip to content

Commit f588850

Browse files
authored
Merge pull request #7082 from dotnet/dev/jorobich/open-solution-filters
List solution filter files (.slnf) in the 'Open Solution' command.
2 parents f53131a + f07316e commit f588850

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/lsptoolshost/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ async function openSolution(languageServer: RoslynLanguageServer): Promise<vscod
178178
return undefined;
179179
}
180180

181-
const solutionFiles = await vscode.workspace.findFiles('**/*.sln');
181+
const solutionFiles = await vscode.workspace.findFiles('**/*.{sln,slnf}');
182182
const launchTargets = solutionFiles.map(createLaunchTargetForSolution);
183183
const launchTarget = await vscode.window.showQuickPick(launchTargets, {
184184
matchOnDescription: true,

src/shared/launchTarget.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ export interface LaunchTarget {
2929
}
3030

3131
export function createLaunchTargetForSolution(resource: vscode.Uri): LaunchTarget {
32-
const dirname = path.dirname(resource.fsPath);
32+
const directoryPath = path.dirname(resource.fsPath);
33+
const relativePath = vscode.workspace.asRelativePath(directoryPath);
3334
return {
3435
label: path.basename(resource.fsPath),
35-
description: vscode.workspace.asRelativePath(dirname),
36+
// When the relativePath matches the directoryPath, it means we are in the root of the workspace.
37+
description: directoryPath === relativePath ? '' : relativePath,
3638
target: resource.fsPath,
37-
directory: path.dirname(resource.fsPath),
39+
directory: directoryPath,
3840
workspaceKind: LaunchTargetKind.Solution,
3941
};
4042
}

0 commit comments

Comments
 (0)