| Index: pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/incremental_resolver.dart b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| index ab02202fe8a96c944f330ec64b2aa0d0a24ba162..d5769f9ebba50ecba01d8d9778445ea5326611a0 100644
|
| --- a/pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| +++ b/pkg/analyzer/lib/src/generated/incremental_resolver.dart
|
| @@ -1212,9 +1212,9 @@ class PoorMansIncrementalResolver {
|
| _updateDelta = newUnit.length - oldUnit.length;
|
| // A Dart documentation comment change.
|
| if (firstPair.kind == _TokenDifferenceKind.COMMENT_DOC) {
|
| - _resolveComment(oldUnit, newUnit, firstPair);
|
| - logger.log('Success.');
|
| - return true;
|
| + bool success = _resolveComment(oldUnit, newUnit, firstPair);
|
| + logger.log('Documentation comment resolved: $success');
|
| + return success;
|
| }
|
| // A pure whitespace change.
|
| if (firstPair.kind == _TokenDifferenceKind.OFFSET) {
|
| @@ -1333,11 +1333,21 @@ class PoorMansIncrementalResolver {
|
| }
|
| }
|
|
|
| - void _resolveComment(CompilationUnit oldUnit, CompilationUnit newUnit,
|
| + /**
|
| + * Attempts to resolve a documentation comment change.
|
| + * Returns `true` if success.
|
| + */
|
| + bool _resolveComment(CompilationUnit oldUnit, CompilationUnit newUnit,
|
| _TokenPair firstPair) {
|
| Token oldToken = firstPair.oldToken;
|
| - CommentToken precedingComments = oldToken.precedingComments;
|
| - int offset = precedingComments.offset;
|
| + Token newToken = firstPair.newToken;
|
| + CommentToken oldComments = oldToken.precedingComments;
|
| + CommentToken newComments = newToken.precedingComments;
|
| + if (oldComments == null || newComments == null) {
|
| + return false;
|
| + }
|
| + // find nodes
|
| + int offset = oldComments.offset;
|
| logger.log('offset: $offset');
|
| Comment oldComment = _findNodeCovering(oldUnit, offset, offset);
|
| Comment newComment = _findNodeCovering(newUnit, offset, offset);
|
| @@ -1359,6 +1369,8 @@ class PoorMansIncrementalResolver {
|
| _updateEntry();
|
| // resolve references in the comment
|
| incrementalResolver._resolveReferences(newComment);
|
| + // OK
|
| + return true;
|
| }
|
|
|
| Token _scan(String code) {
|
|
|