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

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

Issue 246013007: Trigger analysis when context.applyChanges request is received. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | pkg/analysis_server/test/domain_context_test.dart » ('j') | 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.context; 5 library domain.context;
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/protocol.dart'; 8 import 'package:analysis_server/src/protocol.dart';
9 import 'package:analyzer/src/generated/engine.dart'; 9 import 'package:analyzer/src/generated/engine.dart';
10 import 'package:analyzer/src/generated/source.dart'; 10 import 'package:analyzer/src/generated/source.dart';
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 */ 135 */
136 Response applyChanges(Request request) { 136 Response applyChanges(Request request) {
137 AnalysisContext context = getAnalysisContext(request); 137 AnalysisContext context = getAnalysisContext(request);
138 RequestDatum changesData = request.getRequiredParameter(CHANGES_PARAM); 138 RequestDatum changesData = request.getRequiredParameter(CHANGES_PARAM);
139 ChangeSet changeSet = createChangeSet( 139 ChangeSet changeSet = createChangeSet(
140 request, 140 request,
141 context.sourceFactory, 141 context.sourceFactory,
142 changesData); 142 changesData);
143 143
144 context.applyChanges(changeSet); 144 context.applyChanges(changeSet);
145 server.addContextToWorkQueue(context);
145 Response response = new Response(request.id); 146 Response response = new Response(request.id);
146 return response; 147 return response;
147 } 148 }
148 149
149 /** 150 /**
150 * Convert the given JSON object into a [ChangeSet], using the given 151 * Convert the given JSON object into a [ChangeSet], using the given
151 * [sourceFactory] to convert the embedded strings into sources. 152 * [sourceFactory] to convert the embedded strings into sources.
152 */ 153 */
153 ChangeSet createChangeSet(Request request, SourceFactory sourceFactory, 154 ChangeSet createChangeSet(Request request, SourceFactory sourceFactory,
154 RequestDatum jsonData) { 155 RequestDatum jsonData) {
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 */ 258 */
258 AnalysisContext getAnalysisContext(Request request) { 259 AnalysisContext getAnalysisContext(Request request) {
259 String contextId = request.getRequiredParameter(CONTEXT_ID_PARAM).asString() ; 260 String contextId = request.getRequiredParameter(CONTEXT_ID_PARAM).asString() ;
260 AnalysisContext context = server.contextMap[contextId]; 261 AnalysisContext context = server.contextMap[contextId];
261 if (context == null) { 262 if (context == null) {
262 throw new RequestFailure(new Response.contextDoesNotExist(request)); 263 throw new RequestFailure(new Response.contextDoesNotExist(request));
263 } 264 }
264 return context; 265 return context;
265 } 266 }
266 } 267 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_server/test/domain_context_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698