File tree 1 file changed +5
-0
lines changed
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';
18
18
import 'package:analyzer/file_system/overlay_file_system.dart' ;
19
19
import 'package:analyzer/file_system/physical_file_system.dart' ;
20
20
import 'package:analyzer/source/line_info.dart' ;
21
+ import 'package:analyzer/src/dart/error/syntactic_errors.g.dart' ;
21
22
import 'package:analyzer/src/error/codes.dart' ;
22
23
import 'package:analyzer/src/util/comment.dart' ;
23
24
import 'package:path/path.dart' as path;
@@ -353,6 +354,10 @@ class ValidateCommentCodeSamplesVisitor extends GeneralizingAstVisitor {
353
354
return false ;
354
355
});
355
356
357
+ // Don't error on annotations above library.
358
+ errors.removeWhere (
359
+ (e) => e.errorCode == ParserErrorCode .LIBRARY_DIRECTIVE_NOT_FIRST );
360
+
356
361
if (errors.isNotEmpty) {
357
362
print ('$filePath :${sample .lineStartOffset }: ${errors .length } errors' );
358
363
You can’t perform that action at this time.
0 commit comments