@@ -9,13 +9,13 @@ namespace GodotTools.Ides.Rider
9
9
{
10
10
public static class RiderPathManager
11
11
{
12
- private static readonly string editorPathSettingName = "mono/editor/editor_path_optional" ;
12
+ public static readonly string EditorPathSettingName = "mono/editor/editor_path_optional" ;
13
13
14
14
private static string GetRiderPathFromSettings ( )
15
15
{
16
16
var editorSettings = GodotSharpEditor . Instance . GetEditorInterface ( ) . GetEditorSettings ( ) ;
17
- if ( editorSettings . HasSetting ( editorPathSettingName ) )
18
- return ( string ) editorSettings . GetSetting ( editorPathSettingName ) ;
17
+ if ( editorSettings . HasSetting ( EditorPathSettingName ) )
18
+ return ( string ) editorSettings . GetSetting ( EditorPathSettingName ) ;
19
19
return null ;
20
20
}
21
21
@@ -25,22 +25,22 @@ public static void Initialize()
25
25
var editor = ( ExternalEditorId ) editorSettings . GetSetting ( "mono/editor/external_editor" ) ;
26
26
if ( editor == ExternalEditorId . Rider )
27
27
{
28
- if ( ! editorSettings . HasSetting ( editorPathSettingName ) )
28
+ if ( ! editorSettings . HasSetting ( EditorPathSettingName ) )
29
29
{
30
- Globals . EditorDef ( editorPathSettingName , "Optional" ) ;
30
+ Globals . EditorDef ( EditorPathSettingName , "Optional" ) ;
31
31
editorSettings . AddPropertyInfo ( new Godot . Collections . Dictionary
32
32
{
33
33
[ "type" ] = Variant . Type . String ,
34
- [ "name" ] = editorPathSettingName ,
34
+ [ "name" ] = EditorPathSettingName ,
35
35
[ "hint" ] = PropertyHint . File ,
36
36
[ "hint_string" ] = ""
37
37
} ) ;
38
38
}
39
39
40
- var riderPath = ( string ) editorSettings . GetSetting ( editorPathSettingName ) ;
40
+ var riderPath = ( string ) editorSettings . GetSetting ( EditorPathSettingName ) ;
41
41
if ( IsRiderAndExists ( riderPath ) )
42
42
{
43
- Globals . EditorDef ( editorPathSettingName , riderPath ) ;
43
+ Globals . EditorDef ( EditorPathSettingName , riderPath ) ;
44
44
return ;
45
45
}
46
46
@@ -50,17 +50,15 @@ public static void Initialize()
50
50
return ;
51
51
52
52
var newPath = paths . Last ( ) . Path ;
53
- Globals . EditorDef ( editorPathSettingName , newPath ) ;
54
- editorSettings . SetSetting ( editorPathSettingName , newPath ) ;
53
+ Globals . EditorDef ( EditorPathSettingName , newPath ) ;
54
+ editorSettings . SetSetting ( EditorPathSettingName , newPath ) ;
55
55
}
56
56
}
57
57
58
- private static bool IsRider ( string path )
58
+ public static bool IsRider ( string path )
59
59
{
60
60
if ( string . IsNullOrEmpty ( path ) )
61
- {
62
61
return false ;
63
- }
64
62
65
63
var fileInfo = new FileInfo ( path ) ;
66
64
var filename = fileInfo . Name . ToLowerInvariant ( ) ;
@@ -81,8 +79,8 @@ private static string CheckAndUpdatePath(string riderPath)
81
79
return null ;
82
80
83
81
var newPath = paths . Last ( ) . Path ;
84
- editorSettings . SetSetting ( editorPathSettingName , newPath ) ;
85
- Globals . EditorDef ( editorPathSettingName , newPath ) ;
82
+ editorSettings . SetSetting ( EditorPathSettingName , newPath ) ;
83
+ Globals . EditorDef ( EditorPathSettingName , newPath ) ;
86
84
return newPath ;
87
85
}
88
86
0 commit comments