@@ -12,11 +12,6 @@ import 'dart:async';
12
12
import 'dart:convert' ;
13
13
import 'dart:io' ;
14
14
15
- import 'package:analyzer/dart/analysis/results.dart' ;
16
- import 'package:analyzer/error/error.dart' ;
17
- import 'package:analyzer/src/error/codes.dart' ;
18
- import 'package:analyzer/src/generated/engine.dart' ;
19
- import 'package:analyzer/src/generated/source.dart' ;
20
15
import 'package:dartdoc/src/dartdoc_options.dart' ;
21
16
import 'package:dartdoc/src/generator.dart' ;
22
17
import 'package:dartdoc/src/html/html_generator.dart' ;
@@ -81,54 +76,6 @@ class Dartdoc extends PackageBuilder {
81
76
82
77
Stream <String > get onCheckProgress => _onCheckProgress.stream;
83
78
84
- @override
85
- Future <void > logAnalysisErrors (Set <Source > sources) async {
86
- List <AnalysisErrorInfo > errorInfos = [];
87
- // TODO(jcollins-g): figure out why sources can't contain includeExternals
88
- // or embedded SDK components without having spurious(?) analysis errors.
89
- // That seems wrong. dart-lang/dartdoc#1547
90
- for (Source source in sources) {
91
- ErrorsResult errorsResult = await driver.getErrors (source.fullName);
92
- AnalysisErrorInfo info =
93
- new AnalysisErrorInfoImpl (errorsResult.errors, errorsResult.lineInfo);
94
- List <_Error > errors = [info]
95
- .expand ((AnalysisErrorInfo info) {
96
- return info.errors.map ((error) => new _Error (
97
- error, info.lineInfo, config.topLevelPackageMeta.dir.path));
98
- })
99
- .where ((_Error error) => error.isError)
100
- .toList ()
101
- ..sort ();
102
- // TODO(jcollins-g): Why does the SDK have analysis errors? Annotations
103
- // seem correctly formed. dart-lang/dartdoc#1547
104
- if (errors.isNotEmpty && ! source.uri.toString ().startsWith ('dart:' )) {
105
- errorInfos.add (info);
106
- logWarning (
107
- 'analysis errors from source: ${source .uri .toString ()} (${source .toString ()}' );
108
- errors.forEach (logWarning);
109
- }
110
- }
111
-
112
- List <_Error > errors = errorInfos
113
- .expand ((AnalysisErrorInfo info) {
114
- return info.errors.map ((error) => new _Error (
115
- error, info.lineInfo, config.topLevelPackageMeta.dir.path));
116
- })
117
- .where ((_Error error) => error.isError)
118
- // TODO(jcollins-g): remove after conversion to analysis driver
119
- .where ((_Error error) =>
120
- error.error.errorCode !=
121
- CompileTimeErrorCode .URI_HAS_NOT_BEEN_GENERATED )
122
- .toList ()
123
- ..sort ();
124
-
125
- if (errors.isNotEmpty) {
126
- int len = errors.length;
127
- throw new DartdocFailure (
128
- "encountered ${len } analysis error${len == 1 ? '' : 's' }" );
129
- }
130
- }
131
-
132
79
PackageGraph packageGraph;
133
80
134
81
/// Generate Dartdoc documentation.
@@ -434,39 +381,3 @@ class DartdocResults {
434
381
435
382
DartdocResults (this .packageMeta, this .packageGraph, this .outDir);
436
383
}
437
-
438
- class _Error implements Comparable <_Error > {
439
- final AnalysisError error;
440
- final LineInfo lineInfo;
441
- final String projectPath;
442
-
443
- _Error (this .error, this .lineInfo, this .projectPath);
444
-
445
- String get description => '${error .message } at ${location }, line ${line }.' ;
446
- bool get isError => error.errorCode.errorSeverity == ErrorSeverity .ERROR ;
447
- int get line => lineInfo.getLocation (error.offset).lineNumber;
448
- String get location {
449
- String path = error.source.fullName;
450
- if (path.startsWith (projectPath)) {
451
- path = path.substring (projectPath.length + 1 );
452
- }
453
- return path;
454
- }
455
-
456
- int get severity => error.errorCode.errorSeverity.ordinal;
457
-
458
- String get severityName => error.errorCode.errorSeverity.displayName;
459
-
460
- @override
461
- int compareTo (_Error other) {
462
- if (severity == other.severity) {
463
- int cmp = error.source.fullName.compareTo (other.error.source.fullName);
464
- return cmp == 0 ? line - other.line : cmp;
465
- } else {
466
- return other.severity - severity;
467
- }
468
- }
469
-
470
- @override
471
- String toString () => '[${severityName }] ${description }' ;
472
- }
0 commit comments