Skip to content

Commit e4a415d

Browse files
Hosch250retailcoder
authored andcommitted
Display only one parser error tab, even with multiple clicks. (#1590)
* Display only one parser error tab, even with multiple clicks. * Properly close only parser error tabs.
1 parent 95b0fe4 commit e4a415d

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

RetailCoder.VBE/Inspections/IParseTreeInspection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
namespace Rubberduck.Inspections
66
{
7-
internal interface IParseTreeInspection : IInspection
7+
public interface IParseTreeInspection : IInspection
88
{
99
ParseTreeResults ParseTreeResults { get; set; }
1010
}

RetailCoder.VBE/Inspections/ParameterNotUsedInspection.cs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,12 @@ public sealed class ParameterNotUsedInspection : InspectionBase
1616
{
1717
private readonly VBE _vbe;
1818
private readonly IMessageBox _messageBox;
19-
private readonly ICodePaneWrapperFactory _wrapperFactory;
2019

2120
public ParameterNotUsedInspection(VBE vbe, RubberduckParserState state, IMessageBox messageBox)
2221
: base(state)
2322
{
2423
_vbe = vbe;
2524
_messageBox = messageBox;
26-
_wrapperFactory = new CodePaneWrapperFactory();
2725
}
2826

2927
public override string Meta { get { return InspectionsUI.ParameterNotUsedInspectionName; }}

RetailCoder.VBE/UI/Command/ShowParserErrorsCommand.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,16 @@ public override void Execute(object parameter)
4242
return;
4343
}
4444

45+
var oldTab = _viewModel.Tabs.FirstOrDefault(tab => tab.Header == RubberduckUI.Parser_ParserError);
46+
4547
_viewModel.AddTab(viewModel);
4648
_viewModel.SelectedTab = viewModel;
4749

50+
if (oldTab != null)
51+
{
52+
oldTab.CloseCommand.Execute(null);
53+
}
54+
4855
try
4956
{
5057
var presenter = _presenterService.Presenter(_viewModel);

RetailCoder.VBE/UI/ParserErrors/ParserErrorsPresenter.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,6 @@
66

77
namespace Rubberduck.UI.ParserErrors
88
{
9-
public interface IParserErrorsPresenterFactory
10-
{
11-
IParserErrorsPresenter Create();
12-
}
13-
149
public interface IParserErrorsPresenter
1510
{
1611
void Show();

0 commit comments

Comments
 (0)