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

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

Issue 1749333004: Fill the new index in Analysis Server. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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
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_highlights2.dart'; 9 import 'package:analysis_server/src/computer/computer_highlights2.dart';
10 import 'package:analysis_server/src/computer/computer_outline.dart'; 10 import 'package:analysis_server/src/computer/computer_outline.dart';
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after
452 return ServerOperationPriority.ANALYSIS_INDEX; 452 return ServerOperationPriority.ANALYSIS_INDEX;
453 } 453 }
454 454
455 @override 455 @override
456 void perform(AnalysisServer server) { 456 void perform(AnalysisServer server) {
457 ServerPerformanceStatistics.indexOperation.makeCurrentWhile(() { 457 ServerPerformanceStatistics.indexOperation.makeCurrentWhile(() {
458 try { 458 try {
459 Index index = server.index; 459 Index index = server.index;
460 AnalysisContext context = unit.element.context; 460 AnalysisContext context = unit.element.context;
461 index.index(context, unit); 461 index.index(context, unit);
462 server.index2?.indexUnit(unit);
462 } catch (exception, stackTrace) { 463 } catch (exception, stackTrace) {
463 server.sendServerErrorNotification( 464 server.sendServerErrorNotification(
464 'Failed to index: $file', exception, stackTrace); 465 'Failed to index: $file', exception, stackTrace);
465 } 466 }
466 }); 467 });
467 } 468 }
468 } 469 }
469 470
470 abstract class _DartNotificationOperation extends _SingleFileOperation { 471 abstract class _DartNotificationOperation extends _SingleFileOperation {
471 final CompilationUnit unit; 472 final CompilationUnit unit;
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 abstract class _SingleFileOperation extends SourceSensitiveOperation { 543 abstract class _SingleFileOperation extends SourceSensitiveOperation {
543 final String file; 544 final String file;
544 545
545 _SingleFileOperation(AnalysisContext context, this.file) : super(context); 546 _SingleFileOperation(AnalysisContext context, this.file) : super(context);
546 547
547 @override 548 @override
548 bool shouldBeDiscardedOnSourceChange(Source source) { 549 bool shouldBeDiscardedOnSourceChange(Source source) {
549 return source.fullName == file; 550 return source.fullName == file;
550 } 551 }
551 } 552 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/lib/src/analysis_server.dart ('k') | pkg/analysis_server/lib/src/services/index2/index2.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698