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

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

Issue 560103002: Fix exception in error processing; implement mapUri (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/lib/src/generated_protocol.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.execution; 5 library domain.execution;
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/constants.dart'; 8 import 'package:analysis_server/src/constants.dart';
9 import 'package:analysis_server/src/protocol.dart'; 9 import 'package:analysis_server/src/protocol.dart';
10 import 'dart:collection'; 10 import 'dart:collection';
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 AnalysisContext context = server.getAnalysisContext(path); 97 AnalysisContext context = server.getAnalysisContext(path);
98 if (params.file != null) { 98 if (params.file != null) {
99 if (params.uri != null) { 99 if (params.uri != null) {
100 return new Response.invalidParameter( 100 return new Response.invalidParameter(
101 request, 101 request,
102 'file', 102 'file',
103 'Either file or uri must be provided, but not both'); 103 'Either file or uri must be provided, but not both');
104 } 104 }
105 Source source = server.getSource(path); 105 Source source = server.getSource(path);
106 // TODO(brianwilkerson) Figure out how to perform the mapping. 106 String uri = context.sourceFactory.restoreUri(source).toString();
107 String uri = '';
108 return new ExecutionMapUriResult(uri: uri).toResponse(request.id); 107 return new ExecutionMapUriResult(uri: uri).toResponse(request.id);
109 } else if (params.uri != null) { 108 } else if (params.uri != null) {
110 // TODO(brianwilkerson) Figure out how to perform the mapping. 109 Source source = context.sourceFactory.forUri(params.uri);
111 String file = ''; 110 String file = source.fullName;
112 return new ExecutionMapUriResult(file: file).toResponse(request.id); 111 return new ExecutionMapUriResult(file: file).toResponse(request.id);
113 } 112 }
114 return new Response.invalidParameter( 113 return new Response.invalidParameter(
115 request, 114 request,
116 'file', 115 'file',
117 'Either file or uri must be provided'); 116 'Either file or uri must be provided');
118 } 117 }
119 118
120 /** 119 /**
121 * Implement the 'execution.setSubscriptions' request. 120 * Implement the 'execution.setSubscriptions' request.
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 new ExecutionLaunchDataParams( 200 new ExecutionLaunchDataParams(
202 executables, 201 executables,
203 dartToHtml, 202 dartToHtml,
204 htmlToDart).toNotification()); 203 htmlToDart).toNotification());
205 } 204 }
206 205
207 List<String> getFullNames(List<Source> sources) { 206 List<String> getFullNames(List<Source> sources) {
208 return sources.map((Source source) => source.fullName).toList(); 207 return sources.map((Source source) => source.fullName).toList();
209 } 208 }
210 } 209 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/doc/api.html ('k') | pkg/analysis_server/lib/src/generated_protocol.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698