Skip to content

Commit e3daa3b

Browse files
authored
Merge branch 'next' into 3260
2 parents 4f32a11 + f405462 commit e3daa3b

File tree

172 files changed

+1643
-2144
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

172 files changed

+1643
-2144
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<img src="http://i.stack.imgur.com/jnBEp.jpg" width=100% />
22

3+
<!-- campaign is no longer accepting donations
34
### Donate!
45
56
If you like this project and would like to thank its contributors, you are welcome to support our GoFundMe campaign to finance Rubberduck swag and international shipping - contributors will be getting t-shirts, mugs, and other cool things.
67
78
[![GoFundMe campaign](https://user-images.githubusercontent.com/5751684/29191799-e3d20b72-7dec-11e7-8ec6-0c69da4a3135.png)](https://www.gofundme.com/rubberduckvba)
9+
-->
810

911
Branch | Description | Build Status |
1012
|------------|---|--------------|

RetailCoder.VBE/API/VBA/Declaration.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ internal Declaration(RubberduckDeclaration declaration)
5656
{ Parsing.Symbols.DeclarationType.Control, DeclarationType.Control },
5757
{ Parsing.Symbols.DeclarationType.UserForm, DeclarationType.UserForm },
5858
{ Parsing.Symbols.DeclarationType.Document, DeclarationType.Document },
59-
{ Parsing.Symbols.DeclarationType.ModuleOption, DeclarationType.ModuleOption },
6059
{ Parsing.Symbols.DeclarationType.Procedure, DeclarationType.Procedure },
6160
{ Parsing.Symbols.DeclarationType.Function, DeclarationType.Function },
6261
{ Parsing.Symbols.DeclarationType.PropertyGet, DeclarationType.PropertyGet },

RetailCoder.VBE/API/VBA/DeclarationType.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public enum DeclarationType
1212
Control, //= 1 << 3,
1313
UserForm,// = 1 << 4,
1414
Document,// = 1 << 5,
15-
ModuleOption,// = 1 << 6,
1615
Procedure, //= 1 << 8,
1716
Function,// = 1 << 9,
1817
PropertyGet,// = 1 << 11,

RetailCoder.VBE/Navigation/CodeExplorer/CodeExplorerItemViewModel.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,17 @@ public bool IsExpanded
190190

191191
public bool IsSelected { get; set; }
192192

193+
private bool _isVisisble = true;
194+
public bool IsVisible
195+
{
196+
get { return _isVisisble; }
197+
set
198+
{
199+
_isVisisble = value;
200+
OnPropertyChanged();
201+
}
202+
}
203+
193204
public abstract string Name { get; }
194205
public abstract string NameWithSignature { get; }
195206
public abstract BitmapImage CollapsedIcon { get; }

RetailCoder.VBE/Navigation/CodeExplorer/CodeExplorerViewModel.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ public CodeExplorerViewModel(FolderHelper folderHelper, RubberduckParserState st
6464
OpenDesignerCommand = commands.OfType<OpenDesignerCommand>().SingleOrDefault();
6565

6666
AddTestModuleCommand = commands.OfType<UI.CodeExplorer.Commands.AddTestModuleCommand>().SingleOrDefault();
67+
AddTestModuleWithStubsCommand = commands.OfType<AddTestModuleWithStubsCommand>().SingleOrDefault();
68+
6769
AddStdModuleCommand = commands.OfType<AddStdModuleCommand>().SingleOrDefault();
6870
AddClassModuleCommand = commands.OfType<AddClassModuleCommand>().SingleOrDefault();
6971
AddUserFormCommand = commands.OfType<AddUserFormCommand>().SingleOrDefault();
@@ -491,6 +493,7 @@ private void SwitchNodeState(CodeExplorerItemViewModel node, bool expandedState)
491493
public CommandBase OpenCommand { get; }
492494

493495
public CommandBase AddTestModuleCommand { get; }
496+
public CommandBase AddTestModuleWithStubsCommand { get; }
494497
public CommandBase AddStdModuleCommand { get; }
495498
public CommandBase AddClassModuleCommand { get; }
496499
public CommandBase AddUserFormCommand { get; }
@@ -574,6 +577,23 @@ public Visibility EmptyUIRefreshMessageVisibility
574577
}
575578
}
576579

580+
public void FilterByName(IEnumerable<CodeExplorerItemViewModel> nodes, string searchString)
581+
{
582+
foreach (var item in nodes)
583+
{
584+
if (item == null) { continue; }
585+
586+
if (item.Items.Any())
587+
{
588+
FilterByName(item.Items, searchString);
589+
}
590+
591+
item.IsVisible = item.Items.Any(c => c.IsVisible) ||
592+
item.Name.ToLowerInvariant().Contains(searchString.ToLowerInvariant()) ||
593+
string.IsNullOrEmpty(searchString);
594+
}
595+
}
596+
577597
public void Dispose()
578598
{
579599
if (_state != null)

RetailCoder.VBE/Refactorings/Rename/RenameModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public RenameModel(IVBE vbe, RubberduckParserState state, QualifiedSelection sel
4040
private void AcquireTarget(out Declaration target, QualifiedSelection selection)
4141
{
4242
target = _declarations
43-
.Where(item => item.IsUserDefined && item.DeclarationType != DeclarationType.ModuleOption)
43+
.Where(item => item.IsUserDefined)
4444
.FirstOrDefault(item => item.IsSelected(selection) || item.References.Any(r => r.IsSelected(selection)));
4545
}
4646
}
586 Bytes
Loading

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
<NoWarn>1591</NoWarn>
3030
<PlatformTarget>AnyCPU</PlatformTarget>
3131
<UseVSHostingProcess>true</UseVSHostingProcess>
32+
<LangVersion>7.1</LangVersion>
3233
</PropertyGroup>
3334
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
3435
<DebugType>full</DebugType>
@@ -41,6 +42,7 @@
4142
<DocumentationFile>bin\Release\Rubberduck.XML</DocumentationFile>
4243
<DebugSymbols>true</DebugSymbols>
4344
<NoWarn>1591</NoWarn>
45+
<LangVersion>7.1</LangVersion>
4446
</PropertyGroup>
4547
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'DebugAccess|AnyCPU'">
4648
<DebugSymbols>true</DebugSymbols>
@@ -54,6 +56,7 @@
5456
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
5557
<WarningLevel>4</WarningLevel>
5658
<Optimize>false</Optimize>
59+
<LangVersion>7.1</LangVersion>
5760
</PropertyGroup>
5861
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
5962
<DebugSymbols>true</DebugSymbols>
@@ -151,6 +154,7 @@
151154
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
152155
<WarningLevel>4</WarningLevel>
153156
<Optimize>false</Optimize>
157+
<LangVersion>7.1</LangVersion>
154158
</PropertyGroup>
155159
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug64|x64'">
156160
<DebugSymbols>true</DebugSymbols>
@@ -191,6 +195,7 @@
191195
<ErrorReport>prompt</ErrorReport>
192196
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
193197
<WarningLevel>4</WarningLevel>
198+
<LangVersion>7.1</LangVersion>
194199
</PropertyGroup>
195200
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release64|x64'">
196201
<DebugSymbols>true</DebugSymbols>
@@ -395,10 +400,13 @@
395400
<Compile Include="UI\About\AboutDialog.Designer.cs">
396401
<DependentUpon>AboutDialog.cs</DependentUpon>
397402
</Compile>
403+
<Compile Include="UI\CodeExplorer\Commands\AddTestModuleWithStubsCommand.cs" />
398404
<Compile Include="UI\CodeExplorer\Commands\CodeExplorerCommandAttribute.cs" />
399405
<Compile Include="UI\CodeExplorer\Commands\CommitCommand.cs" />
400406
<Compile Include="UI\CodeExplorer\Commands\AddUserFormCommand.cs" />
401407
<Compile Include="UI\CodeExplorer\Commands\CopyResultsCommand.cs" />
408+
<Compile Include="UI\CodeExplorer\Converters\StringHasNoValueToVisibilityConverter.cs" />
409+
<Compile Include="UI\CodeExplorer\Converters\StringHasValueToVisibilityConverter.cs" />
402410
<Compile Include="UI\Command\ExportAllCommand.cs" />
403411
<Compile Include="UI\CodeExplorer\Commands\OpenProjectPropertiesCommand.cs" />
404412
<Compile Include="UI\CodeExplorer\Commands\RenameCommand.cs" />
@@ -1285,6 +1293,7 @@
12851293
<Resource Include="Resources\folder-open.png" />
12861294
<Resource Include="Resources\folder.png" />
12871295
<None Include="Resources\RD-300x250-base.png" />
1296+
<Resource Include="Resources\magnifier-medium.png" />
12881297
<Content Include="Resources\Rubberduck\RD-AboutWindow.png" />
12891298
<Content Include="Resources\Rubberduck\RD-InstallBanner.bmp" />
12901299
<Content Include="Resources\Rubberduck\RD-InstallWindow.bmp" />

RetailCoder.VBE/Settings/CodeInspectionSettings.cs

Lines changed: 13 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,16 @@ public CodeInspectionSetting GetSetting<TInspection>() where TInspection : IInsp
4343
?? GetSetting(typeof(TInspection));
4444
}
4545

46-
public CodeInspectionSetting GetSetting(Type inspection)
46+
public CodeInspectionSetting GetSetting(Type inspectionType)
4747
{
4848
try
4949
{
50-
var proto = Convert.ChangeType(Activator.CreateInstance(inspection), inspection);
51-
var existing = CodeInspections.FirstOrDefault(s => proto.GetType().ToString().Equals(s.Name));
52-
if (existing != null) return existing;
50+
var existing = CodeInspections.FirstOrDefault(s => inspectionType.ToString().Equals(s.Name));
51+
if (existing != null)
52+
{
53+
return existing;
54+
}
55+
var proto = Convert.ChangeType(Activator.CreateInstance(inspectionType), inspectionType);
5356
var setting = new CodeInspectionSetting(proto as IInspectionModel);
5457
CodeInspections.Add(setting);
5558
return setting;
@@ -80,37 +83,15 @@ public class CodeInspectionSetting : IInspectionModel
8083
[XmlIgnore]
8184
public string Description
8285
{
83-
get
84-
{
85-
if (_description == null)
86-
{
87-
_description = InspectionsUI.ResourceManager.GetString(Name + "Name");
88-
}
89-
return _description;
90-
}
91-
set
92-
{
93-
_description = value;
94-
}
86+
get => _description ?? (_description = InspectionsUI.ResourceManager.GetString(Name + "Name"));
87+
set => _description = value;
9588
}// not serialized because culture-dependent
9689

9790
[XmlIgnore]
98-
public string LocalizedName
99-
{
100-
get
101-
{
102-
return InspectionsUI.ResourceManager.GetString(Name + "Name", CultureInfo.CurrentUICulture);
103-
}
104-
} // not serialized because culture-dependent
91+
public string LocalizedName => InspectionsUI.ResourceManager.GetString(Name + "Name", CultureInfo.CurrentUICulture); // not serialized because culture-dependent
10592

10693
[XmlIgnore]
107-
public string AnnotationName
108-
{
109-
get
110-
{
111-
return Name.Replace("Inspection", string.Empty);
112-
}
113-
}
94+
public string AnnotationName => Name.Replace("Inspection", string.Empty);
11495

11596
[XmlIgnore]
11697
public CodeInspectionSeverity DefaultSeverity { get; private set; }
@@ -119,13 +100,7 @@ public string AnnotationName
119100
public CodeInspectionSeverity Severity { get; set; }
120101

121102
[XmlIgnore]
122-
public string Meta
123-
{
124-
get
125-
{
126-
return InspectionsUI.ResourceManager.GetString(Name + "Meta", CultureInfo.CurrentUICulture);
127-
}
128-
}
103+
public string Meta => InspectionsUI.ResourceManager.GetString(Name + "Meta", CultureInfo.CurrentUICulture);
129104

130105
[XmlIgnore]
131106
// ReSharper disable once UnusedMember.Global; used in string literal to define collection groupings
@@ -134,7 +109,7 @@ public string Meta
134109
[XmlIgnore]
135110
public string SeverityLabel
136111
{
137-
get { return InspectionsUI.ResourceManager.GetString("CodeInspectionSeverity_" + Severity, CultureInfo.CurrentUICulture); }
112+
get => InspectionsUI.ResourceManager.GetString("CodeInspectionSeverity_" + Severity, CultureInfo.CurrentUICulture);
138113
set
139114
{
140115
foreach (var severity in Enum.GetValues(typeof(CodeInspectionSeverity)))

0 commit comments

Comments
 (0)