Skip to content

Commit d37b99b

Browse files
authored
Merge branch 'next' into quickFixes
2 parents 75c4622 + 0dfdcb9 commit d37b99b

File tree

64 files changed

+7409
-1399
lines changed

Some content is hidden

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

64 files changed

+7409
-1399
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*.user
77
*.sln.docstates
88
*.csproj.user
9+
*.csproj.DotSettings
910

1011
# External NuGet Packages
1112
[Pp]ackages/

.nuget/NuGet.exe

2.8 MB
Binary file not shown.

RetailCoder.VBE/Navigation/CodeExplorer/CodeExplorerItemViewModel.cs

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ public class CompareByType : Comparer<CodeExplorerItemViewModel>
3131
{
3232
private static readonly Dictionary<DeclarationType, int> SortOrder = new Dictionary<DeclarationType, int>
3333
{
34-
// Some DeclarationTypes we want to treat the same, like Subs and Functions.
34+
// Some DeclarationTypes we want to treat the same, like Subs and Functions,
35+
// or Property Gets, Lets, and Sets.
3536
// Give them the same number.
3637
{DeclarationType.LibraryFunction, 0},
3738
{DeclarationType.LibraryProcedure, 0},
@@ -41,10 +42,10 @@ public class CompareByType : Comparer<CodeExplorerItemViewModel>
4142
{DeclarationType.Constant, 4},
4243
{DeclarationType.Variable, 5},
4344
{DeclarationType.PropertyGet, 6},
44-
{DeclarationType.PropertyLet, 7},
45-
{DeclarationType.PropertySet, 8},
46-
{DeclarationType.Function, 9},
47-
{DeclarationType.Procedure, 9}
45+
{DeclarationType.PropertyLet, 6},
46+
{DeclarationType.PropertySet, 6},
47+
{DeclarationType.Function, 7},
48+
{DeclarationType.Procedure, 7}
4849
};
4950

5051
public override int Compare(CodeExplorerItemViewModel x, CodeExplorerItemViewModel y)
@@ -83,7 +84,7 @@ public override int Compare(CodeExplorerItemViewModel x, CodeExplorerItemViewMod
8384

8485
if (xNodeAcc != yNodeAcc)
8586
{
86-
return xNodeAcc < yNodeAcc ? -1 : 1;
87+
return xNodeAcc > yNodeAcc ? -1 : 1;
8788
}
8889

8990
if (x.ExpandedIcon != y.ExpandedIcon)
@@ -227,9 +228,9 @@ public void AddChild(CodeExplorerItemViewModel item)
227228
_items.Add(item);
228229
}
229230

230-
public void ReorderItems(bool sortByName, bool sortByType)
231+
public void ReorderItems(bool sortByName, bool groupByType)
231232
{
232-
if (sortByType)
233+
if (groupByType)
233234
{
234235
Items = sortByName
235236
? Items.OrderBy(o => o, new CompareByType()).ThenBy(t => t, new CompareByName()).ToList()

RetailCoder.VBE/Navigation/CodeExplorer/CodeExplorerViewModel.cs

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,26 @@ public CodeExplorerViewModel(FolderHelper folderHelper, RubberduckParserState st
9797

9898
SetNameSortCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), param =>
9999
{
100-
SortByName = (bool)param;
101-
SortBySelection = !(bool)param;
100+
if ((bool)param == true)
101+
{
102+
SortByName = (bool)param;
103+
SortByCodeOrder = !(bool)param;
104+
}
105+
}, param =>
106+
{
107+
return SortByName ? false : true;
102108
});
103109

104-
SetSelectionSortCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), param =>
110+
SetCodeOrderSortCommand = new DelegateCommand(LogManager.GetCurrentClassLogger(), param =>
111+
{
112+
if ((bool)param == true)
113+
{
114+
SortByCodeOrder = (bool)param;
115+
SortByName = !(bool)param;
116+
};
117+
}, param =>
105118
{
106-
SortBySelection = (bool)param;
107-
SortByName = !(bool)param;
119+
return SortByCodeOrder ? false : true;
108120
});
109121
}
110122

@@ -141,28 +153,30 @@ public bool SortByName
141153
}
142154

143155
_windowSettings.CodeExplorer_SortByName = value;
144-
_windowSettings.CodeExplorer_SortByLocation = !value;
156+
_windowSettings.CodeExplorer_SortByCodeOrder = !value;
145157
_windowSettingsProvider.Save(_windowSettings);
146158
OnPropertyChanged();
159+
OnPropertyChanged("SortByCodeOrder");
147160

