Skip to content

Commit cbafad2

Browse files
committed
Merge branch 'autoboosh-commentnodes' into next
2 parents 1653b55 + 4a7be5d commit cbafad2

File tree

247 files changed

+12193
-9969
lines changed

Some content is hidden

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

247 files changed

+12193
-9969
lines changed

README.md

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22

33
| Branch | Build Status |
44
|------------|--------------|
5-
| **master** | [![master branch build status][masterBuildStatus]][masterBuild] |
6-
| **next** | [![next branch build status][nextBuildStatus]][nextBuild] |
5+
| **master** | ![master branch build status][masterBuildStatus] |
6+
| **next** | ![next branch build status][nextBuildStatus] |
77

8-
[nextBuild]:https://ci.appveyor.com/project/ckuhn203/rubberduck-3v9qv/branch/next
9-
[nextBuildStatus]:https://ci.appveyor.com/api/projects/status/bfwl1pwu9eeqd11o/branch/next?svg=true
10-
[masterBuild]:https://ci.appveyor.com/project/ckuhn203/rubberduck-3v9qv/branch/master
11-
[masterBuildStatus]:https://ci.appveyor.com/api/projects/status/bfwl1pwu9eeqd11o/branch/master?svg=true
8+
[nextBuildStatus]:https://ci.appveyor.com/api/projects/status/we3pdnkeebo4nlck/branch/next?svg=true
9+
[masterBuildStatus]:https://ci.appveyor.com/api/projects/status/we3pdnkeebo4nlck/branch/master?svg=true
1210

1311
Rubberduck is a COM Add-In for the VBA IDE that makes VBA development even more enjoyable, by extending the Visual Basic Editor (VBE) with menus, toolbars and toolwindows that enable things we didn't even think were possible when we first started this project.
1412

@@ -88,6 +86,12 @@ LibGit2Sharp is the library that has allowed us to integrate Git right into the
8886
8987
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).
9088

