Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Side by Side Diff: pkg/analyzer/lib/src/generated/incremental_resolver.dart

Issue 2238443003: Fix for updating documentationComment for top-level variables. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer.src.generated.incremental_resolver; 5 library analyzer.src.generated.incremental_resolver;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' as math; 8 import 'dart:math' as math;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 782 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 incrementalResolver._updateCache(); 793 incrementalResolver._updateCache();
794 incrementalResolver._updateElementNameOffsets(); 794 incrementalResolver._updateElementNameOffsets();
795 incrementalResolver._shiftEntryErrors(); 795 incrementalResolver._shiftEntryErrors();
796 _updateEntry(); 796 _updateEntry();
797 // resolve references in the comment 797 // resolve references in the comment
798 incrementalResolver._resolveReferences(newComment); 798 incrementalResolver._resolveReferences(newComment);
799 // update 'documentationComment' of the parent element(s) 799 // update 'documentationComment' of the parent element(s)
800 { 800 {
801 AstNode parent = newComment.parent; 801 AstNode parent = newComment.parent;
802 if (parent is AnnotatedNode) { 802 if (parent is AnnotatedNode) {
803 setElementDocumentationForVariables(VariableDeclarationList list) {
804 for (VariableDeclaration variable in list.variables) {
805 Element variableElement = variable.element;
806 if (variableElement is ElementImpl) {
807 setElementDocumentationComment(variableElement, parent);
808 }
809 }
810 }
803 Element parentElement = ElementLocator.locate(newComment.parent); 811 Element parentElement = ElementLocator.locate(newComment.parent);
804 if (parentElement is ElementImpl) { 812 if (parentElement is ElementImpl) {
805 setElementDocumentationComment(parentElement, parent); 813 setElementDocumentationComment(parentElement, parent);
806 } else if (parentElement == null && parent is FieldDeclaration) { 814 } else if (parent is FieldDeclaration) {
807 for (VariableDeclaration field in parent.fields.variables) { 815 setElementDocumentationForVariables(parent.fields);
808 Element fieldElement = field.element; 816 } else if (parent is TopLevelVariableDeclaration) {
809 if (fieldElement is ElementImpl) { 817 setElementDocumentationForVariables(parent.variables);
810 setElementDocumentationComment(fieldElement, parent);
811 }
812 }
813 } 818 }
814 } 819 }
815 } 820 }
816 // OK 821 // OK
817 return true; 822 return true;
818 } 823 }
819 824
820 Token _scan(String code) { 825 Token _scan(String code) {
821 RecordingErrorListener errorListener = new RecordingErrorListener(); 826 RecordingErrorListener errorListener = new RecordingErrorListener();
822 CharSequenceReader reader = new CharSequenceReader(code); 827 CharSequenceReader reader = new CharSequenceReader(code);
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after
1314 @override 1319 @override
1315 String toString() => name; 1320 String toString() => name;
1316 } 1321 }
1317 1322
1318 class _TokenPair { 1323 class _TokenPair {
1319 final _TokenDifferenceKind kind; 1324 final _TokenDifferenceKind kind;
1320 final Token oldToken; 1325 final Token oldToken;
1321 final Token newToken; 1326 final Token newToken;
1322 _TokenPair(this.kind, this.oldToken, this.newToken); 1327 _TokenPair(this.kind, this.oldToken, this.newToken);
1323 } 1328 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer/test/generated/incremental_resolver_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698