148161
ReorderChildNodes(Projects);
149162
}
150163
}
151164

152-
public bool SortBySelection
165+
public bool SortByCodeOrder
153166
{
154-
get { return _windowSettings.CodeExplorer_SortByLocation; }
167+
get { return _windowSettings.CodeExplorer_SortByCodeOrder; }
155168
set
156169
{
157-
if (_windowSettings.CodeExplorer_SortByLocation == value)
170+
if (_windowSettings.CodeExplorer_SortByCodeOrder == value)
158171
{
159172
return;
160173
}
161174

162-
_windowSettings.CodeExplorer_SortByLocation = value;
175+
_windowSettings.CodeExplorer_SortByCodeOrder = value;
163176
_windowSettings.CodeExplorer_SortByName = !value;
164177
_windowSettingsProvider.Save(_windowSettings);
165178
OnPropertyChanged();
179+
OnPropertyChanged("SortByName");
166180

167181
ReorderChildNodes(Projects);
168182
}
@@ -172,9 +186,9 @@ public bool SortBySelection
172186

173187
public CommandBase SetNameSortCommand { get; }
174188

175-
public CommandBase SetSelectionSortCommand { get; }
189+
public CommandBase SetCodeOrderSortCommand { get; }
176190

177-
public bool SortByType
191+
public bool GroupByType
178192
{
179193
get { return _windowSettings.CodeExplorer_GroupByType; }
180194
set
@@ -200,7 +214,7 @@ public bool IsBusy
200214
_isBusy = value;
201215
OnPropertyChanged();
202216
// If the window is "busy" then hide the Refresh message
203-
OnPropertyChanged("EmptyTreeMessageVisibility");
217+
OnPropertyChanged("EmptyUIRefreshMessageVisibility");
204218
}
205219
}
206220

@@ -414,7 +428,7 @@ private void ReorderChildNodes(IEnumerable<CodeExplorerItemViewModel> nodes)
414428
{
415429
foreach (var node in nodes)
416430
{
417-
node.ReorderItems(SortByName, SortByType);
431+
node.ReorderItems(SortByName, GroupByType);
418432
ReorderChildNodes(node.Items);
419433
}
420434
}
@@ -552,7 +566,7 @@ public Visibility TreeViewVisibility
552566
}
553567
}
554568

