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

Side by Side Diff: pkg/analysis_server/lib/src/domain_completion.dart

Issue 1080323002: Prevent analysis exceptions from crashing the completion engine. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 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
« 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 domain.completion; 5 library domain.completion;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/src/analysis_server.dart'; 9 import 'package:analysis_server/src/analysis_server.dart';
10 import 'package:analysis_server/src/constants.dart'; 10 import 'package:analysis_server/src/constants.dart';
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 if (source == null) { 150 if (source == null) {
151 performance.complete('priorityChanged caching: no source'); 151 performance.complete('priorityChanged caching: no source');
152 return; 152 return;
153 } 153 }
154 performance.source = source; 154 performance.source = source;
155 AnalysisContext context = server.getAnalysisContextForSource(source); 155 AnalysisContext context = server.getAnalysisContextForSource(source);
156 if (context != null) { 156 if (context != null) {
157 String computeTag = 'computeCache'; 157 String computeTag = 'computeCache';
158 performance.logStartTime(computeTag); 158 performance.logStartTime(computeTag);
159 CompletionManager manager = completionManagerFor(context, source); 159 CompletionManager manager = completionManagerFor(context, source);
160 manager.computeCache().then((bool success) { 160 manager.computeCache().catchError((_) => false).then((bool success) {
161 performance.logElapseTime(computeTag); 161 performance.logElapseTime(computeTag);
162 performance.complete('priorityChanged caching: $success'); 162 performance.complete('priorityChanged caching: $success');
163 }); 163 });
164 } 164 }
165 } 165 }
166 166
167 /** 167 /**
168 * Process a `completion.getSuggestions` request. 168 * Process a `completion.getSuggestions` request.
169 */ 169 */
170 Response processRequest(Request request, [CompletionManager manager]) { 170 Response processRequest(Request request, [CompletionManager manager]) {
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 if (_sourcesChangedSubscription != null) { 270 if (_sourcesChangedSubscription != null) {
271 _sourcesChangedSubscription.cancel(); 271 _sourcesChangedSubscription.cancel();
272 _sourcesChangedSubscription = null; 272 _sourcesChangedSubscription = null;
273 } 273 }
274 if (_manager != null) { 274 if (_manager != null) {
275 _manager.dispose(); 275 _manager.dispose();
276 _manager = null; 276 _manager = null;
277 } 277 }
278 } 278 }
279 } 279 }
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