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

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

Issue 2473003003: Implement 'Sort Members' for the new analysis driver. (Closed)
Patch Set: Created 4 years, 1 month 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 | pkg/analysis_server/lib/src/edit/edit_domain.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/analysis_server.dart
diff --git a/pkg/analysis_server/lib/src/analysis_server.dart b/pkg/analysis_server/lib/src/analysis_server.dart
index 46ea3341e0115cfd28e9ac21e3e61095f2bb9b2a..bf7ee7307c22c2c3404a14abec42a980a405a63a 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -561,6 +561,19 @@ class AnalysisServer {
return null;
}
+ /**
+ * Return the analysis driver to which the file with the given [path] is
+ * added if exists, otherwise the first driver, otherwise `null`.
+ */
+ nd.AnalysisDriver getAnalysisDriver(String path) {
+ Iterable<nd.AnalysisDriver> drivers = driverMap.values;
+ if (drivers.isNotEmpty) {
+ return drivers.firstWhere((driver) => driver.isAddedFile(path),
+ orElse: () => drivers.first);
+ }
+ return null;
+ }
+
CompilationUnitElement getCompilationUnitElement(String file) {
ContextSourcePair pair = getContextSourcePair(file);
if (pair == null) {
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/edit/edit_domain.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698