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

Unified Diff: pkg/analyzer/lib/src/dart/analysis/top_level_declaration.dart

Issue 2544883003: Implement 'topLevelLibraryDeclarations' getter to return all libraries with exported top-level decl… (Closed)
Patch Set: Change AnalysisDriver API to return declarations of a name. Created 4 years 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/analyzer/lib/src/dart/analysis/top_level_declaration.dart
diff --git a/pkg/analyzer/lib/src/dart/analysis/top_level_declaration.dart b/pkg/analyzer/lib/src/dart/analysis/top_level_declaration.dart
index 1ec5d068c3d7d21920f4017a3f349692f6e66106..20f5fc18cae39d0a199500226d94f76f9a29a55f 100644
--- a/pkg/analyzer/lib/src/dart/analysis/top_level_declaration.dart
+++ b/pkg/analyzer/lib/src/dart/analysis/top_level_declaration.dart
@@ -12,28 +12,34 @@ class TopLevelDeclaration {
final String name;
TopLevelDeclaration(this.kind, this.name);
-}
-/**
- * Kind of a top-level declaration.
- *
- * We don't need it to be precise, just enough to support quick fixes.
- */
-enum TopLevelDeclarationKind { type, function, variable }
+ @override
+ String toString() => '($kind, $name)';
+}
/**
- * Top-level declarations in the export namespace of a library.
+ * A declaration in a source.
*/
-class TopLevelLibraryDeclarations {
+class TopLevelDeclarationInSource {
/**
- * The source of the library.
+ * The declaring source.
*/
final Source source;
/**
- * Top-level declarations in the export namespace of the library.
+ * The declaration.
*/
- final List<TopLevelDeclaration> declarations = [];
+ final TopLevelDeclaration declaration;
- TopLevelLibraryDeclarations(this.source);
+ TopLevelDeclarationInSource(this.source, this.declaration);
+
+ @override
+ String toString() => '($source, $declaration)';
}
+
+/**
+ * Kind of a top-level declaration.
+ *
+ * We don't need it to be precise, just enough to support quick fixes.
+ */
+enum TopLevelDeclarationKind { type, function, variable }

Powered by Google App Engine
This is Rietveld 408576698