Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
85 commits
Select commit Hold shift + click to select a range
6616d42
First parse at Access Forms/Reports
ThunderFrame Jan 30, 2017
3d70a0e
Merge branch 'next' of https://github.com/rubberduck-vba/Rubberduck i…
ThunderFrame Jan 30, 2017
48d1b20
Merge pull request #213 from rubberduck-vba/next
retailcoder Feb 3, 2017
2b183cb
Merge branch 'rd-next' into next
retailcoder Feb 4, 2017
4f4cbd7
Merge branch 'next' of https://github.com/retailcoder/Rubberduck.git
retailcoder Feb 4, 2017
36bfaf2
fixed merge artifacts
retailcoder Feb 4, 2017
1f244a6
Merge branch 'next' into next
comintern Feb 4, 2017
52489a5
Adjust test to account for new functionality.
comintern Feb 4, 2017
4de68ab
fixed broken test (1 left)
retailcoder Feb 4, 2017
48573d5
Make test more specific.
comintern Feb 4, 2017
19108fe
Merge branch 'next' of https://github.com/comintern/Rubberduck.git
comintern Feb 4, 2017
425891d
implemented VersionCheckCommand
retailcoder Feb 4, 2017
275ba27
closes #1785; fixes #2612; ref. #2087
retailcoder Feb 4, 2017
fdae59d
added CheckVersion setting; *actually* closes #1785
retailcoder Feb 4, 2017
0a09514
changed != for <
retailcoder Feb 4, 2017
83534b4
Merge pull request #2629 from comintern/next
retailcoder Feb 4, 2017
c33195a
Merge branch 'next' into next
retailcoder Feb 4, 2017
2c8016f
Merge pull request #2630 from retailcoder/next
retailcoder Feb 4, 2017
ed5ee0a
Merge pull request #215 from rubberduck-vba/next
retailcoder Feb 4, 2017
c6e06e6
Correct null checks in VBComponent(s).
comintern Feb 4, 2017
0cefea5
Remove duplicate setup of VBProjects in MockVbeBuilder.
comintern Feb 4, 2017
3066512
Add attribution for AvalonEdit.
comintern Feb 4, 2017
45c8155
Merge branch 'next' into next
comintern Feb 4, 2017
f8632ba
Merge pull request #2633 from comintern/next
retailcoder Feb 4, 2017
1b757b8
Made reference resolver stop on cancellation.
MDoerner Feb 5, 2017
a31b0d5
Made setting module states honor cancellation in a threadsafe way.
MDoerner Feb 5, 2017
b8b3e12
Merge branch 'next' into ReworkParseCoordinatorPart3BugFix
MDoerner Feb 5, 2017
a827ace
Added asserts regarding the ParserState to the tests with inconsisten…
MDoerner Feb 5, 2017
6398825
Merge pull request #2639 from MDoerner/ReworkParseCoordinatorPart3BugFix
retailcoder Feb 5, 2017
19e8b9e
Merge pull request #216 from rubberduck-vba/next
retailcoder Feb 5, 2017
db53523
removed "FolderDelimiter" setting, ref. #2637
retailcoder Feb 5, 2017
4ed1f44
Merge pull request #2640 from retailcoder/next
retailcoder Feb 5, 2017
63f4a07
Fix description for implicit active workbook results. Closes #2642
comintern Feb 6, 2017
0a65b0c
Pick up variable references in Name statement. Closes #2646
comintern Feb 6, 2017
59720c1
Correct detection of line continuations when stripping line numbers. …
comintern Feb 6, 2017
0cb0d8e
Merge branch 'next' of https://github.com/rubberduck-vba/Rubberduck i…
ThunderFrame Feb 6, 2017
86e2660
Give precedence to type hinted identifiers in grammar. Closes #2618
comintern Feb 6, 2017
f0f4183
Consolidate ValueTypes lists, add LongPtr to list, closes #2645
comintern Feb 7, 2017
83e4274
Stop treating TKIND_ALIAS as an interface. Closes #2538
comintern Feb 7, 2017
6f63ce5
Update serialized declarations for COM collector change.
comintern Feb 7, 2017
95024c2
#1942: AssignedByValParameter insp, new quick-fix
BZngr Feb 7, 2017
107a61b
Missed Object and Any in ValueTypesUpper (also renamed back to BaseTy…
comintern Feb 7, 2017
6209ae7
Change ComVariant.TypeNames to use Tokens.Foo, add a couple tokens.
comintern Feb 7, 2017
b06a806
Add skeleton for ComAlias implementation (partial rollback).
comintern Feb 7, 2017
503df95
Revert "Update serialized declarations for COM collector change."
comintern Feb 7, 2017
314a2d0
Merge pull request #2652 from comintern/next
retailcoder Feb 7, 2017
d446b83
Finish implementation of ComAlias.
comintern Feb 7, 2017
56130cb
#1942 - AssignedByValParameter new QuickFIx
BZngr Feb 7, 2017
a6bf7e2
#1942 - AssignedByValParameter new QuickFix
BZngr Feb 7, 2017
85ac9d8
#1942 - AssignedByValParameter new QuickFix
BZngr Feb 7, 2017
6343529
#1942 - AssignedByValParameter new QuickFix
BZngr Feb 7, 2017
0f33332
Add AliasDeclaration and DeclarationType.ComAlias, adjust binding.
comintern Feb 7, 2017
751671d
Fix ComAlias display in command bar.
comintern Feb 8, 2017
d0ebc1f
#1942 - AssignedByValParameter new QuickFix
BZngr Feb 8, 2017
7e43b6c
Handle network errors on version checking. Closes #2657
comintern Feb 8, 2017
d645ed2
Merge branch 'next' into next
comintern Feb 8, 2017
af0f60b
Merge pull request #2654 from BZngr/next
retailcoder Feb 8, 2017
2d4434e
Merge branch 'next' into next
retailcoder Feb 8, 2017
6d65242
Merge pull request #2658 from comintern/next
retailcoder Feb 8, 2017
07c87ad
R#'d, made validation strings localizable.
comintern Feb 8, 2017
b515f18
Merge branch 'next' into next
comintern Feb 8, 2017
626cfda
Merge pull request #2661 from comintern/next
retailcoder Feb 8, 2017
9b3e7fe
Merge branch 'next' of https://github.com/rubberduck-vba/Rubberduck i…
ThunderFrame Feb 9, 2017
6d90e2b
Check only 1 control is selected before rename
ThunderFrame Feb 9, 2017
07f0cae
revert changes in anticipation of new Access control drop-in.
ThunderFrame Feb 9, 2017
ad63b1a
Merge pull request #2667 from ThunderFrame/next
retailcoder Feb 9, 2017
f87d45a
Made parser correctly set error state on unexpected exceptions.
MDoerner Feb 11, 2017
a657ec5
Reworked locking in the ParseCoordinator and the cancellation handling
MDoerner Feb 11, 2017
7349c81
Clean up event handlers in _DockableWindowHost, limit PInvokes by usi…
comintern Feb 11, 2017
b39a1dd
Indented token.ThrowIfCanceled one level further in the ParseCoordina…
MDoerner Feb 11, 2017
2c42059
Added overall logging for the parsing runs. (exception,cancellation,r…
MDoerner Feb 11, 2017
63655b6
Now uses correct token in ReparseRequested
MDoerner Feb 11, 2017
0054975
Dispose wrapped user controls before releasing their host windows.
comintern Feb 11, 2017
07f5972
Indented the ThowIfCancellationRequested I forgot earlier
MDoerner Feb 11, 2017
98f8852
Merge pull request #2674 from MDoerner/ReworkParseCoordinatorPart4
retailcoder Feb 11, 2017
cf3627d
Refactoring of SyncCOMReferences in ParseCoordinator.
MDoerner Feb 12, 2017
40e9527
Sunk ISinks. Handle VBComponentsEvents and VBProjectsEvents via RCW.
comintern Feb 12, 2017
bbd95e8
Reimplement DockableWindowHost parent subclassing to be safer.
comintern Feb 12, 2017
1e5d02d
Merge branch 'next' into next
comintern Feb 12, 2017
35b79b9
Switch base class of RawInput from NativeWindow to SubclassingWindow
comintern Feb 12, 2017
b5bce2d
Merge branch 'next' of https://github.com/comintern/Rubberduck.git
comintern Feb 12, 2017
40c0726
Keep DockableWindowHosts alive until they can stop responding to the …
comintern Feb 13, 2017
0dae8e5
Merge pull request #2676 from MDoerner/ReworkParseCoordinatorPart5
retailcoder Feb 13, 2017
a179890
Merge branch 'next' into next
retailcoder Feb 13, 2017
0f5f5e1
Merge pull request #2677 from comintern/next
retailcoder Feb 13, 2017
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
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,14 @@ LibGit2Sharp is the library that has allowed us to integrate Git right into the

Which basically means it's a reimplementation of Git in C. It also [happens to be the technology Microsoft uses for their own Git integration with Visual Studio](http://www.hanselman.com/blog/GitSupportForVisualStudioGitTFSAndVSPutIntoContext.aspx).

###[AvalonEdit](http://avalonedit.net)

Source code looks a lot better with syntax highlighting, and AvalonEdit excels at it.

> AvalonEdit is a WPF-based text editor component. It was written by [Daniel Grunwald](https://github.com/dgrunwald) for the [SharpDevelop](http://www.icsharpcode.net/OpenSource/SD/) IDE. Starting with version 5.0, AvalonEdit is released under the [MIT license](http://opensource.org/licenses/MIT).

We're currently only using a tiny bit of this code editor's functionality (more to come!).

###[WPF Localization Using RESX Files](http://www.codeproject.com/Articles/35159/WPF-Localization-Using-RESX-Files)

This library makes localizing WPF applications at runtime using resx files a breeze. Thank you [Grant Frisken](http://www.codeproject.com/script/Membership/View.aspx?mid=1079060)!
Expand Down
19 changes: 16 additions & 3 deletions RetailCoder.VBE/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@
using System.Globalization;
using System.Linq;
using System.Windows.Forms;
using Rubberduck.UI.Command;
using Rubberduck.UI.Command.MenuItems.CommandBars;
using Rubberduck.VBEditor.SafeComWrappers.Abstract;
using Rubberduck.VersionCheck;

namespace Rubberduck
{
Expand All @@ -28,6 +30,8 @@ public sealed class App : IDisposable
private readonly IAppMenu _appMenus;
private readonly RubberduckCommandBar _stateBar;
private readonly IRubberduckHooks _hooks;
private readonly IVersionCheck _version;
private readonly CommandBase _checkVersionCommand;

private static readonly Logger Logger = LogManager.GetCurrentClassLogger();

Expand All @@ -39,7 +43,9 @@ public App(IVBE vbe,
IGeneralConfigService configService,
IAppMenu appMenus,
RubberduckCommandBar stateBar,
IRubberduckHooks hooks)
IRubberduckHooks hooks,
IVersionCheck version,
CommandBase checkVersionCommand)
{
_vbe = vbe;
_messageBox = messageBox;
Expand All @@ -49,6 +55,8 @@ public App(IVBE vbe,
_appMenus = appMenus;
_stateBar = stateBar;
_hooks = hooks;
_version = version;
_checkVersionCommand = checkVersionCommand;

_hooks.MessageReceived += _hooks_MessageReceived;
_configService.SettingsChanged += _configService_SettingsChanged;
Expand Down Expand Up @@ -158,6 +166,11 @@ public void Startup()
_stateBar.SetStatusLabelCaption(ParserState.Pending);
_stateBar.EvaluateCanExecute(_parser.State);
UpdateLoggingLevel();

if (_config.UserSettings.GeneralSettings.CheckVersion)
{
_checkVersionCommand.Execute(null);
}
}

public void Shutdown()
Expand Down Expand Up @@ -229,8 +242,8 @@ private void CheckForLegacyIndenterSettings()

private void LogRubberduckSart()
{
var version = GetType().Assembly.GetName().Version.ToString();
GlobalDiagnosticsContext.Set("RubberduckVersion", version);
var version = _version.CurrentVersion;
GlobalDiagnosticsContext.Set("RubberduckVersion", version.ToString());
var headers = new List<string>
{
string.Format("Rubberduck version {0} loading:", version),
Expand Down
8 changes: 8 additions & 0 deletions RetailCoder.VBE/Common/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,13 @@ public static string Captialize(this string input)
tokens[0] = CultureInfo.CurrentUICulture.TextInfo.ToTitleCase(tokens[0]);
return string.Join(" ", tokens);
}
public static string CapitalizeFirstLetter(this string input)
{
if (input.Length == 0)
{
return string.Empty;
}
return input.Captialize().Substring(0, 1) + input.Substring(1);
}
}
}
80 changes: 40 additions & 40 deletions RetailCoder.VBE/Common/WinAPI/RawInput.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@
using System.Collections.Generic;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.Windows.Forms;
using Rubberduck.UI;

namespace Rubberduck.Common.WinAPI
{
public class RawInput : NativeWindow
public class RawInput : SubclassingWindow
{
static readonly Guid DeviceInterfaceHid = new Guid("4D1E55B2-F16F-11CF-88CB-001111000030");
private readonly List<IRawDevice> _devices;
private static readonly Logger Logger = LogManager.GetCurrentClassLogger();
private static int _currentId;

public RawInput(IntPtr parentHandle)
public RawInput(IntPtr parentHandle) : base (new IntPtr((int)parentHandle + (_currentId++)), parentHandle)
{
AssignHandle(parentHandle);
_devices = new List<IRawDevice>();
}

Expand All @@ -26,56 +26,56 @@ public void AddDevice(IRawDevice device)

public IRawDevice CreateKeyboard()
{
return new RawKeyboard(Handle, true);
return new RawKeyboard(Hwnd, true);
}

public IRawDevice CreateMouse()
{
return new RawMouse(Handle, true);
}
return new RawMouse(Hwnd, true);
}

protected override void WndProc(ref Message message)
public override int SubClassProc(IntPtr hWnd, IntPtr msg, IntPtr wParam, IntPtr lParam, IntPtr uIdSubclass, IntPtr dwRefData)
{
switch ((WM)message.Msg)
switch ((WM)msg)
{
case WM.INPUT:
{
if (message.LParam == IntPtr.Zero)
{
break;
}
InputData rawBuffer;
var dwSize = 0;
var res = User32.GetRawInputData(message.LParam, DataCommand.RID_INPUT, IntPtr.Zero, ref dwSize, Marshal.SizeOf(typeof(RawInputHeader)));
if (res != 0)
{
var ex = new Win32Exception(Marshal.GetLastWin32Error());
Logger.Error(ex, "Error sizing the rawinput buffer: {0}", ex.Message);
break;
}
if (lParam == IntPtr.Zero)
{
break;
}
InputData rawBuffer;
var dwSize = 0;
var res = User32.GetRawInputData(lParam, DataCommand.RID_INPUT, IntPtr.Zero, ref dwSize, Marshal.SizeOf(typeof(RawInputHeader)));
if (res != 0)
{
var ex = new Win32Exception(Marshal.GetLastWin32Error());
Logger.Error(ex, "Error sizing the rawinput buffer: {0}", ex.Message);
break;
}

res = User32.GetRawInputData(message.LParam, DataCommand.RID_INPUT, out rawBuffer, ref dwSize, Marshal.SizeOf(typeof(RawInputHeader)));
if (res == -1)
{
var ex = new Win32Exception(Marshal.GetLastWin32Error());
Logger.Error(ex, "Error getting the rawinput buffer: {0}", ex.Message);
break;
}
if (res == dwSize)
{
foreach (var device in _devices)
res = User32.GetRawInputData(lParam, DataCommand.RID_INPUT, out rawBuffer, ref dwSize, Marshal.SizeOf(typeof(RawInputHeader)));
if (res == -1)
{
device.ProcessRawInput(rawBuffer);
var ex = new Win32Exception(Marshal.GetLastWin32Error());
Logger.Error(ex, "Error getting the rawinput buffer: {0}", ex.Message);
break;
}
if (res == dwSize)
{
foreach (var device in _devices)
{
device.ProcessRawInput(rawBuffer);
}
}
else
{
//Something is seriously f'd up with Windows - the number of bytes copied does not match the reported buffer size.
}
}
else
{
//Something is seriously f'd up with Windows - the number of bytes copied does not match the reported buffer size.
}
}
break;
break;
}
base.WndProc(ref message);
return base.SubClassProc(hWnd, msg, wParam, lParam, uIdSubclass, dwRefData);
}
}
}
1 change: 1 addition & 0 deletions RetailCoder.VBE/Extension.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ private void InitializeAddIn()
{
splash = new Splash
{
// note: IVersionCheck.CurrentVersion could return this string.
Version = string.Format("version {0}", Assembly.GetExecutingAssembly().GetName().Version)
};
splash.Show();
Expand Down
21 changes: 3 additions & 18 deletions RetailCoder.VBE/Inspections/ObjectVariableNotSetInspection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Rubberduck.Inspections.Abstract;
using Rubberduck.Inspections.Resources;
using Rubberduck.Inspections.Results;
using Rubberduck.Parsing;
using Rubberduck.Parsing.Grammar;
using Rubberduck.Parsing.Symbols;
using Rubberduck.Parsing.VBA;
Expand All @@ -20,29 +21,13 @@ public ObjectVariableNotSetInspection(RubberduckParserState state)
public override string Description { get { return InspectionsUI.ObjectVariableNotSetInspectionName; } }
public override CodeInspectionType InspectionType { get { return CodeInspectionType.CodeQualityIssues; } }

private static readonly IReadOnlyList<string> ValueTypes = new[]
{
Tokens.Boolean,
Tokens.Byte,
Tokens.Currency,
Tokens.Date,
Tokens.Decimal,
Tokens.Double,
Tokens.Integer,
Tokens.Long,
Tokens.LongLong,
Tokens.Single,
Tokens.String,
Tokens.Variant
};

public override IEnumerable<InspectionResultBase> GetInspectionResults()
{
var interestingDeclarations =
State.AllUserDeclarations.Where(item =>
!item.IsSelfAssigned &&
!item.IsArray &&
!ValueTypes.Contains(item.AsTypeName) &&
!SymbolList.ValueTypes.Contains(item.AsTypeName) &&
(item.AsTypeDeclaration == null || (!ClassModuleDeclaration.HasDefaultMember(item.AsTypeDeclaration) &&
item.AsTypeDeclaration.DeclarationType != DeclarationType.Enumeration &&
item.AsTypeDeclaration.DeclarationType != DeclarationType.UserDefinedType)) &&
Expand All @@ -54,7 +39,7 @@ public override IEnumerable<InspectionResultBase> GetInspectionResults()
(item.DeclarationType == DeclarationType.Function || item.DeclarationType == DeclarationType.PropertyGet)
&& !item.IsArray
&& item.IsTypeSpecified
&& !ValueTypes.Contains(item.AsTypeName)
&& !SymbolList.ValueTypes.Contains(item.AsTypeName)
&& (item.AsTypeDeclaration == null // null if unresolved (e.g. in unit tests)
|| (item.AsTypeDeclaration.DeclarationType != DeclarationType.Enumeration && item.AsTypeDeclaration.DeclarationType != DeclarationType.UserDefinedType
&& item.AsTypeDeclaration != null
Expand Down
Loading