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

Unified Diff: pkg/analysis_server/lib/src/status/ast_writer.dart

Issue 922453002: Include source info in status AST dump (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/status/ast_writer.dart
diff --git a/pkg/analysis_server/lib/src/status/ast_writer.dart b/pkg/analysis_server/lib/src/status/ast_writer.dart
index db3d74e61ceed51506619338b67701fff89a37b4..99229a099af66ece2211c71cbc34368674ffb43e 100644
--- a/pkg/analysis_server/lib/src/status/ast_writer.dart
+++ b/pkg/analysis_server/lib/src/status/ast_writer.dart
@@ -10,6 +10,7 @@ import 'package:analysis_server/src/get_handler.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/java_engine.dart';
+import 'package:analyzer/src/generated/source.dart';
/**
* A visitor that will produce an HTML representation of an AST structure.
@@ -142,6 +143,7 @@ class AstWriter extends UnifyingAstVisitor {
_writeProperty("element", node.element);
} else if (node is ExportDirective) {
_writeProperty("element", node.element);
+ _writeProperty("source", node.source);
} else if (node is FunctionExpressionInvocation) {
_writeProperty('static element', node.staticElement);
_writeProperty('static type', node.staticType);
@@ -149,10 +151,12 @@ class AstWriter extends UnifyingAstVisitor {
_writeProperty('propagated type', node.propagatedType);
} else if (node is ImportDirective) {
_writeProperty("element", node.element);
+ _writeProperty("source", node.source);
} else if (node is LibraryDirective) {
_writeProperty("element", node.element);
} else if (node is PartDirective) {
_writeProperty("element", node.element);
+ _writeProperty("source", node.source);
} else if (node is PartOfDirective) {
_writeProperty("element", node.element);
} else if (node is PostfixExpression) {
@@ -185,7 +189,11 @@ class AstWriter extends UnifyingAstVisitor {
if (value != null) {
String valueString = null;
try {
- valueString = value.toString();
+ if (value is Source) {
+ valueString = 'Source (uri="${value.uri}", path="${value.fullName}")';
+ } else {
+ valueString = value.toString();
+ }
} catch (exception, stackTrace) {
exceptions.add(new CaughtException(exception, stackTrace));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698