Skip to content

Commit 4b456c3

Browse files
authored
feat(slnx): support new solution format (#21)
1 parent e667f6c commit 4b456c3

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/bsp-server/BuildHelper.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,16 @@ namespace dotnet_bsp;
99

1010
internal static class BuildHelper
1111
{
12+
public static string[] SolutionFileExtensions = [ ".sln", ".slnx" ];
13+
1214
internal static IEnumerable<string> ExtractProjectsFromSolutions(BuildTargetIdentifier[] targets)
1315
{
1416
var projList = targets
1517
.Where(x => Path.GetExtension(x.ToString()) == ".csproj")
1618
.Select(x => x.Uri.AbsolutePath)
1719
.ToList();
1820
var slnList = targets
19-
.Where(x => Path.GetExtension(x.ToString()) == ".sln");
21+
.Where(x => SolutionFileExtensions.Contains(Path.GetExtension(x.ToString())));
2022
foreach (var target in slnList)
2123
{
2224
var slnFile = SolutionFile.Parse(target.ToString());

src/bsp-server/Handlers/WorkspaceBuildTargetsHandler.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ private IReadOnlyList<BuildTarget> GetBuildTargetsInWorkspace(string workspacePa
4242
logger.LogInformation("Search solution files in: {}", workspacePath);
4343
//TODO: think about the implications to search for all sln files in workspace
4444
var slnFilePath = Directory
45-
.GetFiles(workspacePath, "*.sln")
45+
.GetFiles(workspacePath)
46+
.Where(x => BuildHelper.SolutionFileExtensions.Contains(Path.GetExtension(x)))
4647
.Take(1)
4748
.SingleOrDefault();
4849
var projectFiles = new List<string>();

0 commit comments

Comments
 (0)