Skip to content

Commit 7281f31

Browse files
committed
piped inspection results through parserstate - inspector is officially useless, ...and parsetree inspections are officially broken.
1 parent b021223 commit 7281f31

Some content is hidden

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

44 files changed

+327
-285
lines changed

RetailCoder.VBE/App.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ public App(IVBE vbe,
6969
private void State_StatusMessageUpdate(object sender, RubberduckStatusMessageEventArgs e)
7070
{
7171
var message = e.Message;
72-
if (message == ParserState.LoadingReference.ToString())
73-
{
74-
// note: ugly hack to enable Rubberduck.Parsing assembly to do this
75-
message = RubberduckUI.ParserState_LoadingReference;
76-
}
72+
//if (message == ParserState.LoadingReference.ToString())
73+
//{
74+
// // note: ugly hack to enable Rubberduck.Parsing assembly to do this
75+
// message = ParsingText.ParserState_LoadingReference;
76+
//}
7777

7878
_stateBar.SetStatusLabelCaption(message, _parser.State.ModuleExceptions.Count);
7979
}

RetailCoder.VBE/Refactorings/ExtractInterface/ExtractInterfaceRefactoring.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ private void AddInterface()
122122
private int _insertionLine;
123123
private void _state_StateChanged(object sender, EventArgs e)
124124
{
125-
if (_state.Status != ParserState.Ready)
125+
if (!_state.Status.IsResolvedOrReady())
126126
{
127127
return;
128128
}

RetailCoder.VBE/UI/CodeExplorer/Commands/FindAllImplementationsCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public FindAllImplementationsCommand(RubberduckParserState state, Command.FindAl
1919

2020
protected override bool CanExecuteImpl(object parameter)
2121
{
22-
return _state.Status == ParserState.Ready &&
22+
return _state.Status.IsResolvedOrReady() &&
2323
(parameter is CodeExplorerComponentViewModel ||
2424
parameter is CodeExplorerMemberViewModel);
2525
}

RetailCoder.VBE/UI/CodeExplorer/Commands/FindAllReferencesCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public FindAllReferencesCommand(RubberduckParserState state, Command.FindAllRefe
1919

2020
protected override bool CanExecuteImpl(object parameter)
2121
{
22-
return _state.Status == ParserState.Ready &&
22+
return _state.Status.IsResolvedOrReady() &&
2323
parameter != null &&
2424
!(parameter is CodeExplorerCustomFolderViewModel);
2525
}

RetailCoder.VBE/UI/CodeExplorer/Commands/IndentCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ protected override bool CanExecuteImpl(object parameter)
4242

4343
if (parameter is CodeExplorerProjectViewModel)
4444
{
45-
if (_state.Status != ParserState.Ready)
45+
if (!_state.Status.IsResolvedOrReady())
4646
{
4747
return false;
4848
}
@@ -56,7 +56,7 @@ protected override bool CanExecuteImpl(object parameter)
5656

5757
if (parameter is CodeExplorerCustomFolderViewModel)
5858
{
59-
if (_state.Status != ParserState.Ready)
59+
if (!_state.Status.IsResolvedOrReady())
6060
{
6161
return false;
6262
}
@@ -67,7 +67,7 @@ protected override bool CanExecuteImpl(object parameter)
6767
.Any(d => d.Annotations.All(a => a.AnnotationType != AnnotationType.NoIndent));
6868
}
6969

70-
return _state.Status == ParserState.Ready;
70+
return _state.Status.IsResolvedOrReady();
7171
}
7272

7373
protected override void ExecuteImpl(object parameter)

RetailCoder.VBE/UI/CodeExplorer/Commands/RenameCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public RenameCommand(IVBE vbe, RubberduckParserState state, IRenameDialog view,
2626

2727
protected override bool CanExecuteImpl(object parameter)
2828
{
29-
return _state.Status == ParserState.Ready && parameter is ICodeExplorerDeclarationViewModel;
29+
return _state.Status.IsResolvedOrReady() && parameter is ICodeExplorerDeclarationViewModel;
3030
}
3131

3232
protected override void ExecuteImpl(object parameter)

RetailCoder.VBE/UI/Command/AddTestMethodCommand.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ public AddTestMethodCommand(IVBE vbe, RubberduckParserState state) : base(LogMan
4545

4646
protected override bool CanExecuteImpl(object parameter)
4747
{
48-
if (_state.Status != ParserState.Ready || _vbe.ActiveCodePane == null) { return false; }
48+
if (_state.Status.IsResolvedOrReady() || _vbe.ActiveCodePane == null)
49+
{
50+
return false;
51+
}
4952

5053
var testModules = _state.AllUserDeclarations.Where(d =>
5154
d.DeclarationType == DeclarationType.ProceduralModule &&

RetailCoder.VBE/UI/Command/AddTestMethodExpectedErrorCommand.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ protected override bool CanExecuteImpl(object parameter)
5252
{
5353
var pane = _vbe.ActiveCodePane;
5454
{
55-
if (_state.Status != ParserState.Ready || pane.IsWrappingNullReference)
55+
if (_state.Status.IsResolvedOrReady() || pane.IsWrappingNullReference)
5656
{
5757
return false;
5858
}

RetailCoder.VBE/UI/Command/CommandBase.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using System.Runtime.InteropServices;
55
using System.Windows.Input;
66
using NLog;
7+
using Rubberduck.Parsing.VBA;
78
using Rubberduck.Settings;
89

910
namespace Rubberduck.UI.Command

RetailCoder.VBE/UI/Command/FindAllImplementationsCommand.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ private Declaration FindNewDeclaration(Declaration declaration)
5454

5555
private void _state_StateChanged(object sender, ParserStateEventArgs e)
5656
{
57-
if (e.State != ParserState.Ready) { return; }
57+
if (e.State.IsResolvedOrReady()) { return; }
5858

5959
if (_viewModel == null) { return; }
6060

@@ -90,7 +90,7 @@ private void UpdateTab()
9090

9191
protected override bool CanExecuteImpl(object parameter)
9292
{
93-
if (_vbe.ActiveCodePane == null || _state.Status != ParserState.Ready)
93+
if (_vbe.ActiveCodePane == null || _state.Status.IsResolvedOrReady())
9494
{
9595
return false;
9696
}
@@ -103,7 +103,7 @@ protected override bool CanExecuteImpl(object parameter)
103103

104104
protected override void ExecuteImpl(object parameter)
105105
{
106-
if (_state.Status != ParserState.Ready)
106+
if (_state.Status.IsResolvedOrReady())
107107
{
108108
return;
109109
}

0 commit comments

Comments
 (0)