Skip to content

Commit 84b3aac

Browse files
committed
Clarify ExperimentalFeatureTypes usage
1 parent 74e527e commit 84b3aac

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

Rubberduck.Core/Common/ModuleExporter.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ public class ModuleExporter : IModuleExporter
1111

1212
public string ExportPath => TempFile
1313
? ApplicationConstants.RUBBERDUCK_TEMP_PATH
14-
// FIXME check that GetExecutingAssembly is similarly acceptable as .GetAssembly(typeof(App))
15-
: Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
14+
// note that App is not in the entry-point assembly, since Core is not the entry point anymore
15+
: Path.GetDirectoryName(Assembly.GetAssembly(typeof(App)).Location);
1616

1717
public string Export(IVBComponent component, bool tempFile = true)
1818
{

Rubberduck.Core/UI/Settings/GeneralSettingsViewModel.cs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
using Rubberduck.Settings;
66
using Rubberduck.Common;
77
using NLog;
8-
using Rubberduck.Parsing.Common;
9-
//using Rubberduck.Root;
108
using Rubberduck.SettingsProvider;
119
using Rubberduck.UI.Command;
1210

@@ -27,7 +25,7 @@ public class GeneralSettingsViewModel : SettingsViewModelBase, ISettingsViewMode
2725
public GeneralSettingsViewModel(Configuration config, IOperatingSystem operatingSystem, IEnumerable<Type> experimentalFeatureTypes)
2826
{
2927
_operatingSystem = operatingSystem;
30-
_experimentalFeatureTypes = new ReadOnlyCollection<Type>(experimentalFeatureTypes.ToList());
28+
_experimentalFeatureTypes = experimentalFeatureTypes.ToList().AsReadOnly();
3129
Languages = new ObservableCollection<DisplayLanguageSetting>(
3230
new[]
3331
{
@@ -231,9 +229,6 @@ private void TransferSettingsToView(IGeneralSettings general, IHotkeySettings ho
231229
AutoSavePeriod = general.AutoSavePeriod;
232230
SelectedLogLevel = LogLevels.First(l => l.Ordinal == general.MinimumLogLevel);
233231

234-
//RubberduckIoCInstaller.AssembliesToRegister()
235-
// .SelectMany(s => s.DefinedTypes)
236-
// .Where(w => Attribute.IsDefined(w, typeof(ExperimentalAttribute)))
237232
ExperimentalFeatures = _experimentalFeatureTypes
238233
.SelectMany(s => s.CustomAttributes.Where(a => a.ConstructorArguments.Any()).Select(a => (string)a.ConstructorArguments.First().Value))
239234
.Distinct()

Rubberduck.Core/UI/Settings/SettingsForm.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,15 @@ public SettingsForm(IGeneralConfigService configService, IOperatingSystem operat
2222
config,
2323
new SettingsView
2424
{
25-
Control = new GeneralSettings(new GeneralSettingsViewModel(config, operatingSystem, new ReadOnlyCollection<Type>(new List<Type>()))),
25+
// FIXME inject types marked as ExperimentalFeatures
26+
/*
27+
* These ExperimentalFeatureTypes were originally obtained by directly calling into the IoC container
28+
* (since only it knows, which Assemblies have been loaded as Plugins). The code is preserved here for easy access.
29+
* RubberduckIoCInstaller.AssembliesToRegister()
30+
* .SelectMany(s => s.DefinedTypes)
31+
* .Where(w => Attribute.IsDefined(w, typeof(ExperimentalAttribute)))
32+
*/
33+
Control = new GeneralSettings(new GeneralSettingsViewModel(config, operatingSystem, new List<Type>())),
2634
View = SettingsViews.GeneralSettings
2735
},
2836
new SettingsView

0 commit comments

Comments
 (0)