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

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

Issue 1404353007: Completion exceptions are never fatal. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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 domain.completion; 5 library domain.completion;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_server/plugin/protocol/protocol.dart'; 9 import 'package:analysis_server/plugin/protocol/protocol.dart';
10 import 'package:analysis_server/src/analysis_server.dart'; 10 import 'package:analysis_server/src/analysis_server.dart';
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
50 * or `null` if none. 50 * or `null` if none.
51 */ 51 */
52 CompletionManager _manager; 52 CompletionManager _manager;
53 53
54 /** 54 /**
55 * The subscription for the cached context's source change stream. 55 * The subscription for the cached context's source change stream.
56 */ 56 */
57 StreamSubscription<SourcesChangedEvent> _sourcesChangedSubscription; 57 StreamSubscription<SourcesChangedEvent> _sourcesChangedSubscription;
58 58
59 /** 59 /**
60 * Code completion peformance for the last completion operation. 60 * Code completion performance for the last completion operation.
61 */ 61 */
62 CompletionPerformance performance; 62 CompletionPerformance performance;
63 63
64 /** 64 /**
65 * A list of code completion peformance measurements for the latest 65 * A list of code completion performance measurements for the latest
66 * completion operation up to [performanceListMaxLength] measurements. 66 * completion operation up to [performanceListMaxLength] measurements.
67 */ 67 */
68 final List<CompletionPerformance> performanceList = 68 final List<CompletionPerformance> performanceList =
69 new List<CompletionPerformance>(); 69 new List<CompletionPerformance>();
70 70
71 /** 71 /**
72 * Performance for the last priority change event. 72 * Performance for the last priority change event.
73 */ 73 */
74 CompletionPerformance computeCachePerformance; 74 CompletionPerformance computeCachePerformance;
75 75
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 CompletionManager createCompletionManager( 124 CompletionManager createCompletionManager(
125 AnalysisContext context, Source source, SearchEngine searchEngine) { 125 AnalysisContext context, Source source, SearchEngine searchEngine) {
126 return new CompletionManager.create(context, source, searchEngine); 126 return new CompletionManager.create(context, source, searchEngine);
127 } 127 }
128 128
129 @override 129 @override
130 Response handleRequest(Request request) { 130 Response handleRequest(Request request) {
131 if (searchEngine == null) { 131 if (searchEngine == null) {
132 return new Response.noIndexGenerated(request); 132 return new Response.noIndexGenerated(request);
133 } 133 }
134 try { 134 return runZoned(() {
135 String requestName = request.method; 135 try {
136 if (requestName == COMPLETION_GET_SUGGESTIONS) { 136 String requestName = request.method;
137 return processRequest(request); 137 if (requestName == COMPLETION_GET_SUGGESTIONS) {
138 return processRequest(request);
139 }
140 } on RequestFailure catch (exception) {
141 return exception.response;
138 } 142 }
139 } on RequestFailure catch (exception) { 143 return null;
140 return exception.response; 144 }, onError: (exception, stackTrace) {
141 } 145 server.sendServerErrorNotification(exception, stackTrace);
142 return null; 146 });
143 } 147 }
144 148
145 /** 149 /**
146 * If the set the priority files has changed, then pre-cache completion 150 * If the set the priority files has changed, then pre-cache completion
147 * information related to the first priority file. 151 * information related to the first priority file.
148 */ 152 */
149 void priorityChanged(PriorityChangeEvent event) { 153 void priorityChanged(PriorityChangeEvent event) {
150 Source source = event.firstSource; 154 Source source = event.firstSource;
151 CompletionPerformance performance = new CompletionPerformance(); 155 CompletionPerformance performance = new CompletionPerformance();
152 computeCachePerformance = performance; 156 computeCachePerformance = performance;
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
277 if (_sourcesChangedSubscription != null) { 281 if (_sourcesChangedSubscription != null) {
278 _sourcesChangedSubscription.cancel(); 282 _sourcesChangedSubscription.cancel();
279 _sourcesChangedSubscription = null; 283 _sourcesChangedSubscription = null;
280 } 284 }
281 if (_manager != null) { 285 if (_manager != null) {
282 _manager.dispose(); 286 _manager.dispose();
283 _manager = null; 287 _manager = null;
284 } 288 }
285 } 289 }
286 } 290 }
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