Skip to content

Commit e7b5779

Browse files
committed
Merge remote-tracking branch 'upstream/next' into rkapka-master
2 parents d000f3e + 7ddc4ab commit e7b5779

37 files changed

+634
-200
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: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,23 @@ public Visibility EmptyUIRefreshMessageVisibility
577577
}
578578
}
579579

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+
580597
public void Dispose()
581598
{
582599
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/Root/RubberduckModule.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,8 @@ private IEnumerable<IMenuItem> GetFormDesignerContextMenuItems()
613613
{
614614
return new IMenuItem[]
615615
{
616-
KernelInstance.Get<FormDesignerRefactorRenameCommandMenuItem>()
616+
KernelInstance.Get<FormDesignerRefactorRenameCommandMenuItem>(),
617+
KernelInstance.Get<FormDesignerFindAllReferencesCommandMenuItem>()
617618
};
618619
}
619620

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,8 @@
405405
<Compile Include="UI\CodeExplorer\Commands\CommitCommand.cs" />
406406
<Compile Include="UI\CodeExplorer\Commands\AddUserFormCommand.cs" />
407407
<Compile Include="UI\CodeExplorer\Commands\CopyResultsCommand.cs" />
408+
<Compile Include="UI\CodeExplorer\Converters\StringHasNoValueToVisibilityConverter.cs" />
409+
<Compile Include="UI\CodeExplorer\Converters\StringHasValueToVisibilityConverter.cs" />
408410
<Compile Include="UI\Command\ExportAllCommand.cs" />
409411
<Compile Include="UI\CodeExplorer\Commands\OpenProjectPropertiesCommand.cs" />
410412
<Compile Include="UI\CodeExplorer\Commands\RenameCommand.cs" />
@@ -421,8 +423,10 @@
421423
<Compile Include="UI\CodeExplorer\Commands\AddStdModuleCommand.cs" />
422424
<Compile Include="UI\CodeExplorer\Commands\AddTestModuleCommand.cs" />
423425
<Compile Include="UI\CodeExplorer\Commands\AddComponentCommand.cs" />
426+
<Compile Include="UI\Command\FormDesignerFindAllReferencesCommand.cs" />
424427
<Compile Include="UI\Command\IndentCurrentProjectCommand.cs" />
425428
<Compile Include="UI\Command\MenuItems\CommandBars\ContextDescriptionLabelMenuItem.cs" />
429+
<Compile Include="UI\Command\MenuItems\FormDesignerFindAllReferencesCommandMenuItem.cs" />
426430
<Compile Include="UI\Command\MenuItems\IndentCurrentProjectCommandMenuItem.cs" />
427431
<Compile Include="UI\Command\MenuItems\ExportAllCommandMenuItem.cs" />
428432
<Compile Include="UI\Controls\EmptyUIRefresh.xaml.cs">
@@ -1289,6 +1293,7 @@
12891293
<Resource Include="Resources\folder-open.png" />
12901294
<Resource Include="Resources\folder.png" />
12911295
<None Include="Resources\RD-300x250-base.png" />
1296+
<Resource Include="Resources\magnifier-medium.png" />
12921297
<Content Include="Resources\Rubberduck\RD-AboutWindow.png" />
12931298
<Content Include="Resources\Rubberduck\RD-InstallBanner.bmp" />
12941299
<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)