Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
26c5768
add simple name expression resolution (default binding context) + cle…
Apr 30, 2016
6192034
add tests for precedence
Apr 30, 2016
29ddebc
implement member access expression default binding context + type ann…
Apr 30, 2016
2681a45
add function/procedure/property declarations + link parameters with t…
Apr 30, 2016
81b4b1b
implement index expressions in default binding context
Apr 30, 2016
4ab1957
implement dictionary access expressions
Apr 30, 2016
c0d2294
implement with expression binding resolution
Apr 30, 2016
facce6b
add all other expression binding resolutions + allow expressions in w…
May 1, 2016
ffa0076
switch to new binding mechanism for while,for,do,if and select statem…
May 1, 2016
29966b9
Merge branch 'next' of https://github.com/rubberduck-vba/Rubberduck i…
May 1, 2016
ffc8e35
fix if-stmt/select-stmt parse trees by restricting identifier in cert…
May 1, 2016
bc5b7d5
resolve all statements, labels and events
May 1, 2016
0d75ecf
lots of fixes (call stmt now works now, get/set/let disambiguation as…
May 4, 2016
664989e
small fixes
May 4, 2016
913371f
merge next
May 4, 2016
66aced5
implement named argument resolution
May 4, 2016
a75d6b8
Code Explorer prints.
Hosch250 May 5, 2016
5d77fc3
Import works
Hosch250 May 5, 2016
eba9fb9
translation: added one new German phrase
INOPIAE May 5, 2016
856d326
fix NRE
May 5, 2016
48a721c
remove test, that should actually resolve successfully
May 5, 2016
a363a0c
Merge branch 'next' of https://github.com/rubberduck-vba/Rubberduck i…
May 5, 2016
b6d3725
add support for default instance variable class modules
May 5, 2016
e57532e
fix NRE
May 5, 2016
c4ad646
fix resolver performance issues
May 5, 2016
7c60e62
Fix refactoring tests.
Hosch250 May 5, 2016
622921f
Fix inspection test.
Hosch250 May 5, 2016
38fc5e9
actually fix problem instead of simply deleting test
May 5, 2016
a9118b6
fix resolver tests
May 5, 2016
a289d59
Merge branch 'BugBlipper' of https://github.com/Hosch250/Rubberduck i…
May 5, 2016
47c2f15
Merge pull request #1431 from INOPIAE/translation
retailcoder May 5, 2016
5a7d13e
Remove works, except for the Help button.
Hosch250 May 5, 2016
3bd9824
Merge branch 'next' of https://github.com/rubberduck-vba/Rubberduck i…
Hosch250 May 5, 2016
dca1d07
fixed a few tests
May 5, 2016
3b08fc7
Merge branch 'next' of https://github.com/rubberduck-vba/Rubberduck i…
May 5, 2016
cf00c0e
Remove help button.
Hosch250 May 5, 2016
8d27cd9
Partial implementation of the commands.
Hosch250 May 5, 2016
a772fd7
fix / skip tests
May 5, 2016
bf92ef8
Rest of the commands.
Hosch250 May 5, 2016
c7636d9
small fixes
May 5, 2016
429b700
Extract all commands.
Hosch250 May 6, 2016
9ba00ec
Merge pull request #85 from autoboosh/simplenamedefault
retailcoder May 6, 2016
e400b9d
Fix only command that doesn't check for null
Hosch250 May 6, 2016
151393c
Fix recursive stack overflow.
Hosch250 May 6, 2016
7bea311
Hide buttons on the bottom of the code explorer as necessary
Hosch250 May 6, 2016
0a29e1e
First three code explorer tests.
Hosch250 May 6, 2016
2c4b78a
added failing parser test for ifElseStmt
retailcoder May 6, 2016
753b06d
Merge branch 'rubberduck-vba-next' of https://github.com/retailcoder/…
retailcoder May 6, 2016
119d31a
Add another Code Explorer test.
Hosch250 May 6, 2016
d9fbaf0
fixed bug in Control discovery in DeclarationSymbolsListener, added f…
retailcoder May 6, 2016
3f9eb30
Merge pull request #1 from retailcoder/rubberduck-vba-next
May 6, 2016
d2c284c
No-export remove test.
Hosch250 May 6, 2016
b9b8d5b
Indent module test
Hosch250 May 6, 2016
cc40f48
Rename test
Hosch250 May 6, 2016
e916401
Fix a Ninject error after changing a parameter type.
Hosch250 May 6, 2016
8f251a2
Make refactoring dialog interfaces use "dialog" instead of "view" to …
Hosch250 May 6, 2016
e8655e5
Remove unneeded setup code in tests
Hosch250 May 6, 2016
27ab109
OpenFileDialog wrapper and test for import
Hosch250 May 6, 2016
396c580
Expose VBComponents mock and verify. Add ISaveFileDialog
Hosch250 May 6, 2016
db23028
Expose list of components mocks. Export test.
Hosch250 May 6, 2016
fb1c4ac
This should have worked.
Hosch250 May 6, 2016
3a1d3bb
Merge branch 'simplenamedefault' of https://github.com/autoboosh/Rubb…
Hosch250 May 6, 2016
c608dd5
Un-ignore inspection test I fixed previously. Show designer test, sl…
Hosch250 May 6, 2016
326a539
add supertypes/subtypes to classmoduledeclarations to facilitate name…
May 6, 2016
2be5eea
Merge branch 'BugBlipper' of https://github.com/Hosch250/Rubberduck i…
May 6, 2016
41aef31
Check for resolver errors in addition to parser errors.
Hosch250 May 6, 2016
09b37db
fix tests
May 6, 2016
1d99e59
Properly test Remove
Hosch250 May 6, 2016
48e5c81
add simple form declarations
May 6, 2016
dce0396
Implement IDisposable as needed. Manually test and fix bugs in Print.
Hosch250 May 6, 2016
e032fdd
Extract folder logic.
Hosch250 May 6, 2016
6cc9f5b
Reinstate tests
Hosch250 May 7, 2016
b693061
Add delimiter to general settings VM, improve validity check in config.
Hosch250 May 7, 2016
ca9459a
Allow user to change delimiter in settings.
Hosch250 May 7, 2016
0555aa6
allow comments that look like annotations (#1426)
May 7, 2016
bbfb100
fix #1422
May 7, 2016
957efd8
Add delimiter tests
Hosch250 May 7, 2016
6f71b5e
Make parser only show correct folders in a project.
Hosch250 May 7, 2016
f9e1088
Fix the settings UI bug.
Hosch250 May 7, 2016
c2812d9
fix wrong selection
May 8, 2016
526abdc
allow conditonal compilation keywords inside logical lines
May 8, 2016
5b98db7
fix GUID attribute parsing + ignore control test
May 8, 2016
c8c3a96
Merge pull request #1429 from autoboosh/simplenamedefault
retailcoder May 8, 2016
8cad6e0
Merge branch 'next' of https://github.com/rubberduck-vba/Rubberduck i…
Hosch250 May 8, 2016
5e4f187
fix wrong comment style
May 8, 2016
bd3d30f
Merge pull request #1435 from Hosch250/BugBlipper
retailcoder May 8, 2016
c45802f
Translation: added new German translation
INOPIAE May 8, 2016
58fb9dd
Merge pull request #1442 from autoboosh/next
retailcoder May 9, 2016
70bd6bd
Merge pull request #1443 from INOPIAE/translation
retailcoder May 9, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion RetailCoder.VBE/Common/DeclarationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,9 +415,11 @@ public static Declaration FindTarget(this IEnumerable<Declaration> declarations,
{
var items = declarations.ToList();

// TODO: Due to the new binding mechanism this can have more than one match (e.g. in the case of index expressions + simple name expressions)
// Left as is for now because the binding is not fully integrated yet.
var target = items
.Where(item => !item.IsBuiltIn && validDeclarationTypes.Contains(item.DeclarationType))
.SingleOrDefault(item => item.IsSelected(selection)
.FirstOrDefault(item => item.IsSelected(selection)
|| item.References.Any(r => r.IsSelected(selection)));

if (target != null)
Expand Down
4 changes: 2 additions & 2 deletions RetailCoder.VBE/Common/DeclarationIconCache.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ private static Uri GetIconUri(DeclarationType declarationType, Accessibility acc
path = "VSObject_Enum.png";
break;

case DeclarationType.EnumerationMember | DeclarationType.Constant:
case DeclarationType.EnumerationMember:
path = "VSObject_EnumItem.png";
break;

Expand Down Expand Up @@ -193,7 +193,7 @@ private static Uri GetIconUri(DeclarationType declarationType, Accessibility acc
path = "VSObject_ValueType.png";
break;

case DeclarationType.UserDefinedTypeMember | DeclarationType.Variable:
case DeclarationType.UserDefinedTypeMember:
path = "VSObject_Field.png";
break;

Expand Down
7 changes: 3 additions & 4 deletions RetailCoder.VBE/Common/RubberduckHooks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public void HookHotkeys()
var config = _config.LoadConfiguration();
var settings = config.UserSettings.GeneralSettings.HotkeySettings;

_rawinput = new RawInput(_mainWindowHandle, true);
_rawinput.AddMessageFilter();
_rawinput = new RawInput(_mainWindowHandle);

var kb = (RawKeyboard)_rawinput.CreateKeyboard();
_rawinput.AddDevice(kb);
Expand All @@ -69,15 +68,15 @@ private void Mouse_RawMouseInputReceived(object sender, RawMouseEventArgs e)
{
if (e.UlButtons.HasFlag(UsButtonFlags.RI_MOUSE_LEFT_BUTTON_UP) || e.UlButtons.HasFlag(UsButtonFlags.RI_MOUSE_RIGHT_BUTTON_UP))
{
MessageReceived(this, HookEventArgs.Empty);
OnMessageReceived(this, HookEventArgs.Empty);
}
}

private void Keyboard_RawKeyboardInputReceived(object sender, RawKeyEventArgs e)
{
if (e.Message == WM.KEYUP)
{
MessageReceived(this, HookEventArgs.Empty);
OnMessageReceived(this, HookEventArgs.Empty);
}
}

Expand Down
13 changes: 0 additions & 13 deletions RetailCoder.VBE/Common/WinAPI/BroadcastDeviceInterface.cs

This file was deleted.

13 changes: 0 additions & 13 deletions RetailCoder.VBE/Common/WinAPI/BroadcastDeviceType.cs

This file was deleted.

13 changes: 0 additions & 13 deletions RetailCoder.VBE/Common/WinAPI/EnumeratedDevice.cs

This file was deleted.

3 changes: 1 addition & 2 deletions RetailCoder.VBE/Common/WinAPI/IRawDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace Rubberduck.Common.WinAPI
{
public interface IRawDevice
{
void ProcessRawInput(IntPtr hdevice);
void EnumerateDevices();
void ProcessRawInput(InputData _rawBuffer);
}
}
14 changes: 0 additions & 14 deletions RetailCoder.VBE/Common/WinAPI/PreMessageFilter.cs

This file was deleted.

99 changes: 0 additions & 99 deletions RetailCoder.VBE/Common/WinAPI/RawDevice.cs

This file was deleted.

90 changes: 14 additions & 76 deletions RetailCoder.VBE/Common/WinAPI/RawInput.cs
Original file line number Diff line number Diff line change
@@ -1,30 +1,26 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Collections.Generic;
using Rubberduck.Common.WinAPI;
using System.Windows.Forms;

namespace Rubberduck.Common.WinAPI
{
public class RawInput : NativeWindow
{
readonly IntPtr _devNotifyHandle;
static readonly Guid DeviceInterfaceHid = new Guid("4D1E55B2-F16F-11CF-88CB-001111000030");
private PreMessageFilter _filter;
private readonly List<IRawDevice> _devices;

public RawInput(IntPtr parentHandle, bool captureOnlyInForeground)
public RawInput(IntPtr parentHandle)
{
AssignHandle(parentHandle);
_devNotifyHandle = RegisterForDeviceNotifications(parentHandle);
_devices = new List<IRawDevice>();
}

public void AddDevice(IRawDevice device)
{
_devices.Add(device);
device.EnumerateDevices();
}

public IRawDevice CreateKeyboard()
Expand All @@ -35,90 +31,32 @@ public IRawDevice CreateKeyboard()
public IRawDevice CreateMouse()
{
return new RawMouse(Handle, true);
}

public void AddMessageFilter()
{
if (null != _filter)
{
return;
}
_filter = new PreMessageFilter();
Application.AddMessageFilter(_filter);
}

private void RemoveMessageFilter()
{
if (null == _filter)
{
return;
}
Application.RemoveMessageFilter(_filter);
}

static IntPtr RegisterForDeviceNotifications(IntPtr parent)
{
var usbNotifyHandle = IntPtr.Zero;
var bdi = new BroadcastDeviceInterface();
bdi.DbccSize = Marshal.SizeOf(bdi);
bdi.BroadcastDeviceType = BroadcastDeviceType.DBT_DEVTYP_DEVICEINTERFACE;
bdi.DbccClassguid = DeviceInterfaceHid;
var mem = IntPtr.Zero;
try
{
mem = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(BroadcastDeviceInterface)));
Marshal.StructureToPtr(bdi, mem, false);
usbNotifyHandle = User32.RegisterDeviceNotification(parent, mem, DeviceNotification.DEVICE_NOTIFY_WINDOW_HANDLE);
}
catch (Exception e)
{
Debug.Print("Registration for device notifications Failed. Error: {0}", Marshal.GetLastWin32Error());
Debug.Print(e.StackTrace);
}
finally
{
Marshal.FreeHGlobal(mem);
}

if (usbNotifyHandle == IntPtr.Zero)
{
Debug.Print("Registration for device notifications Failed. Error: {0}", Marshal.GetLastWin32Error());
}

return usbNotifyHandle;
}
}

protected override void WndProc(ref Message message)
{
switch ((WM)message.Msg)
{
case WM.INPUT:
{
foreach (var device in _devices)
InputData _rawBuffer;
var dwSize = 0;
User32.GetRawInputData(message.LParam, DataCommand.RID_INPUT, IntPtr.Zero, ref dwSize, Marshal.SizeOf(typeof(RawInputHeader)));
int res = User32.GetRawInputData(message.LParam, DataCommand.RID_INPUT, out _rawBuffer, ref dwSize, Marshal.SizeOf(typeof(RawInputHeader)));
if (dwSize != res)
{
device.ProcessRawInput(message.LParam);
var ex = new Win32Exception(Marshal.GetLastWin32Error());
Debug.WriteLine("Error getting the rawinput buffer: {0}", ex.Message);
return;
}
}
break;

case WM.DEVICECHANGE:
{
Debug.WriteLine("USB Device Arrival / Removal");
foreach (var device in _devices)
{
device.EnumerateDevices();
device.ProcessRawInput(_rawBuffer);
}
}
break;
}

base.WndProc(ref message);
}

~RawInput()
{
User32.UnregisterDeviceNotification(_devNotifyHandle);
RemoveMessageFilter();
}
}
}
Loading