Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ jobs:
- name: Build dotnet
run: dotnet build

# - name: Test
# run: dotnet test
- name: Test
run: dotnet test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ surab-lsp-server.log
*.so
*.nupkg
editor-groups.json
*.csproj.user
15 changes: 14 additions & 1 deletion src/common/Helpers/PathHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ internal static class PathHelper
{
public static string GetRepoRootFolderPath()
{
return Path.Combine(GetCallerFilePath(), "../../../../");
// Climb up until we find it.
var cd = Environment.CurrentDirectory;
// Match when we find surab/src.
while (Path.GetFileName(cd) != "src" && Path.GetFileName(Path.GetDirectoryName(cd)) != "surab")
{
cd = Path.GetDirectoryName(cd);
}
// One more to get repo directory here.
cd = Path.GetDirectoryName(cd);

return cd!;
}

public static string GetSrcFolderPath()
Expand All @@ -29,6 +39,9 @@ public static string GetRuntimeTargetFolderPath()
return Path.Combine(GetRepoRootFolderPath(), "target");
}

// Note: Used to use this in GetRepoRootFolderPath but CallerFilePath computes the path on
// compile time so it might produce results not compatible with linux (e.g. if debugging in wsl
// in VS).
private static string GetCallerFilePath([CallerFilePath] string callerFilePath = null!)
{
return callerFilePath;
Expand Down
Loading