Open verdie-g opened 5 months ago
This stuff was fine but Jetbrains change and make it more complicated every new version Rider, they have their own NuGet package for it https://www.nuget.org/packages/JetBrains.Rider.PathLocator/
I don't really want us to have to use that...
Personally, I find it okay if s&box requires Rider to be running to be detected as long as it mentions it in the editor settings dialog. But currently after restarting the IDE it's reset to VS. Fixing that part could be a good first step.
I changed the detection code for Rider from
if ( value == null )
{
// try again for a toolbox install
using ( var key = Registry.ClassesRoot.OpenSubKey( @"Applications\\Toolbox.Rider.ch-0\\shell\\open\\command" ) )
{
value = key?.GetValue( "" ) as string;
}
}
to
if ( value == null )
{
// try again for a toolbox install
var subKeyRegex = new Regex( @"^Toolbox\.Rider\.[a-z0-9\-]+$", RegexOptions.IgnoreCase );
var applicationsKey = Registry.ClassesRoot.OpenSubKey( "Applications" );
foreach ( var subKeyName in applicationsKey.GetSubKeyNames() )
{
if ( subKeyRegex.IsMatch( subKeyName ) )
{
using ( var key = applicationsKey.OpenSubKey( $"{subKeyName}\\shell\\open\\command" ) )
{
value = key?.GetValue( "" ) as string;
break;
}
}
}
}
It is backwards compatible with the existing solution and also supports the new structure which ends with a guid.
Describe the bug
I'm using Rider but s&box doesn't seem to detect it because it's greyed out in the selection.![image](https://github.com/Facepunch/sbox-issues/assets/9092290/d3049e27-fb88-4ff7-99f6-f6f460ca4d0f)
Though, if Rider is already running, s&box is able to detect it and I can select it![image](https://github.com/Facepunch/sbox-issues/assets/9092290/a485375d-3bb3-458d-920b-07c6b5f46c94)
A little more annoying thing is that whenever I restart the editor, my editor preference is lost so opening the solution runs VS.
One thing that could be different than a usual setup is that I installed Rider through JetBrains toolbox.
To Reproduce
Expected behavior
Rider should correctly be detected by s&box.
Media/Files
No response
Additional context
No response