Skip to content

Commit 318ea05

Browse files
rubberduck203Hosch250
authored andcommitted
Handled untrapped Cancellation exception.
Added webhook notification for Duga try a hook with the room id Added doc comments to the MockFactory closes #630. Also removed some dead code. Removed unused using directive. Switching branch now, promise. Disable button and close #637 Better disabling Everything is working except the Add button removed unneeded R# hint-killer comments fixed issue with FindAllReferences, which was only returning references in the same module as selection, of declarations located in the same module too. moved website link a bit to the right, off the left border. added plural and singular resources for issues; fixes localization issue in languages where plural form doesn't involve appending an "s" (removed hard-coded "s") added more Swedish translations Got popup working Just to have it... More commits Actually add marker on OK Remove unfixable tests, fix others. Sort todo grid, new test(s) Get things working after adding the sort functionality. Add ignored file Clean up GridViewSort, add broken test Fix busted test More tests, bug fix Kill TaskPriority Another test works More tests More Localizations Kill bug
1 parent 59b95d9 commit 318ea05

40 files changed

+1320
-634
lines changed

RetailCoder.VBE/Rubberduck.csproj

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,13 @@
283283
<Compile Include="Inspections\VariableNotAssignedInspection.cs" />
284284
<Compile Include="Inspections\IdentifierNotAssignedInspectionResult.cs" />
285285
<Compile Include="UI\FolderBrowser.cs" />
286+
<Compile Include="UI\Settings\AddMarkerForm.cs">
287+
<SubType>Form</SubType>
288+
</Compile>
289+
<Compile Include="UI\Settings\AddMarkerForm.Designer.cs">
290+
<DependentUpon>AddMarkerForm.cs</DependentUpon>
291+
</Compile>
292+
<Compile Include="UI\Settings\IAddTodoSettingsView.cs" />
286293
<Compile Include="UI\SourceControl\App.cs" />
287294
<Compile Include="Properties\Annotations.cs" />
288295
<Compile Include="Properties\Resources.Designer.cs">
@@ -466,7 +473,7 @@
466473
<Compile Include="Inspections\OptionExplicitInspectionResult.cs" />
467474
<Compile Include="Inspections\VariableTypeNotDeclaredInspection.cs" />
468475
<Compile Include="Inspections\VariableTypeNotDeclaredInspectionResult.cs" />
469-
<Compile Include="ToDoItems\TaskPriority.cs" />
476+
<Compile Include="ToDoItems\TodoPriority.cs" />
470477
<Compile Include="UI\AboutWindow.cs">
471478
<SubType>Form</SubType>
472479
</Compile>
@@ -591,6 +598,9 @@
591598
<DependentUpon>FindSymbolDialog.cs</DependentUpon>
592599
</EmbeddedResource>
593600
<EmbeddedResource Include="UI\RubberduckUI.sv.resx" />
601+
<EmbeddedResource Include="UI\Settings\AddMarkerForm.resx">
602+
<DependentUpon>AddMarkerForm.cs</DependentUpon>
603+
</EmbeddedResource>
594604
<EmbeddedResource Include="UI\SimpleListControl.resx">
595605
<DependentUpon>SimpleListControl.cs</DependentUpon>
596606
</EmbeddedResource>

RetailCoder.VBE/Settings/CodeInspectionSettings.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.Xml.Serialization;
3-
using Microsoft.Office.Interop.Excel;
43
using Rubberduck.Inspections;
54
using Rubberduck.UI;
65

RetailCoder.VBE/Settings/ConfigurationLoader.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Reflection;
66
using System.Windows.Forms;
77
using Rubberduck.Inspections;
8+
using Rubberduck.ToDoItems;
89
using Rubberduck.UI;
910

