feature: supports JetBrains Rider (#77)

This commit is contained in:
leo 2024-04-23 16:52:55 +08:00
parent e1adc30fc1
commit fd2160e56e
6 changed files with 26 additions and 1 deletions

View file

@ -62,9 +62,10 @@ This app supports open repository in external tools listed in the table below.
| Visual Studio Code | YES | YES | YES | VSCODE_PATH | | Visual Studio Code | YES | YES | YES | VSCODE_PATH |
| Visual Studio Code - Insiders | YES | YES | YES | VSCODE_INSIDERS_PATH | | Visual Studio Code - Insiders | YES | YES | YES | VSCODE_INSIDERS_PATH |
| JetBrains Fleet | YES | YES | YES | FLEET_PATH | | JetBrains Fleet | YES | YES | YES | FLEET_PATH |
| JetBrains Rider | YES | YES | YES | RIDER_PATH |
| Sublime Text | YES | YES | YES | SUBLIME_TEXT_PATH | | Sublime Text | YES | YES | YES | SUBLIME_TEXT_PATH |
You can set the given environment variable for special tool if it can NOT be found by this app automatically. > You can set the given environment variable for special tool if it can NOT be found by this app automatically.
## Screenshots ## Screenshots

View file

@ -59,6 +59,11 @@ namespace SourceGit.Models
TryAdd("JetBrains Fleet", "fleet", "\"{0}\"", "FLEET_PATH", platform_finder); TryAdd("JetBrains Fleet", "fleet", "\"{0}\"", "FLEET_PATH", platform_finder);
} }
public void Rider(Func<string> platform_finder)
{
TryAdd("JetBrains Rider", "rider", "\"{0}\"", "RIDER_PATH", platform_finder);
}
public void SublimeText(Func<string> platform_finder) public void SublimeText(Func<string> platform_finder)
{ {
TryAdd("Sublime Text", "sublime_text", "\"{0}\"", "SUBLIME_TEXT_PATH", platform_finder); TryAdd("Sublime Text", "sublime_text", "\"{0}\"", "SUBLIME_TEXT_PATH", platform_finder);

View file

@ -58,6 +58,7 @@ namespace SourceGit.Native
finder.VSCode(() => FindExecutable("code")); finder.VSCode(() => FindExecutable("code"));
finder.VSCodeInsiders(() => FindExecutable("code-insiders")); finder.VSCodeInsiders(() => FindExecutable("code-insiders"));
finder.Fleet(FindJetBrainFleet); finder.Fleet(FindJetBrainFleet);
finder.Rider(() => string.Empty);
finder.SublimeText(() => FindExecutable("subl")); finder.SublimeText(() => FindExecutable("subl"));
return finder.Founded; return finder.Founded;
} }

View file

@ -33,6 +33,7 @@ namespace SourceGit.Native
finder.VSCode(() => "/Applications/Visual Studio Code.app/Contents/Resources/app/bin/code"); 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.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.Fleet(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}/Applications/Fleet.app/Contents/MacOS/Fleet");
finder.Rider(() => string.Empty);
finder.SublimeText(() => "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"); finder.SublimeText(() => "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl");
return finder.Founded; return finder.Founded;
} }

View file

@ -111,6 +111,7 @@ namespace SourceGit.Native
finder.VSCode(FindVSCode); finder.VSCode(FindVSCode);
finder.VSCodeInsiders(FindVSCodeInsiders); finder.VSCodeInsiders(FindVSCodeInsiders);
finder.Fleet(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\Programs\\Fleet\\Fleet.exe"); finder.Fleet(() => $"{Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)}\\Programs\\Fleet\\Fleet.exe");
finder.Rider(FindRider);
finder.SublimeText(FindSublimeText); finder.SublimeText(FindSublimeText);
return finder.Founded; return finder.Founded;
} }
@ -322,6 +323,22 @@ namespace SourceGit.Native
return string.Empty; return string.Empty;
} }
private string FindRider()
{
var rider = Environment.GetEnvironmentVariable("JetBrains Rider");
if (!string.IsNullOrEmpty(rider))
{
rider = rider.TrimEnd(';', ' ');
var path = Path.Combine(rider, "rider64.exe");
if (File.Exists(path))
{
return path;
}
}
return string.Empty;
}
private string FindSublimeText() private string FindSublimeText()
{ {
var localMachine = Microsoft.Win32.RegistryKey.OpenBaseKey( var localMachine = Microsoft.Win32.RegistryKey.OpenBaseKey(

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB