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

Side by Side Diff: pkg/analyzer/lib/src/dart/element/element.dart

Issue 2713243003: Add toSource() to ElementAnnotation, ElementAnnotationImpl (issue 28631) (Closed)
Patch Set: Created 3 years, 9 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 | « pkg/analyzer/lib/dart/element/element.dart ('k') | no next file » | 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.dart.element.element; 5 library analyzer.src.dart.element.element;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 import 'dart:math' show min; 8 import 'dart:math' show min;
9 9
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 2645 matching lines...) Expand 10 before | Expand all | Expand 10 after
2656 2656
2657 @override 2657 @override
2658 DartObject computeConstantValue() { 2658 DartObject computeConstantValue() {
2659 if (evaluationResult == null) { 2659 if (evaluationResult == null) {
2660 context?.computeResult(this, CONSTANT_VALUE); 2660 context?.computeResult(this, CONSTANT_VALUE);
2661 } 2661 }
2662 return constantValue; 2662 return constantValue;
2663 } 2663 }
2664 2664
2665 @override 2665 @override
2666 String toSource() => annotationAst.toSource();
2667
2668 @override
2666 String toString() => '@$element'; 2669 String toString() => '@$element';
2667 } 2670 }
2668 2671
2669 /** 2672 /**
2670 * A base class for concrete implementations of an [Element]. 2673 * A base class for concrete implementations of an [Element].
2671 */ 2674 */
2672 abstract class ElementImpl implements Element { 2675 abstract class ElementImpl implements Element {
2673 /** 2676 /**
2674 * An Unicode right arrow. 2677 * An Unicode right arrow.
2675 */ 2678 */
(...skipping 5970 matching lines...) Expand 10 before | Expand all | Expand 10 after
8646 8649
8647 @override 8650 @override
8648 void visitElement(Element element) { 8651 void visitElement(Element element) {
8649 int offset = element.nameOffset; 8652 int offset = element.nameOffset;
8650 if (offset != -1) { 8653 if (offset != -1) {
8651 map[offset] = element; 8654 map[offset] = element;
8652 } 8655 }
8653 super.visitElement(element); 8656 super.visitElement(element);
8654 } 8657 }
8655 } 8658 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/dart/element/element.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698