File tree Expand file tree Collapse file tree
StyleCop.Analyzers/StyleCop.Analyzers.CodeFixes/MaintainabilityRules Expand file tree Collapse file tree Original file line number Diff line number Diff line change 33
44namespace StyleCop . Analyzers . MaintainabilityRules
55{
6+ using System ;
67 using System . Collections . Generic ;
78 using System . Collections . Immutable ;
89 using System . Composition ;
@@ -14,6 +15,7 @@ namespace StyleCop.Analyzers.MaintainabilityRules
1415 using Microsoft . CodeAnalysis . CSharp ;
1516 using Microsoft . CodeAnalysis . CSharp . Syntax ;
1617 using StyleCop . Analyzers . Helpers ;
18+ using StyleCop . Analyzers . Lightup ;
1719
1820 /// <summary>
1921 /// Implements a code fix for <see cref="SA1402FileMayOnlyContainASingleType"/>.
@@ -89,6 +91,10 @@ private static async Task<Solution> GetTransformedSolutionAsync(Document documen
8991 nodesToRemoveFromExtracted . Add ( child ) ;
9092 break ;
9193
94+ case SyntaxKindEx . FileScopedNamespaceDeclaration :
95+ // Only one file-scoped namespace is allowed per syntax tree
96+ throw new InvalidOperationException ( "This location is not reachable" ) ;
97+
9298 default :
9399 break ;
94100 }
You can’t perform that action at this time.
0 commit comments