Chromium Code Reviews| Index: pkg/analysis_server/lib/src/domain_execution.dart |
| diff --git a/pkg/analysis_server/lib/src/domain_execution.dart b/pkg/analysis_server/lib/src/domain_execution.dart |
| index 3461cd5a8055c22e42967b43a0fbc30c8c39e427..c27ac0cef6eebbec05e7d0184b41fd8b0c7d3235 100644 |
| --- a/pkg/analysis_server/lib/src/domain_execution.dart |
| +++ b/pkg/analysis_server/lib/src/domain_execution.dart |
| @@ -142,6 +142,9 @@ class ExecutionDomainHandler implements RequestHandler { |
| void _fileAnalyzed(ChangeNotice notice) { |
| Source source = notice.source; |
| String filePath = source.fullName; |
| + if (!server.contextDirectoryManager.isInAnalysisRoot(filePath)) { |
|
scheglov
2014/10/06 16:51:44
You could extract "server.contextDirectoryManager.
Brian Wilkerson
2014/10/06 18:56:20
Done
|
| + return; |
| + } |
| AnalysisContext context = server.getAnalysisContext(filePath); |
| if (AnalysisEngine.isDartFileName(filePath)) { |
| ExecutableKind kind = ExecutableKind.NOT_EXECUTABLE; |
| @@ -174,38 +177,52 @@ class ExecutionDomainHandler implements RequestHandler { |
| List<Source> clientSources = context.launchableClientLibrarySources; |
| List<Source> serverSources = context.launchableServerLibrarySources; |
| for (Source source in clientSources) { |
| + String filePath = source.fullName; |
| if (serverSources.remove(source)) { |
| - server.sendNotification( |
| - new ExecutionLaunchDataParams( |
| - source.fullName, |
| - kind: ExecutableKind.EITHER).toNotification()); |
| + if (server.contextDirectoryManager.isInAnalysisRoot(filePath)) { |
| + server.sendNotification( |
| + new ExecutionLaunchDataParams( |
| + filePath, |
| + kind: ExecutableKind.EITHER).toNotification()); |
| + } |
|
scheglov
2014/10/06 16:51:44
The whole "if" statement could be extracted into a
Brian Wilkerson
2014/10/06 18:56:20
Done
|
| } else { |
| - server.sendNotification( |
| - new ExecutionLaunchDataParams( |
| - source.fullName, |
| - kind: ExecutableKind.CLIENT).toNotification()); |
| + if (server.contextDirectoryManager.isInAnalysisRoot(filePath)) { |
| + server.sendNotification( |
| + new ExecutionLaunchDataParams( |
| + filePath, |
| + kind: ExecutableKind.CLIENT).toNotification()); |
| + } |
| } |
| librarySources.remove(source); |
| } |
| for (Source source in serverSources) { |
| - server.sendNotification( |
| - new ExecutionLaunchDataParams( |
| - source.fullName, |
| - kind: ExecutableKind.SERVER).toNotification()); |
| + String filePath = source.fullName; |
| + if (server.contextDirectoryManager.isInAnalysisRoot(filePath)) { |
| + server.sendNotification( |
| + new ExecutionLaunchDataParams( |
| + filePath, |
| + kind: ExecutableKind.SERVER).toNotification()); |
| + } |
| librarySources.remove(source); |
| } |
| for (Source source in librarySources) { |
| - server.sendNotification( |
| - new ExecutionLaunchDataParams( |
| - source.fullName, |
| - kind: ExecutableKind.NOT_EXECUTABLE).toNotification()); |
| + String filePath = source.fullName; |
| + if (server.contextDirectoryManager.isInAnalysisRoot(filePath)) { |
| + server.sendNotification( |
| + new ExecutionLaunchDataParams( |
| + filePath, |
| + kind: ExecutableKind.NOT_EXECUTABLE).toNotification()); |
| + } |
| } |
| for (Source source in context.htmlSources) { |
| - List<Source> libraries = context.getLibrariesReferencedFromHtml(source); |
| - server.sendNotification( |
| - new ExecutionLaunchDataParams( |
| - source.fullName, |
| - referencedFiles: _getFullNames(libraries)).toNotification()); |
| + String filePath = source.fullName; |
| + if (server.contextDirectoryManager.isInAnalysisRoot(filePath)) { |
| + List<Source> libraries = context.getLibrariesReferencedFromHtml(source); |
| + server.sendNotification( |
| + new ExecutionLaunchDataParams( |
| + filePath, |
| + referencedFiles: _getFullNames(libraries)).toNotification()); |
| + } |
| } |
| } |
| } |