89+
###[WPF Localization Using RESX Files](http://www.codeproject.com/Articles/35159/WPF-Localization-Using-RESX-Files)
90+
91+
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)!
92+
93+
> Licensed under [The Code Project Open License](http://www.codeproject.com/info/cpol10.aspx).
94+
9195
##Icons
9296

9397
We didn't come up with these icons ourselves! Here's who did what:
@@ -110,9 +114,3 @@ For more information, please see the EULAs in the [./Resources/Microsoft/ direct
110114

111115
* [Visual Studio 2013 Image Library EULA](https://github.com/retailcoder/Rubberduck/blob/master/RetailCoder.VBE/Resources/Microsoft/Visual%20Studio%202013%20Image%20Library%20EULA.rtf)
112116
* [Visual Studio 2012 Image Library EULA](https://github.com/retailcoder/Rubberduck/blob/master/RetailCoder.VBE/Resources/Microsoft/Visual%20Studio%202012%20Image%20Library%20EULA.rtf)
113-
114-
###[WPF Localization Using RESX Files](http://www.codeproject.com/Articles/35159/WPF-Localization-Using-RESX-Files)
115-
116-
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)!
117-
118-
> Licensed under [The Code Project Open License](http://www.codeproject.com/info/cpol10.aspx).

RetailCoder.VBE/App.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public class App : IDisposable
3030
private readonly AutoSave.AutoSave _autoSave;
3131
private readonly IGeneralConfigService _configService;
3232
private readonly IAppMenu _appMenus;
33-
private readonly ParserStateCommandBar _stateBar;
33+
private readonly RubberduckCommandBar _stateBar;
3434
private readonly IIndenter _indenter;
3535
private readonly IRubberduckHooks _hooks;
3636

@@ -44,9 +44,9 @@ public App(VBE vbe, IMessageBox messageBox,
4444
IInspectorFactory inspectorFactory,
4545
IGeneralConfigService configService,
4646
IAppMenu appMenus,
47-
ParserStateCommandBar stateBar,
48-
IIndenter indenter,
49-
IRubberduckHooks hooks)
47+
RubberduckCommandBar stateBar,
48+
IIndenter indenter/*,
49+
IRubberduckHooks hooks*/)
5050
{
5151
_vbe = vbe;
5252
_messageBox = messageBox;
@@ -58,10 +58,10 @@ public App(VBE vbe, IMessageBox messageBox,
5858
_appMenus = appMenus;
5959
_stateBar = stateBar;
6060
_indenter = indenter;
61-
_hooks = hooks;
61+
//_hooks = hooks;
6262
_logger = LogManager.GetCurrentClassLogger();
6363

64-
_hooks.MessageReceived += hooks_MessageReceived;
64+
//_hooks.MessageReceived += hooks_MessageReceived;
6565
_configService.SettingsChanged += _configService_SettingsChanged;
6666
_parser.State.StateChanged += Parser_StateChanged;
6767
_stateBar.Refresh += _stateBar_Refresh;
@@ -190,14 +190,14 @@ private void LoadConfig()
190190
var currentCulture = RubberduckUI.Culture;
191191
try
192192
{
193-
CultureManager.UICulture = CultureInfo.GetCultureInfo(_config.UserSettings.LanguageSetting.Code);
193+
CultureManager.UICulture = CultureInfo.GetCultureInfo(_config.UserSettings.GeneralSettings.Language.Code);
194194
_appMenus.Localize();
195195
}
196196
catch (CultureNotFoundException exception)
197197
{
198198
_logger.Error(exception, "Error Setting Culture for RubberDuck");
199199
_messageBox.Show(exception.Message, "Rubberduck", MessageBoxButtons.OK, MessageBoxIcon.Error);
200-
_config.UserSettings.LanguageSetting.Code = currentCulture.Name;
200+
_config.UserSettings.GeneralSettings.Language.Code = currentCulture.Name;
201201
_configService.SaveConfiguration(_config);
202202
}
203203
}
@@ -210,12 +210,12 @@ private void Setup()
210210

211211
public void Dispose()
212212
{
213-
_hooks.MessageReceived -= hooks_MessageReceived;
213+
//_hooks.MessageReceived -= hooks_MessageReceived;
214214
_configService.SettingsChanged -= _configService_SettingsChanged;
215215
_parser.State.StateChanged -= Parser_StateChanged;
216216
_autoSave.Dispose();
217217

218-
_hooks.Dispose();
218+
//_hooks.Dispose();
219219
}
220220
}
221221
}

RetailCoder.VBE/Common/DeclarationExtensions.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
using System.Diagnostics;
44
using System.Diagnostics.CodeAnalysis;
55
using System.Linq;
6+
using System.Threading.Tasks;
67
using System.Windows.Media.Imaging;
78
using Microsoft.Vbe.Interop;
8-
using Rubberduck.Annotations;
99
using Rubberduck.Parsing;
1010
using Rubberduck.Parsing.Grammar;
1111
using Rubberduck.Parsing.Symbols;
12+
using Rubberduck.Properties;
13+
using Rubberduck.UI;
1214
using Rubberduck.VBEditor;
1315
// ReSharper disable LocalizableElement
1416

@@ -18,6 +20,11 @@ public static class DeclarationExtensions
1820
{
1921
private static readonly DeclarationIconCache Cache = new DeclarationIconCache();
2022

23+
public static string ToLocalizedString(this DeclarationType type)
24+
{
25+
return RubberduckUI.ResourceManager.GetString("DeclarationType_" + type);
26+
}
27+
2128
public static BitmapImage BitmapImage(this Declaration declaration)
2229
{
2330
return Cache[declaration];

RetailCoder.VBE/Controls/GroupingGrid/GroupingGrid.xaml

Lines changed: 0 additions & 31 deletions
This file was deleted.

RetailCoder.VBE/Controls/GroupingGrid/GroupingGrid.xaml.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

RetailCoder.VBE/Inspections/AssignedByValParameterInspection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using Rubberduck.Parsing.Grammar;
44
using Rubberduck.Parsing.Symbols;
55
using Rubberduck.Parsing.VBA;
6-
using Rubberduck.UI;
76

87
namespace Rubberduck.Inspections
98
{
@@ -12,21 +11,22 @@ public sealed class AssignedByValParameterInspection : InspectionBase
1211
public AssignedByValParameterInspection(RubberduckParserState state)
1312
: base(state)
1413
{
15-
Severity = CodeInspectionSeverity.Warning;
14+
Severity = DefaultSeverity;
1615
}
1716

17+
public override string Meta { get { return InspectionsUI.AssignedByValParameterInspectionMeta; } }
1818
public override string Description { get { return InspectionsUI.AssignedByValParameterInspectionName; } }
1919
public override CodeInspectionType InspectionType { get { return CodeInspectionType.CodeQualityIssues; } }
2020

21-
public override IEnumerable<CodeInspectionResultBase> GetInspectionResults()
21+
public override IEnumerable<InspectionResultBase> GetInspectionResults()
2222
{
2323
var assignedByValParameters = UserDeclarations.Where(declaration =>
2424
declaration.DeclarationType == DeclarationType.Parameter
2525
&& ((VBAParser.ArgContext)declaration.Context).BYVAL() != null
2626
&& declaration.References.Any(reference => reference.IsAssignment));
2727

2828
var issues = assignedByValParameters
29-
.Select(param => new AssignedByValParameterInspectionResult(this, string.Format(Description, param.IdentifierName), param.Context, param.QualifiedName));
29+
.Select(param => new AssignedByValParameterInspectionResult(this, param.Context, param.QualifiedName));
3030

3131
return issues;
3232
}

RetailCoder.VBE/Inspections/AssignedByValParameterInspectionResult.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System;
21
using System.Collections.Generic;
32
using Antlr4.Runtime;
43
using Rubberduck.Parsing.Grammar;
@@ -7,19 +6,27 @@
76

87
namespace Rubberduck.Inspections
98
{
10-
public class AssignedByValParameterInspectionResult : CodeInspectionResultBase
9+
public class AssignedByValParameterInspectionResult : InspectionResultBase
1110
{
1211
private readonly IEnumerable<CodeInspectionQuickFix> _quickFixes;
1312

14-
public AssignedByValParameterInspectionResult(IInspection inspection, string result, ParserRuleContext context, QualifiedMemberName qualifiedName)
15-
: base(inspection, result, qualifiedName.QualifiedModuleName, context)
13+
public AssignedByValParameterInspectionResult(IInspection inspection, ParserRuleContext context, QualifiedMemberName qualifiedName)
14+
: base(inspection, qualifiedName.QualifiedModuleName, context)
1615
{
1716
_quickFixes = new[]
1817
{
1918
new PassParameterByReferenceQuickFix(context, QualifiedSelection),
2019
};
2120
}
2221

22+
public override string Description
23+
{
24+
get
25+
{
26+
return string.Format(InspectionsUI.AssignedByValParameterInspectionResultFormat, Target.IdentifierName);
27+
}
28+
}
29+
2330
public override IEnumerable<CodeInspectionQuickFix> QuickFixes { get { return _quickFixes; } }
2431
}
2532

@@ -28,8 +35,8 @@ public AssignedByValParameterInspectionResult(IInspection inspection, string res
2835
/// </summary>
2936
public class PassParameterByReferenceQuickFix : CodeInspectionQuickFix
3037
{
31-
public PassParameterByReferenceQuickFix(ParserRuleContext context, QualifiedSelection selection)
32-
: base(context, selection, RubberduckUI.Inspections_PassParamByReference)
38+
public PassParameterByReferenceQuickFix(ParserRuleContext context, QualifiedSelection selection)
39+
: base(context, selection, InspectionsUI.PassParameterByReferenceQuickFix)
3340
{
3441
}
3542

RetailCoder.VBE/Inspections/CodeInspectionQuickFix.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public CodeInspectionQuickFix(ParserRuleContext context, QualifiedSelection sele
1717
}
1818

1919
public string Description { get { return _description; } }
20-
protected ParserRuleContext Context { get { return _context; } }
20+
public ParserRuleContext Context { get { return _context; } }
2121
public QualifiedSelection Selection { get { return _selection; } }
2222

2323
public abstract void Fix();

RetailCoder.VBE/Inspections/CodeInspectionSeverity.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,25 @@
22
{
33
public enum CodeInspectionSeverity
44
{
5+
/// <summary>
6+
/// Inspection will not run.
7+
/// </summary>
58
DoNotShow,
9+
/// <summary>
10+
/// Low severity setting.
11+
/// </summary>
612
Hint,
13+
/// <summary>
14+
/// Medium-low severity setting.
15+
/// </summary>
716
Suggestion,
17+
/// <summary>
18+
/// Medium-high severity setting.
19+
/// </summary>
820
Warning,
21+
/// <summary>
22+
/// High severity setting.
23+
/// </summary>
924
Error
1025
}
1126
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System.Collections.Generic;
2+
3+
namespace Rubberduck.Inspections
4+
{
5+
public sealed class CompositeCodeInspectionFix : CodeInspectionQuickFix
6+
{
7+
private readonly CodeInspectionQuickFix _root;
8+
private readonly List<CodeInspectionQuickFix> _children;
9+
10+
public CompositeCodeInspectionFix(CodeInspectionQuickFix root)
11+
: base(root.Context, root.Selection, root.Description)
12+
{
13+
_root = root;
14+
_children = new List<CodeInspectionQuickFix>();
15+
}
16+
17+
public void AddChild(CodeInspectionQuickFix quickFix)
18+
{
19+
_children.Add(quickFix);
20+
}
21+
22+
public override void Fix()
23+
{
24+
_root.Fix();
25+
_children.ForEach(child => child.Fix());
26+
}
27+
}
28+
}

0 commit comments

Comments
 (0)