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

Unified Diff: pkg/analysis_server/lib/src/computer/element.dart

Issue 367973006: Implementation for 'analysis.occurrences' notification. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 6 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
Index: pkg/analysis_server/lib/src/computer/element.dart
diff --git a/pkg/analysis_server/lib/src/computer/element.dart b/pkg/analysis_server/lib/src/computer/element.dart
index ca223e04cd47174e5da670f4b3fc7b10fe390d0d..56ede071a6d0d0fd2c861475c7b7f29779390aa0 100644
--- a/pkg/analysis_server/lib/src/computer/element.dart
+++ b/pkg/analysis_server/lib/src/computer/element.dart
@@ -111,6 +111,9 @@ class Element {
return json;
}
+ @override
+ String toString() => toJson().toString();
+
static String _getParametersString(engine.Element element) {
// TODO(scheglov) expose the corresponding feature from ExecutableElement
if (element is engine.ExecutableElement) {
@@ -208,6 +211,7 @@ class ElementKind {
static const FUNCTION_TYPE_ALIAS = const ElementKind('FUNCTION_TYPE_ALIAS');
static const GETTER = const ElementKind('GETTER');
static const LIBRARY = const ElementKind('LIBRARY');
+ static const LOCAL_VARIABLE = const ElementKind('LOCAL_VARIABLE');
static const METHOD = const ElementKind('METHOD');
static const SETTER = const ElementKind('SETTER');
static const TOP_LEVEL_VARIABLE = const ElementKind('TOP_LEVEL_VARIABLE');
@@ -232,6 +236,7 @@ class ElementKind {
if (FUNCTION_TYPE_ALIAS.name == name) return FUNCTION_TYPE_ALIAS;
if (GETTER.name == name) return GETTER;
if (LIBRARY.name == name) return LIBRARY;
+ if (LOCAL_VARIABLE.name == name) return LOCAL_VARIABLE;
if (METHOD.name == name) return METHOD;
if (SETTER.name == name) return SETTER;
if (TOP_LEVEL_VARIABLE.name == name) return TOP_LEVEL_VARIABLE;
@@ -266,6 +271,9 @@ class ElementKind {
if (kind == engine.ElementKind.LIBRARY) {
return LIBRARY;
}
+ if (kind == engine.ElementKind.LOCAL_VARIABLE) {
+ return LOCAL_VARIABLE;
+ }
if (kind == engine.ElementKind.METHOD) {
return METHOD;
}
« no previous file with comments | « pkg/analysis_server/lib/src/computer/computer_occurrences.dart ('k') | pkg/analysis_server/lib/src/constants.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698