Skip to content

Commit bcbed2d

Browse files
committed
fixed failed assert: selection.StartColumn > 0
1 parent 594e374 commit bcbed2d

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

RetailCoder.VBE/Common/DeclarationExtensions.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,7 @@ public static Selection GetVariableStmtContextSelection(this Declaration target)
4646
}
4747

4848
var statement = GetVariableStmtContext(target) ?? target.Context; // undeclared variables don't have a VariableStmtContext
49-
50-
return new Selection(statement.Start.Line, statement.Start.Column,
51-
statement.Stop.Line, statement.Stop.Column);
49+
return statement.GetSelection();
5250
}
5351

5452
/// <summary>
@@ -65,9 +63,7 @@ public static Selection GetConstStmtContextSelection(this Declaration target)
6563
}
6664

6765
var statement = GetConstStmtContext(target);
68-
69-
return new Selection(statement.Start.Line, statement.Start.Column,
70-
statement.Stop.Line, statement.Stop.Column);
66+
return statement.GetSelection();
7167
}
7268

7369
/// <summary>
@@ -128,7 +124,6 @@ public static bool HasMultipleDeclarationsInStatement(this Declaration target)
128124
}
129125

130126
var statement = target.Context.Parent as VBAParser.VariableListStmtContext;
131-
132127
return statement != null && statement.children.OfType<VBAParser.VariableSubStmtContext>().Count() > 1;
133128
}
134129

0 commit comments

Comments
 (0)