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

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

Issue 2376493002: Catch exceptions while preparing analysis.implemented notification. (Closed)
Patch Set: Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 30 matching lines...) Expand all
41 41
42 scheduleImplementedNotification( 42 scheduleImplementedNotification(
43 AnalysisServer server, Iterable<String> files) async { 43 AnalysisServer server, Iterable<String> files) async {
44 SearchEngine searchEngine = server.searchEngine; 44 SearchEngine searchEngine = server.searchEngine;
45 if (searchEngine == null) { 45 if (searchEngine == null) {
46 return; 46 return;
47 } 47 }
48 for (String file in files) { 48 for (String file in files) {
49 CompilationUnitElement unitElement = server.getCompilationUnitElement(file); 49 CompilationUnitElement unitElement = server.getCompilationUnitElement(file);
50 if (unitElement != null) { 50 if (unitElement != null) {
51 ImplementedComputer computer = 51 try {
52 new ImplementedComputer(searchEngine, unitElement); 52 ImplementedComputer computer =
53 await computer.compute(); 53 new ImplementedComputer(searchEngine, unitElement);
54 var params = new protocol.AnalysisImplementedParams( 54 await computer.compute();
55 file, computer.classes, computer.members); 55 var params = new protocol.AnalysisImplementedParams(
56 server.sendNotification(params.toNotification()); 56 file, computer.classes, computer.members);
57 server.sendNotification(params.toNotification());
58 } catch (exception, stackTrace) {
59 server.sendServerErrorNotification(
60 'Failed to send analysis.implemented notification.',
61 exception,
62 stackTrace);
63 }
57 } 64 }
58 } 65 }
59 } 66 }
60 67
61 /** 68 /**
62 * Schedules indexing of the given [file] using the resolved [dartUnit]. 69 * Schedules indexing of the given [file] using the resolved [dartUnit].
63 */ 70 */
64 void scheduleIndexOperation( 71 void scheduleIndexOperation(
65 AnalysisServer server, String file, CompilationUnit dartUnit) { 72 AnalysisServer server, String file, CompilationUnit dartUnit) {
66 if (server.index != null) { 73 if (server.index != null) {
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 abstract class _SingleFileOperation extends SourceSensitiveOperation { 536 abstract class _SingleFileOperation extends SourceSensitiveOperation {
530 final String file; 537 final String file;
531 538
532 _SingleFileOperation(AnalysisContext context, this.file) : super(context); 539 _SingleFileOperation(AnalysisContext context, this.file) : super(context);
533 540
534 @override 541 @override
535 bool shouldBeDiscardedOnSourceChange(Source source) { 542 bool shouldBeDiscardedOnSourceChange(Source source) {
536 return source.fullName == file; 543 return source.fullName == file;
537 } 544 }
538 } 545 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698