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

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

Issue 1126613004: Use server.getContainingContext() in execution domain. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 7 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.execution; 5 library domain.execution;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analysis_server/src/analysis_server.dart'; 10 import 'package:analysis_server/src/analysis_server.dart';
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 */ 89 */
90 Response mapUri(Request request) { 90 Response mapUri(Request request) {
91 ExecutionMapUriParams params = 91 ExecutionMapUriParams params =
92 new ExecutionMapUriParams.fromRequest(request); 92 new ExecutionMapUriParams.fromRequest(request);
93 String contextId = params.id; 93 String contextId = params.id;
94 String path = contextMap[contextId]; 94 String path = contextMap[contextId];
95 if (path == null) { 95 if (path == null) {
96 return new Response.invalidParameter(request, 'id', 96 return new Response.invalidParameter(request, 'id',
97 'There is no execution context with an id of $contextId'); 97 'There is no execution context with an id of $contextId');
98 } 98 }
99 AnalysisContext context = server.getAnalysisContext(path); 99 AnalysisContext context = server.getContainingContext(path);
Brian Wilkerson 2015/05/04 20:06:19 Why do we have both methods? They appear to be doi
scheglov 2015/05/04 20:15:22 Mostly for external files. For example when we get
100 if (context == null) { 100 if (context == null) {
101 return new Response.invalidExecutionContext(request, contextId); 101 return new Response.invalidExecutionContext(request, contextId);
102 } 102 }
103 String file = params.file; 103 String file = params.file;
104 String uri = params.uri; 104 String uri = params.uri;
105 if (file != null) { 105 if (file != null) {
106 if (uri != null) { 106 if (uri != null) {
107 return new Response.invalidParameter(request, 'file', 107 return new Response.invalidParameter(request, 'file',
108 'Either file or uri must be provided, but not both'); 108 'Either file or uri must be provided, but not both');
109 } 109 }
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 if (_isInAnalysisRoot(filePath)) { 226 if (_isInAnalysisRoot(filePath)) {
227 server.sendNotification( 227 server.sendNotification(
228 new ExecutionLaunchDataParams(filePath, kind: kind).toNotification()); 228 new ExecutionLaunchDataParams(filePath, kind: kind).toNotification());
229 } 229 }
230 } 230 }
231 231
232 static List<String> _getFullNames(List<Source> sources) { 232 static List<String> _getFullNames(List<Source> sources) {
233 return sources.map((Source source) => source.fullName).toList(); 233 return sources.map((Source source) => source.fullName).toList();
234 } 234 }
235 } 235 }
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