1011
namespace Rubberduck.Settings
@@ -113,7 +114,7 @@ public Configuration GetDefaultConfiguration()
113114
public ToDoMarker[] GetDefaultTodoMarkers()
114115
{
115116
var note = new ToDoMarker(RubberduckUI.ToDoMarkerNote, TodoPriority.Low);
116-
var todo = new ToDoMarker(RubberduckUI.ToDoMarkerToDo, TodoPriority.Normal);
117+
var todo = new ToDoMarker(RubberduckUI.ToDoMarkerToDo, TodoPriority.Medium);
117118
var bug = new ToDoMarker(RubberduckUI.ToDoMarkerBug, TodoPriority.High);
118119

119120
return new[] { note, todo, bug };

RetailCoder.VBE/Settings/ToDoMarkers.cs

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,10 @@
1-
using System.Xml.Serialization;
1+
using System;
2+
using System.Xml.Serialization;
3+
using Rubberduck.ToDoItems;
4+
using Rubberduck.UI;
25

36
namespace Rubberduck.Settings
47
{
5-
public enum TodoPriority
6-
{
7-
Low,
8-
Normal,
9-
High
10-
}
11-
128
public interface IToDoMarker
139
{
1410
TodoPriority Priority { get; set; }
@@ -25,6 +21,23 @@ public class ToDoMarker : IToDoMarker
2521
[XmlAttribute]
2622
public TodoPriority Priority { get; set; }
2723

24+
[XmlIgnore]
25+
public string PriorityLabel
26+
{
27+
get { return RubberduckUI.ResourceManager.GetString("ToDoPriority_" + Priority, RubberduckUI.Culture); }
28+
set
29+
{
30+
foreach (var priority in Enum.GetValues(typeof(TodoPriority)))
31+
{
32+
if (value == RubberduckUI.ResourceManager.GetString("ToDoPriority_" + priority, RubberduckUI.Culture))
33+
{
34+
Priority = (TodoPriority)priority;
35+
return;
36+
}
37+
}
38+
}
39+
}
40+
2841
/// <summary> Default constructor is required for serialization. DO NOT USE. </summary>
2942
public ToDoMarker()
3043
{
@@ -43,5 +56,19 @@ public override string ToString()
4356
{
4457
return this.Text;
4558
}
59+
60+
public override bool Equals(object obj)
61+
{
62+
var other = (ToDoMarker)obj;
63+
64+
// no need to check PriorityLabel as it soley relies on Priority - if one is wrong, the other has to be too
65+
return Text == other.Text &&
66+
Priority == other.Priority;
67+
}
68+
69+
public override int GetHashCode()
70+
{
71+
return Text.GetHashCode();
72+
}
4673
}
4774
}

RetailCoder.VBE/ToDoItems/ToDoItem.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ namespace Rubberduck.ToDoItems
1010
/// </summary>
1111
public class ToDoItem
1212
{
13-
private readonly TaskPriority _priority;
14-
public TaskPriority Priority{ get { return _priority; } }
13+
private readonly TodoPriority _priority;
14+
public TodoPriority Priority { get { return _priority; } }
1515

1616
public string PriorityLabel { get { return RubberduckUI.ResourceManager.GetString("ToDoPriority_" + Priority, RubberduckUI.Culture); } }
1717

@@ -30,12 +30,12 @@ public class ToDoItem
3030
private readonly QualifiedSelection _selection;
3131
public QualifiedSelection GetSelection() { return _selection; }
3232

33-
public ToDoItem(TaskPriority priority, CommentNode comment)
33+
public ToDoItem(TodoPriority priority, CommentNode comment)
3434
: this(priority, comment.CommentText, comment.QualifiedSelection)
3535
{
3636
}
3737

38-
public ToDoItem(TaskPriority priority, string description, QualifiedSelection qualifiedSelection)
38+
public ToDoItem(TodoPriority priority, string description, QualifiedSelection qualifiedSelection)
3939
{
4040
_priority = priority;
4141
_description = description;

RetailCoder.VBE/ToDoItems/TaskPriority.cs renamed to RetailCoder.VBE/ToDoItems/TodoPriority.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
namespace Rubberduck.ToDoItems
22
{
3-
public enum TaskPriority
3+
public enum TodoPriority
44
{
55
Low,
66
Medium,

RetailCoder.VBE/UI/AboutWindow.Designer.cs

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

RetailCoder.VBE/UI/CodeInspections/CodeInspectionsDockablePresenter.cs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,10 @@ private void ToggleParsingStatus(bool isParsing = true)
100100
private void Control_CopyResultsToClipboard(object sender, EventArgs e)
101101
{
102102
var results = string.Join("\n", _results.Select(FormatResultForClipboard));
103-
var text = string.Format(RubberduckUI.CodeInspections_NumberOfIssuesFound, DateTime.Now, _results.Count, (_results.Count != 1 ? "s" : string.Empty)) + results;
103+
var resource = _results.Count == 1
104+
? RubberduckUI.CodeInspections_NumberOfIssuesFound_Singular
105+
: RubberduckUI.CodeInspections_NumberOfIssuesFound_Plural;
106+
var text = string.Format(resource, DateTime.Now, _results.Count) + results;
104107

105108
Clipboard.SetText(text);
106109
}
@@ -198,6 +201,11 @@ private async Task RefreshAsync(CancellationToken token)
198201
var projectParseResult = await _inspector.Parse(VBE.ActiveVBProject, this);
199202
_results = await _inspector.FindIssuesAsync(projectParseResult, token);
200203
}
204+
catch (TaskCanceledException)
205+
{
206+
// If FindIssuesAsync is canceled, we can leave the old results or
207+
// create a new List. Let's leave the old ones for now.
208+
}
201209
catch (COMException)
202210
{
203211
// burp

0 commit comments

Comments
 (0)