555-
public Visibility EmptyTreeMessageVisibility
569+
public Visibility EmptyUIRefreshMessageVisibility
556570
{
557571
get
558572
{

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,9 @@
301301
<Reference Include="System.Printing" />
302302
<Reference Include="System.Runtime.Remoting" />
303303
<Reference Include="System.Runtime.Serialization" />
304+
<Reference Include="System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
305+
<HintPath>..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll</HintPath>
306+
</Reference>
304307
<Reference Include="System.Windows.Forms" />
305308
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
306309
<HintPath>..\packages\System.Windows.Interactivity.WPF.2.0.20525\lib\net40\System.Windows.Interactivity.dll</HintPath>
@@ -421,6 +424,9 @@
421424
<Compile Include="UI\Command\MenuItems\CommandBars\ContextDescriptionLabelMenuItem.cs" />
422425
<Compile Include="UI\Command\MenuItems\IndentCurrentProjectCommandMenuItem.cs" />
423426
<Compile Include="UI\Command\MenuItems\ExportAllCommandMenuItem.cs" />
427+
<Compile Include="UI\Controls\EmptyUIRefresh.xaml.cs">
428+
<DependentUpon>EmptyUIRefresh.xaml</DependentUpon>
429+
</Compile>
424430
<Compile Include="UI\EnvironmentProvider.cs" />
425431
<Compile Include="UI\Inspections\AggregateInspectionResult.cs" />
426432
<Compile Include="UI\ModernFolderBrowser.cs" />
@@ -1381,6 +1387,10 @@
13811387
<Generator>MSBuild:Compile</Generator>
13821388
<SubType>Designer</SubType>
13831389
</Page>
1390+
<Page Include="UI\Controls\EmptyUIRefresh.xaml">
1391+
<SubType>Designer</SubType>
1392+
<Generator>MSBuild:Compile</Generator>
1393+
</Page>
13841394
<Page Include="UI\Inspections\InspectionResultsControl.xaml">
13851395
<SubType>Designer</SubType>
13861396
<Generator>MSBuild:Compile</Generator>
@@ -1393,6 +1403,10 @@
13931403
<SubType>Designer</SubType>
13941404
<Generator>MSBuild:Compile</Generator>
13951405
</Page>
1406+
<Page Include="UI\Controls\ToolBar.xaml">
1407+
<SubType>Designer</SubType>
1408+
<Generator>MSBuild:Compile</Generator>
1409+
</Page>
13961410
<Page Include="UI\Refactorings\EncapsulateField\EncapsulateFieldView.xaml">
13971411
<SubType>Designer</SubType>
13981412
<Generator>MSBuild:Compile</Generator>
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
2-
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp60</s:String>
2+
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp70</s:String>
33
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=ui_005Crefactorings_005Cextractinterface/@EntryIndexedValue">True</s:Boolean>
44
<s:Boolean x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=unittesting_005Cstubs/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>

RetailCoder.VBE/Settings/WindowSettings.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public interface IWindowSettings
1818
bool TodoExplorerVisibleOnStartup { get; set; }
1919

2020
bool CodeExplorer_SortByName { get; set; }
21-
bool CodeExplorer_SortByLocation { get; set; }
21+
bool CodeExplorer_SortByCodeOrder { get; set; }
2222
bool CodeExplorer_GroupByType { get; set; }
2323

2424
bool IsWindowVisible(DockableToolwindowPresenter candidate);
@@ -34,7 +34,9 @@ public WindowSettings()
3434
//empty constructor needed for serialization
3535
}
3636

37-
public WindowSettings(bool codeExplorerVisibleOnStartup, bool codeInspectionsVisibleOnStartup, bool sourceControlVisibleOnStartup, bool testExplorerVisibleOnStartup, bool todoExplorerVisibleOnStartup, bool codeExplorer_SortByName, bool codeExplorer_SortByLocation, bool codeExplorer_GroupByType)
37+
public WindowSettings(bool codeExplorerVisibleOnStartup, bool codeInspectionsVisibleOnStartup,
38+
bool sourceControlVisibleOnStartup, bool testExplorerVisibleOnStartup, bool todoExplorerVisibleOnStartup,
39+
bool codeExplorer_SortByName, bool codeExplorer_SortByCodeOrder, bool codeExplorer_GroupByType)
3840
{
3941
CodeExplorerVisibleOnStartup = codeExplorerVisibleOnStartup;
4042
CodeInspectionsVisibleOnStartup = codeInspectionsVisibleOnStartup;
@@ -43,7 +45,7 @@ public WindowSettings(bool codeExplorerVisibleOnStartup, bool codeInspectionsVis
4345
TodoExplorerVisibleOnStartup = todoExplorerVisibleOnStartup;
4446

4547
CodeExplorer_SortByName = codeExplorer_SortByName;
46-
CodeExplorer_SortByLocation = codeExplorer_SortByLocation;
48+
CodeExplorer_SortByCodeOrder = codeExplorer_SortByCodeOrder;
4749
CodeExplorer_GroupByType = codeExplorer_GroupByType;
4850
}
4951

@@ -54,7 +56,7 @@ public WindowSettings(bool codeExplorerVisibleOnStartup, bool codeInspectionsVis
5456
public bool TodoExplorerVisibleOnStartup { get; set; }
5557

5658
public bool CodeExplorer_SortByName { get; set; }
57-
public bool CodeExplorer_SortByLocation { get; set; }
59+
public bool CodeExplorer_SortByCodeOrder { get; set; }
5860
public bool CodeExplorer_GroupByType { get; set; }
5961

6062
public bool IsWindowVisible(DockableToolwindowPresenter candidate)
@@ -94,7 +96,7 @@ public bool Equals(WindowSettings other)
9496
TestExplorerVisibleOnStartup == other.TestExplorerVisibleOnStartup &&
9597
TodoExplorerVisibleOnStartup == other.TodoExplorerVisibleOnStartup &&
9698
CodeExplorer_SortByName == other.CodeExplorer_SortByName &&
97-
CodeExplorer_SortByLocation == other.CodeExplorer_SortByLocation &&
99+
CodeExplorer_SortByCodeOrder == other.CodeExplorer_SortByCodeOrder &&
98100
CodeExplorer_GroupByType == other.CodeExplorer_GroupByType;
99101
}
100102
}

0 commit comments

Comments
 (0)