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

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

Issue 958373003: Don't remove indexing operations on potential source changes. (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';
11 import 'package:analysis_server/src/computer/computer_outline.dart'; 11 import 'package:analysis_server/src/computer/computer_outline.dart';
12 import 'package:analysis_server/src/computer/computer_overrides.dart'; 12 import 'package:analysis_server/src/computer/computer_overrides.dart';
13 import 'package:analysis_server/src/operation/operation.dart'; 13 import 'package:analysis_server/src/operation/operation.dart';
14 import 'package:analysis_server/src/protocol_server.dart' as protocol; 14 import 'package:analysis_server/src/protocol_server.dart' as protocol;
15 import 'package:analysis_server/src/services/index/index.dart'; 15 import 'package:analysis_server/src/services/index/index.dart';
16 import 'package:analyzer/src/generated/ast.dart'; 16 import 'package:analyzer/src/generated/ast.dart';
17 import 'package:analyzer/src/generated/engine.dart'; 17 import 'package:analyzer/src/generated/engine.dart';
18 import 'package:analyzer/src/generated/error.dart'; 18 import 'package:analyzer/src/generated/error.dart';
19 import 'package:analyzer/src/generated/html.dart'; 19 import 'package:analyzer/src/generated/html.dart';
20 import 'package:analyzer/src/generated/source.dart'; 20 import 'package:analyzer/src/generated/source.dart';
21 21
22 22
23 /** 23 /**
24 * Schedules indexing of the given [file] using the resolved [dartUnit].
25 */
26 void scheduleIndexOperation(AnalysisServer server, String file,
27 AnalysisContext context, CompilationUnit dartUnit) {
28 server.addOperation(new _DartIndexOperation(context, file, dartUnit));
29 }
30
31
32 /**
24 * Schedules sending notifications for the given [file] using the resolved 33 * Schedules sending notifications for the given [file] using the resolved
25 * [resolvedDartUnit]. 34 * [resolvedDartUnit].
26 */ 35 */
27 void scheduleNotificationOperations(AnalysisServer server, String file, 36 void scheduleNotificationOperations(AnalysisServer server, String file,
28 LineInfo lineInfo, AnalysisContext context, CompilationUnit parsedDartUnit, 37 LineInfo lineInfo, AnalysisContext context, CompilationUnit parsedDartUnit,
29 CompilationUnit resolvedDartUnit, List<AnalysisError> errors) { 38 CompilationUnit resolvedDartUnit, List<AnalysisError> errors) {
30 // Only send notifications if the current context is the preferred 39 // Only send notifications if the current context is the preferred
31 // context for the file. This avoids redundant notification messages 40 // context for the file. This avoids redundant notification messages
32 // being sent to the client (see dartbug.com/22210). 41 // being sent to the client (see dartbug.com/22210).
33 // TODO(paulberry): note that there is a small risk that this will cause 42 // TODO(paulberry): note that there is a small risk that this will cause
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
422 abstract class _SingleFileOperation extends SourceSensitiveOperation { 431 abstract class _SingleFileOperation extends SourceSensitiveOperation {
423 final String file; 432 final String file;
424 433
425 _SingleFileOperation(this.file); 434 _SingleFileOperation(this.file);
426 435
427 @override 436 @override
428 bool shouldBeDiscardedOnSourceChange(Source source) { 437 bool shouldBeDiscardedOnSourceChange(Source source) {
429 return source.fullName == file; 438 return source.fullName == file;
430 } 439 }
431 } 440 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698