@@ -47,9 +47,9 @@ List<Diagnostic> analyzeAnalysisOptions(
4747 void addDirectErrorOrIncludedError (
4848 List <Diagnostic > validationErrors,
4949 Source source, {
50- required bool sourceIsOptionsForContextRoot ,
50+ required bool isSourcePrimary ,
5151 }) {
52- if (! sourceIsOptionsForContextRoot ) {
52+ if (! isSourcePrimary ) {
5353 // [source] is an included file, and we should only report errors in
5454 // [initialSource], noting that the included file has warnings.
5555 for (Diagnostic error in validationErrors) {
@@ -78,18 +78,18 @@ List<Diagnostic> analyzeAnalysisOptions(
7878
7979 // Validates the specified options and any included option files.
8080 void validate (Source source, YamlMap options) {
81- var sourceIsOptionsForContextRoot = initialIncludeSpan == null ;
81+ var isSourcePrimary = initialIncludeSpan == null ;
8282 var validationErrors = OptionsFileValidator (
8383 source,
8484 sdkVersionConstraint: sdkVersionConstraint,
85- sourceIsOptionsForContextRoot : sourceIsOptionsForContextRoot ,
85+ isPrimarySource : isSourcePrimary ,
8686 optionsProvider: optionsProvider,
8787 resourceProvider: resourceProvider,
8888 ).validate (options);
8989 addDirectErrorOrIncludedError (
9090 validationErrors,
9191 source,
92- sourceIsOptionsForContextRoot : sourceIsOptionsForContextRoot ,
92+ isSourcePrimary : isSourcePrimary ,
9393 );
9494
9595 var includeNode = options.valueAt (AnalysisOptionsFile .include);
@@ -99,7 +99,7 @@ List<Diagnostic> analyzeAnalysisOptions(
9999 addDirectErrorOrIncludedError (
100100 _validateLegacyPluginsOption (source, options: options),
101101 source,
102- sourceIsOptionsForContextRoot : sourceIsOptionsForContextRoot ,
102+ isSourcePrimary : isSourcePrimary ,
103103 );
104104 return ;
105105 }
@@ -178,7 +178,7 @@ List<Diagnostic> analyzeAnalysisOptions(
178178 firstEnabledPluginName: firstPluginName,
179179 ),
180180 source,
181- sourceIsOptionsForContextRoot : sourceIsOptionsForContextRoot ,
181+ isSourcePrimary : isSourcePrimary ,
182182 );
183183 } on OptionsFormatException catch (e) {
184184 var args = [
@@ -208,7 +208,7 @@ List<Diagnostic> analyzeAnalysisOptions(
208208 };
209209
210210 for (var includeValue in includes) {
211- if (sourceIsOptionsForContextRoot ) {
211+ if (isSourcePrimary ) {
212212 initialIncludeSpan = null ;
213213 includeChain.clear ();
214214 }
@@ -296,7 +296,7 @@ class OptionsFileValidator {
296296 OptionsFileValidator (
297297 this ._source, {
298298 VersionConstraint ? sdkVersionConstraint,
299- required bool sourceIsOptionsForContextRoot ,
299+ required bool isPrimarySource ,
300300 required AnalysisOptionsProvider optionsProvider,
301301 required ResourceProvider resourceProvider,
302302 }) : _validators = [
@@ -308,7 +308,7 @@ class OptionsFileValidator {
308308 resourceProvider: resourceProvider,
309309 optionsProvider: optionsProvider,
310310 sdkVersionConstraint: sdkVersionConstraint,
311- sourceIsOptionsForContextRoot : sourceIsOptionsForContextRoot ,
311+ isPrimarySource : isPrimarySource ,
312312 ),
313313 _PluginsOptionsValidator (),
314314 ];
@@ -1077,12 +1077,12 @@ class _StrongModeOptionValueValidator extends OptionsValidator {
10771077/// - lib/generated/
10781078/// ```
10791079class _TopLevelOptionValidator extends OptionsValidator {
1080- final String pluginName ;
1080+ final String sectionName ;
10811081 final Set <String > supportedOptions;
10821082 final String _valueProposal;
10831083 final AnalysisOptionsWarningCode _warningCode;
10841084
1085- _TopLevelOptionValidator (this .pluginName , this .supportedOptions)
1085+ _TopLevelOptionValidator (this .sectionName , this .supportedOptions)
10861086 : assert (supportedOptions.isNotEmpty),
10871087 _valueProposal = supportedOptions.quotedAndCommaSeparatedWithAnd,
10881088 _warningCode = supportedOptions.length == 1
@@ -1091,7 +1091,7 @@ class _TopLevelOptionValidator extends OptionsValidator {
10911091
10921092 @override
10931093 void validate (DiagnosticReporter reporter, YamlMap options) {
1094- var node = options.valueAt (pluginName );
1094+ var node = options.valueAt (sectionName );
10951095 if (node == null ) return ;
10961096 if (node is YamlScalar && node.value == null ) return ;
10971097
@@ -1109,7 +1109,7 @@ class _TopLevelOptionValidator extends OptionsValidator {
11091109 reporter.atSourceSpan (
11101110 k.span,
11111111 _warningCode,
1112- arguments: [pluginName , k.valueOrThrow, _valueProposal],
1112+ arguments: [sectionName , k.valueOrThrow, _valueProposal],
11131113 );
11141114 }
11151115 }
0 commit comments