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

Side by Side Diff: pkg/analysis_server/lib/src/operation/operation_analysis.dart

Issue 1000203003: If the file belongs to any analysis root, check whether we're in it now. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library operation.analysis; 5 library operation.analysis;
6 6
7 import 'package:analysis_server/src/analysis_server.dart'; 7 import 'package:analysis_server/src/analysis_server.dart';
8 import 'package:analysis_server/src/computer/computer_highlights.dart'; 8 import 'package:analysis_server/src/computer/computer_highlights.dart';
9 import 'package:analysis_server/src/computer/computer_navigation.dart'; 9 import 'package:analysis_server/src/computer/computer_navigation.dart';
10 import 'package:analysis_server/src/computer/computer_occurrences.dart'; 10 import 'package:analysis_server/src/computer/computer_occurrences.dart';
(...skipping 18 matching lines...) Expand all
29 } 29 }
30 } 30 }
31 31
32 /** 32 /**
33 * Schedules sending notifications for the given [file] using the resolved 33 * Schedules sending notifications for the given [file] using the resolved
34 * [resolvedDartUnit]. 34 * [resolvedDartUnit].
35 */ 35 */
36 void scheduleNotificationOperations(AnalysisServer server, String file, 36 void scheduleNotificationOperations(AnalysisServer server, String file,
37 LineInfo lineInfo, AnalysisContext context, CompilationUnit parsedDartUnit, 37 LineInfo lineInfo, AnalysisContext context, CompilationUnit parsedDartUnit,
38 CompilationUnit resolvedDartUnit, List<AnalysisError> errors) { 38 CompilationUnit resolvedDartUnit, List<AnalysisError> errors) {
39 // If the file belongs to any analysis root, check whether we're in it now.
40 AnalysisContext containingContext = server.getContainingContext(file);
41 if (containingContext != null && context != containingContext) {
42 return;
43 }
39 // Dart 44 // Dart
40 CompilationUnit dartUnit = 45 CompilationUnit dartUnit =
41 resolvedDartUnit != null ? resolvedDartUnit : parsedDartUnit; 46 resolvedDartUnit != null ? resolvedDartUnit : parsedDartUnit;
42 if (resolvedDartUnit != null) { 47 if (resolvedDartUnit != null) {
43 if (server.hasAnalysisSubscription( 48 if (server.hasAnalysisSubscription(
44 protocol.AnalysisService.HIGHLIGHTS, file)) { 49 protocol.AnalysisService.HIGHLIGHTS, file)) {
45 server.scheduleOperation( 50 server.scheduleOperation(
46 new _DartHighlightsOperation(context, file, resolvedDartUnit)); 51 new _DartHighlightsOperation(context, file, resolvedDartUnit));
47 } 52 }
48 if (server.hasAnalysisSubscription( 53 if (server.hasAnalysisSubscription(
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 abstract class _SingleFileOperation extends SourceSensitiveOperation { 409 abstract class _SingleFileOperation extends SourceSensitiveOperation {
405 final String file; 410 final String file;
406 411
407 _SingleFileOperation(AnalysisContext context, this.file) : super(context); 412 _SingleFileOperation(AnalysisContext context, this.file) : super(context);
408 413
409 @override 414 @override
410 bool shouldBeDiscardedOnSourceChange(Source source) { 415 bool shouldBeDiscardedOnSourceChange(Source source) {
411 return source.fullName == file; 416 return source.fullName == file;
412 } 417 }
413 } 418 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/test/analysis_server_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698