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

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

Issue 630863003: Stop sending launchData for non-analyzed files (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 2 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/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());
+ }
}
}
}

Powered by Google App Engine
This is Rietveld 408576698