Skip to content

Commit 8721c6c

Browse files
committed
fixes keyhook/RTrim issue (#1665)
* added AsTypeName to the context-sensitive commandbar * clear built-in references at every resolution; fixed issue with null parse trees, given built-in modules get a module state instance. * fixed OverflowException in GetTypeName; built-in parameters now have return type info :) * returning built-in members now have return type info as well * removed hard-coded defaults in ClassModuleDeclaration * added IsBadReadPtr check in COM declarations collector * Implemented CanExecute in Project Explorer rename command * cleaned up FormDesignerRefactorRename command * fixed IOExceptions in QualifiedModuleName * use filename, not buildfilename * GetDisplayName being the part in parens, should be null when not applicable; made it private * renamed namespace Rubberduck.UI.CodeInspections to Rubberduck.UI.Inspections for consistency with Rubberduck.Inspections namespace * changed background color of bottom panel in CodeExplorer and InspectionResults toolwindows * fixed broken keybinding "Esc" -> "Escape" * added copy/export button to SearchView (todo: implement ExecuteCopyResultsCommand) * Revert "added copy/export button to SearchView (todo: implement ExecuteCopyResultsCommand)" This reverts commit e9946b7. * assert ProjectId isn't null * fixes #1664
1 parent 90b8a86 commit 8721c6c

19 files changed

+47
-32
lines changed

RetailCoder.VBE/App.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
using Rubberduck.UI.Command.MenuItems;
1313
using System;
1414
using System.Collections.Generic;
15+
using System.Diagnostics;
1516
using System.Globalization;
1617
using System.Linq;
1718
using System.Runtime.InteropServices.ComTypes;
@@ -174,6 +175,8 @@ async void sink_ProjectRemoved(object sender, DispatcherEventArgs<VBProject> e)
174175
}
175176

176177
var projectId = e.Item.HelpFile;
178+
Debug.Assert(projectId != null);
179+
177180
_componentsEventsSinks.Remove(projectId);
178181
_referencesEventsSinks.Remove(projectId);
179182
_parser.State.RemoveProject(e.Item);

RetailCoder.VBE/Common/RubberduckHooks.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Diagnostics;
55
using System.Linq;
66
using System.Runtime.InteropServices;
7+
using System.Windows.Forms;
78
using System.Windows.Input;
89
using Microsoft.Vbe.Interop;
910
using Rubberduck.Common.Hotkeys;
@@ -106,9 +107,16 @@ private void Mouse_RawMouseInputReceived(object sender, RawMouseEventArgs e)
106107
}
107108
}
108109

