@@ -108,6 +108,26 @@ internal static bool IsStyleCopSettingsFile(string path)
108108 || string . Equals ( fileName , AltSettingsFileName , StringComparison . OrdinalIgnoreCase ) ;
109109 }
110110
111+ private static StyleCopSettings GetStyleCopSettings ( AnalyzerOptions options , SyntaxTree tree , ImmutableArray < AdditionalText > additionalFiles , DeserializationFailureBehavior failureBehavior , CancellationToken cancellationToken )
112+ {
113+ foreach ( var additionalFile in additionalFiles )
114+ {
115+ if ( IsStyleCopSettingsFile ( additionalFile . Path ) )
116+ {
117+ SourceText additionalTextContent = additionalFile . GetText ( cancellationToken ) ;
118+ return GetStyleCopSettings ( options , tree , additionalFile . Path , additionalTextContent , failureBehavior ) ;
119+ }
120+ }
121+
122+ if ( tree != null )
123+ {
124+ var optionsProvider = options . AnalyzerConfigOptionsProvider ( ) . GetOptions ( tree ) ;
125+ return new StyleCopSettings ( new JsonObject ( ) , optionsProvider ) ;
126+ }
127+
128+ return new StyleCopSettings ( ) ;
129+ }
130+
111131 private static StyleCopSettings GetStyleCopSettings ( AnalyzerOptions options , SyntaxTree tree , string path , SourceText text , DeserializationFailureBehavior failureBehavior )
112132 {
113133 var optionsProvider = options . AnalyzerConfigOptionsProvider ( ) . GetOptions ( tree ) ;
@@ -146,25 +166,5 @@ private static StyleCopSettings GetStyleCopSettings(AnalyzerOptions options, Syn
146166
147167 return new StyleCopSettings ( ) ;
148168 }
149-
150- private static StyleCopSettings GetStyleCopSettings ( AnalyzerOptions options , SyntaxTree tree , ImmutableArray < AdditionalText > additionalFiles , DeserializationFailureBehavior failureBehavior , CancellationToken cancellationToken )
151- {
152- foreach ( var additionalFile in additionalFiles )
153- {
154- if ( IsStyleCopSettingsFile ( additionalFile . Path ) )
155- {
156- SourceText additionalTextContent = additionalFile . GetText ( cancellationToken ) ;
157- return GetStyleCopSettings ( options , tree , additionalFile . Path , additionalTextContent , failureBehavior ) ;
158- }
159- }
160-
161- if ( tree != null )
162- {
163- var optionsProvider = options . AnalyzerConfigOptionsProvider ( ) . GetOptions ( tree ) ;
164- return new StyleCopSettings ( new JsonObject ( ) , optionsProvider ) ;
165- }
166-
167- return new StyleCopSettings ( ) ;
168- }
169169 }
170170}
0 commit comments