Skip to content

Commit b8968c6

Browse files
committed
Merge pull request #910 from retailcoder/next
Inspections Meta
2 parents cfc62cd + 66e2fbd commit b8968c6

File tree

71 files changed

+1290
-522
lines changed

Some content is hidden

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

71 files changed

+1290
-522
lines changed

RetailCoder.VBE/App.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ private async void hooks_MessageReceived(object sender, HookEventArgs e)
138138

139139
private void _stateBar_Refresh(object sender, EventArgs e)
140140
{
141-
_parser.State.RequestParse();
141+
_parser.State.OnParseRequested();
142142
}
143143

144144
private void Parser_StateChanged(object sender, EventArgs e)
@@ -153,10 +153,11 @@ public void Startup()
153153
_appMenus.Initialize();
154154
_appMenus.Localize();
155155

156+
// delay to allow the VBE to properly load. HostApplication is null until then.
156157
Task.Delay(1000).ContinueWith(t =>
157158
{
158159
_parser.State.AddBuiltInDeclarations(_vbe.HostApplication());
159-
_parser.State.RequestParse();
160+
_parser.State.OnParseRequested();
160161
});
161162

162163
//_hooks.AddHook(new LowLevelKeyboardHook(_vbe));

RetailCoder.VBE/Extension.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.ComponentModel;
3-
using System.Diagnostics;
43
using System.Runtime.InteropServices;
54
using System.Windows.Forms;
65
using Extensibility;
@@ -40,10 +39,6 @@ public void OnConnection(object Application, ext_ConnectMode ConnectMode, object
4039
_kernel.Load(new RubberduckModule(_kernel, (VBE)Application, (AddIn)AddInInst));
4140
_kernel.Load(new UI.SourceControl.SourceControlBindings());
4241
_kernel.Load(new CommandBarsModule(_kernel));
43-
44-
Debug.Print("in OnConnection, ready.");
45-
var app = _kernel.Get<App>();
46-
app.Startup();
4742
}
4843
catch (Exception exception)
4944
{
@@ -53,7 +48,8 @@ public void OnConnection(object Application, ext_ConnectMode ConnectMode, object
5348

5449
public void OnStartupComplete(ref Array custom)
5550
{
56-
51+
var app = _kernel.Get<App>();
52+
app.Startup();
5753
}
5854

5955
public void OnDisconnection(ext_DisconnectMode RemoveMode, ref Array custom)

RetailCoder.VBE/Inspections/AssignedByValParameterInspection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public AssignedByValParameterInspection()
1616
}
1717

1818
public string Name { get { return "AssignedByValParameterInspection"; } }
19+
public string Meta { get { return InspectionsUI.ResourceManager.GetString(Name + "Meta"); } }
1920
public string Description { get { return RubberduckUI.ByValParameterIsAssigned_; } }
2021
public CodeInspectionType InspectionType { get { return CodeInspectionType.CodeQualityIssues; } }
2122
public CodeInspectionSeverity Severity { get; set; }

RetailCoder.VBE/Inspections/ConstantNotUsedInspection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public ConstantNotUsedInspection()
1414
}
1515

1616
public string Name { get { return "ConstantNotUsedInspection"; } }
17+
public string Meta { get { return InspectionsUI.ResourceManager.GetString(Name + "Meta"); } }
1718
public string Description { get { return RubberduckUI.ConstantNotUsed_; } }
1819
public CodeInspectionType InspectionType { get { return CodeInspectionType.CodeQualityIssues; } }
1920
public CodeInspectionSeverity Severity { get; set; }

RetailCoder.VBE/Inspections/DefaultProjectNameInspection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ public DefaultProjectNameInspection()
1818
}
1919

2020
public string Name { get { return "DefaultProjectNameInspection"; } }
21+
public string Meta { get { return InspectionsUI.ResourceManager.GetString(Name + "Meta"); } }
2122
public string Description { get { return RubberduckUI.GenericProjectName_; } }
2223
public CodeInspectionType InspectionType { get { return CodeInspectionType.MaintainabilityAndReadabilityIssues; } }
2324
public CodeInspectionSeverity Severity { get; set; }

RetailCoder.VBE/Inspections/EmptyStringLiteralInspection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public EmptyStringLiteralInspection()
1414
}
1515

1616
public string Name { get { return "EmptyStringLiteralInspection"; } }
17+
public string Meta { get { return InspectionsUI.ResourceManager.GetString(Name + "Meta"); } }
1718
public string Description { get { return InspectionsUI.EmptyStringLiteralInspection; } }
1819
public CodeInspectionType InspectionType { get { return CodeInspectionType.LanguageOpportunities; } }
1920
public CodeInspectionSeverity Severity { get; set; }

RetailCoder.VBE/Inspections/IInspection.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,10 @@ public interface IInspection : IInspectionModel
1313
/// </summary>
1414
/// <returns>Returns inspection results, if any.</returns>
1515
IEnumerable<CodeInspectionResultBase> GetInspectionResults(RubberduckParserState state);
16+
17+
/// <summary>
18+
/// Gets a string that contains additional/meta information about an inspection.
19+
/// </summary>
20+
string Meta { get; }
1621
}
1722
}

RetailCoder.VBE/Inspections/ImplicitActiveSheetReferenceInspection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ public ImplicitActiveSheetReferenceInspection(VBE vbe)
2222
}
2323

2424
public string Name { get { return "ImplicitActiveSheetReferenceInspection"; } }
25+
public string Meta { get { return InspectionsUI.ResourceManager.GetString(Name + "Meta"); } }
2526
public string Description { get { return RubberduckUI.ImplicitActiveSheetReference_; } }
2627
public CodeInspectionType InspectionType { get { return CodeInspectionType.MaintainabilityAndReadabilityIssues; } }
2728
public CodeInspectionSeverity Severity { get; set; }

RetailCoder.VBE/Inspections/ImplicitActiveWorkbookReferenceInspection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public ImplicitActiveWorkbookReferenceInspection(VBE vbe)
2020
}
2121

2222
public string Name { get { return "ImplicitActiveWorkbookReferenceInspection"; } }
23+
public string Meta { get { return InspectionsUI.ResourceManager.GetString(Name + "Meta"); } }
2324
public string Description { get { return RubberduckUI.ImplicitActiveWorkbookReference_; } }
2425
public CodeInspectionType InspectionType { get { return CodeInspectionType.MaintainabilityAndReadabilityIssues; } }
2526
public CodeInspectionSeverity Severity { get; set; }

RetailCoder.VBE/Inspections/ImplicitByRefParameterInspection.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ public ImplicitByRefParameterInspection()
1717
}
1818

1919
public string Name { get { return "ImplicitByRefParameterInspection"; } }
20+
public string Meta { get { return InspectionsUI.ResourceManager.GetString(Name + "Meta"); } }
2021
public string Description { get { return RubberduckUI.ImplicitByRef_; } }
2122
public CodeInspectionType InspectionType { get { return CodeInspectionType.CodeQualityIssues; } }
2223
public CodeInspectionSeverity Severity { get; set; }

0 commit comments

Comments
 (0)