Support macos and linux

This commit is contained in:
Dalton
2025-05-10 09:17:49 +08:00
parent 0a98b387a9
commit 0a7001698c
2 changed files with 46 additions and 4 deletions

View File

@@ -125,7 +125,17 @@ namespace Microsoft.Unity.VisualStudio.Editor
{
var workspaces = new List<string>();
var userProfile = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile);
var cursorStoragePath = Path.Combine(userProfile, "AppData", "Roaming", "cursor", "User", "workspaceStorage");
string cursorStoragePath;
#if UNITY_EDITOR_OSX
cursorStoragePath = Path.Combine(userProfile, "Library", "Application Support", "cursor", "User", "workspaceStorage");
#elif UNITY_EDITOR_LINUX
cursorStoragePath = Path.Combine(userProfile, ".config", "cursor", "User", "workspaceStorage");
#else
cursorStoragePath = Path.Combine(userProfile, "AppData", "Roaming", "cursor", "User", "workspaceStorage");
#endif
Debug.Log($"[Cursor] Looking for workspaces in: {cursorStoragePath}");
if (Directory.Exists(cursorStoragePath))
{
@@ -186,6 +196,10 @@ namespace Microsoft.Unity.VisualStudio.Editor
}
}
}
else
{
Debug.LogWarning($"[Cursor] Workspace storage directory not found: {cursorStoragePath}");
}
return workspaces.Distinct().ToArray();
}