Skip to content

Commit 86834c0

Browse files
committed
Declutter/Revert expression body.
1 parent 7d1696f commit 86834c0

File tree

1 file changed

+18
-7
lines changed

1 file changed

+18
-7
lines changed

Rubberduck.SmartIndenter/AbsoluteCodeLine.cs

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,23 @@ public string ContinuationRebuildText
137137

138138
public bool IsDeclarationContinuation { get; set; }
139139

140-
public bool HasDeclarationContinuation => (!IsProcedureStart && !ProcedureStartIgnoreRegex.IsMatch(_code))
141-
&& !ContainsOnlyComment
142-
&& string.IsNullOrEmpty(EndOfLineComment)
143-
&& HasContinuation
144-
&& ((IsDeclarationContinuation && Segments.Count() == 1) || DeclarationRegex.IsMatch(Segments.Last()));
140+
public bool HasDeclarationContinuation
141+
{
142+
get
143+
{
144+
if (!string.IsNullOrEmpty(EndOfLineComment)
145+
|| ContainsOnlyComment
146+
|| IsProcedureStart
147+
|| !HasContinuation
148+
|| ProcedureStartIgnoreRegex.IsMatch(_code))
149+
{
150+
return false;
151+
}
152+
153+
return (IsDeclarationContinuation && Segments.Count() == 1)
154+
|| DeclarationRegex.IsMatch(Segments.Last());
155+
}
156+
}
145157

146158
public bool HasContinuation => _code.Equals("_") || _code.EndsWith(" _") || EndOfLineComment.EndsWith(" _");
147159

@@ -161,8 +173,7 @@ public int EnumOrTypeEnds
161173

162174
public bool IsProcedureStart
163175
{
164-
get
165-
{ return _segments.Any(s => ProcedureStartRegex.IsMatch(s)) && !_segments.Any(s => ProcedureStartIgnoreRegex.IsMatch(s)); }
176+
get { return _segments.Any(s => ProcedureStartRegex.IsMatch(s)) && !_segments.Any(s => ProcedureStartIgnoreRegex.IsMatch(s)); }
166177
}
167178

168179
public bool IsProcedureEnd

0 commit comments

Comments
 (0)