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

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

Issue 907183002: Fix notifications for nested packages (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 | pkg/analysis_server/test/analysis_server_test.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 0cdc57c0e4c2baf11eac2585dbb8e6e1a5af4218..5347e14c97a5ee2771e9a6c4a20f00b154a8550c 100644
--- a/pkg/analysis_server/lib/src/analysis_server.dart
+++ b/pkg/analysis_server/lib/src/analysis_server.dart
@@ -368,11 +368,19 @@ class AnalysisServer {
*/
AnalysisContext getAnalysisContext(String path) {
// try to find a containing context
+ Folder containingFolder = null;
for (Folder folder in folderMap.keys) {
if (folder.path == path || folder.contains(path)) {
- return folderMap[folder];
+ if (containingFolder == null) {
+ containingFolder = folder;
+ } else if (containingFolder.path.length < folder.path.length) {
+ containingFolder = folder;
+ }
}
}
+ if (containingFolder != null) {
+ return folderMap[containingFolder];
+ }
Resource resource = resourceProvider.getResource(path);
if (resource is Folder) {
return null;
« no previous file with comments | « no previous file | pkg/analysis_server/test/analysis_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698