File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ import 'package:analyzer/error/error.dart';
1818import 'package:analyzer/file_system/overlay_file_system.dart' ;
1919import 'package:analyzer/file_system/physical_file_system.dart' ;
2020import 'package:analyzer/source/line_info.dart' ;
21+ import 'package:analyzer/src/dart/error/syntactic_errors.g.dart' ;
2122import 'package:analyzer/src/error/codes.dart' ;
2223import 'package:analyzer/src/util/comment.dart' ;
2324import 'package:path/path.dart' as path;
@@ -353,6 +354,10 @@ class ValidateCommentCodeSamplesVisitor extends GeneralizingAstVisitor {
353354 return false ;
354355 });
355356
357+ // Don't error on annotations above library.
358+ errors.removeWhere (
359+ (e) => e.errorCode == ParserErrorCode .LIBRARY_DIRECTIVE_NOT_FIRST );
360+
356361 if (errors.isNotEmpty) {
357362 print ('$filePath :${sample .lineStartOffset }: ${errors .length } errors' );
358363
You can’t perform that action at this time.
0 commit comments