Skip to content

Commit a6efbfd

Browse files
committed
restore more changes lost in merge
1 parent c2d0129 commit a6efbfd

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers/LayoutRules/SA1516ElementsMustBeSeparatedByBlankLine.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,35 @@ private static void HandleFileScopedNamespaceDeclaration(SyntaxNodeAnalysisConte
219219
{
220220
var namespaceDeclaration = (BaseNamespaceDeclarationSyntaxWrapper)context.Node;
221221

222+
var usings = namespaceDeclaration.Usings;
222223
var members = namespaceDeclaration.Members;
223224

225+
HandleUsings(context, usings, settings);
224226
HandleMemberList(context, members);
225227

228+
if (namespaceDeclaration.Externs.Count > 0)
229+
{
230+
ReportIfThereIsNoBlankLine(context, namespaceDeclaration.Name, namespaceDeclaration.Externs[0]);
231+
}
232+
233+
if (namespaceDeclaration.Usings.Count > 0)
234+
{
235+
ReportIfThereIsNoBlankLine(context, namespaceDeclaration.Name, namespaceDeclaration.Usings[0]);
236+
237+
if (namespaceDeclaration.Externs.Count > 0)
238+
{
239+
ReportIfThereIsNoBlankLine(context, namespaceDeclaration.Externs[namespaceDeclaration.Externs.Count - 1], namespaceDeclaration.Usings[0]);
240+
}
241+
}
242+
226243
if (members.Count > 0)
227244
{
228245
ReportIfThereIsNoBlankLine(context, namespaceDeclaration.Name, members[0]);
246+
247+
if (namespaceDeclaration.Usings.Count > 0)
248+
{
249+
ReportIfThereIsNoBlankLine(context, usings[usings.Count - 1], members[0]);
250+
}
229251
}
230252
}
231253

0 commit comments

Comments
 (0)