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

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

Issue 665153002: Fix for file to URI mapping. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 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 | 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 'There is no execution context with an id of $contextId'); 98 'There is no execution context with an id of $contextId');
99 } 99 }
100 AnalysisContext context = server.getAnalysisContext(path); 100 AnalysisContext context = server.getAnalysisContext(path);
101 if (params.file != null) { 101 if (params.file != null) {
102 if (params.uri != null) { 102 if (params.uri != null) {
103 return new Response.invalidParameter( 103 return new Response.invalidParameter(
104 request, 104 request,
105 'file', 105 'file',
106 'Either file or uri must be provided, but not both'); 106 'Either file or uri must be provided, but not both');
107 } 107 }
108 Source source = server.getSource(path); 108 Source source = server.getSource(params.file);
109 String uri = context.sourceFactory.restoreUri(source).toString(); 109 String uri = context.sourceFactory.restoreUri(source).toString();
110 return new ExecutionMapUriResult(uri: uri).toResponse(request.id); 110 return new ExecutionMapUriResult(uri: uri).toResponse(request.id);
111 } else if (params.uri != null) { 111 } else if (params.uri != null) {
112 Source source = context.sourceFactory.forUri(params.uri); 112 Source source = context.sourceFactory.forUri(params.uri);
113 String file = source.fullName; 113 String file = source.fullName;
114 return new ExecutionMapUriResult(file: file).toResponse(request.id); 114 return new ExecutionMapUriResult(file: file).toResponse(request.id);
115 } 115 }
116 return new Response.invalidParameter( 116 return new Response.invalidParameter(
117 request, 117 request,
118 'file', 118 'file',
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 if (_isInAnalysisRoot(filePath)) { 219 if (_isInAnalysisRoot(filePath)) {
220 server.sendNotification( 220 server.sendNotification(
221 new ExecutionLaunchDataParams(filePath, kind: kind).toNotification()); 221 new ExecutionLaunchDataParams(filePath, kind: kind).toNotification());
222 } 222 }
223 } 223 }
224 224
225 static List<String> _getFullNames(List<Source> sources) { 225 static List<String> _getFullNames(List<Source> sources) {
226 return sources.map((Source source) => source.fullName).toList(); 226 return sources.map((Source source) => source.fullName).toList();
227 } 227 }
228 } 228 }
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