@@ -159,26 +159,12 @@ public static void LoadPlugins(PluginsSettings settings)
159159 _metadatas = PluginConfig . Parse ( Directories ) ;
160160 Settings = settings ;
161161 Settings . UpdatePluginSettings ( _metadatas ) ;
162- // Update Json RPC plugin directory before loading plugins so that we can pass the correct plugin directory
163- UpdateJsonRPCPluginDirectory ( _metadatas ) ;
164162 AllPlugins = PluginsLoader . Plugins ( _metadatas , Settings ) ;
165- // Update dotnet plugin directory after loading plugins because we need to get assembly name first
166- UpdateNotNetPluginDirectory ( _metadatas ) ;
163+ // Since dotnet plugins need to get assembly name first, we should update plugin directory after loading plugins
164+ UpdatePluginDirectory ( _metadatas ) ;
167165 }
168166
169- private static void UpdateJsonRPCPluginDirectory ( List < PluginMetadata > metadatas )
170- {
171- foreach ( var metadata in metadatas )
172- {
173- if ( ! AllowedLanguage . IsDotNet ( metadata . Language ) )
174- {
175- metadata . PluginSettingsDirectoryPath = Path . Combine ( DataLocation . PluginSettingsDirectory , metadata . Name ) ;
176- metadata . PluginCacheDirectoryPath = Path . Combine ( DataLocation . PluginCacheDirectory , metadata . Name ) ;
177- }
178- }
179- }
180-
181- private static void UpdateNotNetPluginDirectory ( List < PluginMetadata > metadatas )
167+ private static void UpdatePluginDirectory ( List < PluginMetadata > metadatas )
182168 {
183169 foreach ( var metadata in metadatas )
184170 {
@@ -187,6 +173,11 @@ private static void UpdateNotNetPluginDirectory(List<PluginMetadata> metadatas)
187173 metadata . PluginSettingsDirectoryPath = Path . Combine ( DataLocation . PluginSettingsDirectory , metadata . AssemblyName ) ;
188174 metadata . PluginCacheDirectoryPath = Path . Combine ( DataLocation . PluginCacheDirectory , metadata . AssemblyName ) ;
189175 }
176+ else
177+ {
178+ metadata . PluginSettingsDirectoryPath = Path . Combine ( DataLocation . PluginSettingsDirectory , metadata . Name ) ;
179+ metadata . PluginCacheDirectoryPath = Path . Combine ( DataLocation . PluginCacheDirectory , metadata . Name ) ;
180+ }
190181 }
191182 }
192183
0 commit comments