110+
// keys that change the current selection.
111+
private static readonly HashSet<Keys> NavKeys = new HashSet<Keys>
112+
{
113+
Keys.Up, Keys.Down, Keys.Left, Keys.Right, Keys.PageDown, Keys.PageUp, Keys.Enter
114+
};
115+
109116
private void Keyboard_RawKeyboardInputReceived(object sender, RawKeyEventArgs e)
110117
{
111-
if (e.Message == WM.KEYUP)
118+
// note: handling *all* keys causes annoying RTrim of current line, making editing code a PITA.
119+
if (e.Message == WM.KEYUP && NavKeys.Contains((Keys)e.VKey))
112120
{
113121
OnMessageReceived(this, HookEventArgs.Empty);
114122
}

RetailCoder.VBE/Root/RubberduckModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
using Rubberduck.SourceControl;
2222
using Rubberduck.UI;
2323
using Rubberduck.UI.CodeExplorer;
24-
using Rubberduck.UI.CodeInspections;
24+
using Rubberduck.UI.Inspections;
2525
using Rubberduck.UI.Command;
2626
using Rubberduck.UI.Command.MenuItems;
2727
using Rubberduck.UI.Command.MenuItems.ParentMenus;

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -567,13 +567,13 @@
567567
<Compile Include="Navigation\CodeExplorer\CodeExplorerMemberViewModel.cs" />
568568
<Compile Include="Navigation\CodeExplorer\CodeExplorerProjectViewModel.cs" />
569569
<Compile Include="Navigation\CodeExplorer\CodeExplorerViewModel.cs" />
570-
<Compile Include="UI\CodeInspections\InspectionDescriptionConverter.cs" />
571-
<Compile Include="UI\CodeInspections\InspectionImageSourceConverter.cs" />
572-
<Compile Include="UI\CodeInspections\InspectionResultsControl.xaml.cs">
570+
<Compile Include="UI\Inspections\InspectionDescriptionConverter.cs" />
571+
<Compile Include="UI\Inspections\InspectionImageSourceConverter.cs" />
572+
<Compile Include="UI\Inspections\InspectionResultsControl.xaml.cs">
573573
<DependentUpon>InspectionResultsControl.xaml</DependentUpon>
574574
</Compile>
575-
<Compile Include="UI\CodeInspections\InspectionResultsViewModel.cs" />
576-
<Compile Include="UI\CodeInspections\InspectionSeverityImageSourceConverter.cs" />
575+
<Compile Include="UI\Inspections\InspectionResultsViewModel.cs" />
576+
<Compile Include="UI\Inspections\InspectionSeverityImageSourceConverter.cs" />
577577
<Compile Include="UI\Command\AboutCommand.cs" />
578578
<Compile Include="UI\Command\AddTestMethodExpectedErrorCommand.cs" />
579579
<Compile Include="UI\Command\AddTestMethodCommand.cs" />
@@ -880,15 +880,15 @@
880880
<Compile Include="UI\CodeExplorer\CodeExplorerWindow.Designer.cs">
881881
<DependentUpon>CodeExplorerWindow.cs</DependentUpon>
882882
</Compile>
883-
<Compile Include="UI\CodeInspections\CodeInspectionsDockablePresenter.cs" />
884-
<Compile Include="UI\CodeInspections\CodeInspectionsWindow.cs">
883+
<Compile Include="UI\Inspections\CodeInspectionsDockablePresenter.cs" />
884+
<Compile Include="UI\Inspections\CodeInspectionsWindow.cs">
885885
<SubType>UserControl</SubType>
886886
</Compile>
887-
<Compile Include="UI\CodeInspections\CodeInspectionsWindow.Designer.cs">
887+
<Compile Include="UI\Inspections\CodeInspectionsWindow.Designer.cs">
888888
<DependentUpon>CodeInspectionsWindow.cs</DependentUpon>
889889
</Compile>
890890
<Compile Include="UI\NavigateCodeEventArgs.cs" />
891-
<Compile Include="UI\CodeInspections\QuickFixEventArgs.cs" />
891+
<Compile Include="UI\Inspections\QuickFixEventArgs.cs" />
892892
<Compile Include="UI\DockableToolwindowPresenter.cs" />
893893
<Compile Include="Settings\Configuration.cs" />
894894
<Compile Include="Settings\ToDoListSettings.cs" />
@@ -992,7 +992,7 @@
992992
<SubType>Designer</SubType>
993993
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
994994
</EmbeddedResource>
995-
<EmbeddedResource Include="UI\CodeInspections\CodeInspectionsWindow.resx">
995+
<EmbeddedResource Include="UI\Inspections\CodeInspectionsWindow.resx">
996996
<DependentUpon>CodeInspectionsWindow.cs</DependentUpon>
997997
</EmbeddedResource>
998998
<EmbeddedResource Include="UI\Controls\SearchResultWindow.resx">
@@ -1484,7 +1484,7 @@
14841484
<Generator>MSBuild:Compile</Generator>
14851485
<SubType>Designer</SubType>
14861486
</Page>
1487-
<Page Include="UI\CodeInspections\InspectionResultsControl.xaml">
1487+
<Page Include="UI\Inspections\InspectionResultsControl.xaml">
14881488
<SubType>Designer</SubType>
14891489
<Generator>MSBuild:Compile</Generator>
14901490
</Page>

RetailCoder.VBE/UI/CodeExplorer/CodeExplorerControl.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@
714714
</ToolBar>
715715
</ToolBarTray>
716716

717-
<TreeView Grid.Row="1"
717+
<TreeView Grid.Row="1" Background="White"
718718
ItemContainerStyle="{StaticResource ShinyTreeView}"
719719
HorizontalContentAlignment="Stretch"
720720
MouseDoubleClick="TreeView_OnMouseDoubleClick"
@@ -730,7 +730,7 @@
730730

731731
<Border Grid.Row="3" BorderThickness="0,1,0,0" BorderBrush="DimGray">
732732

733-
<StackPanel Orientation="Vertical" MinHeight="48" Background="Gainsboro">
733+
<StackPanel Orientation="Vertical" MinHeight="48" Background="WhiteSmoke">
734734

735735
<Grid Margin="4" HorizontalAlignment="Stretch">
736736
<Grid.ColumnDefinitions>

RetailCoder.VBE/UI/CodeInspections/CodeInspectionsDockablePresenter.cs renamed to RetailCoder.VBE/UI/Inspections/CodeInspectionsDockablePresenter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using Microsoft.Vbe.Interop;
22

3-
namespace Rubberduck.UI.CodeInspections
3+
namespace Rubberduck.UI.Inspections
44
{
55
public class CodeInspectionsDockablePresenter : DockableToolwindowPresenter
66
{

RetailCoder.VBE/UI/CodeInspections/CodeInspectionsWindow.Designer.cs renamed to RetailCoder.VBE/UI/Inspections/CodeInspectionsWindow.Designer.cs

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

RetailCoder.VBE/UI/CodeInspections/CodeInspectionsWindow.cs renamed to RetailCoder.VBE/UI/Inspections/CodeInspectionsWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using System.Windows.Forms;
22

3-
namespace Rubberduck.UI.CodeInspections
3+
namespace Rubberduck.UI.Inspections
44
{
55
public partial class CodeInspectionsWindow : UserControl, IDockableUserControl
66
{

RetailCoder.VBE/UI/CodeInspections/InspectionDescriptionConverter.cs renamed to RetailCoder.VBE/UI/Inspections/InspectionDescriptionConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
using System.Windows.Data;
44
using Rubberduck.Inspections;
55

6-
namespace Rubberduck.UI.CodeInspections
6+
namespace Rubberduck.UI.Inspections
77
{
88
public class InspectionTypeConverter : IValueConverter
99
{

0 commit comments

Comments
 (0)