Merge pull request #92 from ennerperez/feature/issues-77

code_review:

* use JsonSerializerContext to avoid AOT warnnings
* since we call TryAdd by interating the installed tools, so detecting by environment variable becomes meaningless (it can not detect tools not installed by Toolbox). Just add it into founded directly
* remove unnecessary type defines
* determine the Icon used by tool while adding it to the founded list.

# Conflicts:
#	src/Native/Linux.cs
#	src/Native/MacOS.cs
#	src/Native/Windows.cs
This commit is contained in:
leo 2024-04-27 20:54:26 +08:00
commit 9a68418f51
24 changed files with 87 additions and 33 deletions

View file

@ -57,8 +57,8 @@ namespace SourceGit.Native
var finder = new Models.ExternalToolsFinder();
finder.VSCode(() => FindExecutable("code"));
finder.VSCodeInsiders(() => FindExecutable("code-insiders"));
finder.Fleet(FindJetBrainFleet);
finder.Rider(() => string.Empty);
finder.Fleet(FindJetBrainsFleet);
finder.FindJetBrainsFromToolbox(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}/JetBrains/Toolbox");
finder.SublimeText(() => FindExecutable("subl"));
return finder.Founded;
}
@ -175,7 +175,7 @@ namespace SourceGit.Native
return null;
}
private string FindJetBrainFleet()
private string FindJetBrainsFleet()
{
var path = $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}/JetBrains/Toolbox/apps/fleet/bin/Fleet";
return File.Exists(path) ? path : FindExecutable("fleet");

View file

@ -33,7 +33,7 @@ namespace SourceGit.Native
finder.VSCode(() => "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code");
finder.VSCodeInsiders(() => "/Applications/Visual Studio Code - Insiders.app/Contents/Resources/app/bin/code");
finder.Fleet(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/Applications/Fleet.app/Contents/MacOS/Fleet");
finder.Rider(() => string.Empty);
finder.FindJetBrainsFromToolbox(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/Library/Application Support/JetBrains/Toolbox");
finder.SublimeText(() => "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl");
return finder.Founded;
}

View file

@ -111,7 +111,7 @@ namespace SourceGit.Native
finder.VSCode(FindVSCode);
finder.VSCodeInsiders(FindVSCodeInsiders);
finder.Fleet(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\Programs\\Fleet\\Fleet.exe");
finder.Rider(FindRider);
finder.FindJetBrainsFromToolbox(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\JetBrains\\Toolbox");
finder.SublimeText(FindSublimeText);
return finder.Founded;
}