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

Unified Diff: pkg/analysis_server/lib/src/domain_execution.dart

Issue 2681393004: Implement also 'execution.mapUri' for file to URI. (Closed)
Patch Set: Created 3 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analysis_server/test/integration/execution/map_uri_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/domain_execution.dart
diff --git a/pkg/analysis_server/lib/src/domain_execution.dart b/pkg/analysis_server/lib/src/domain_execution.dart
index a65e0499dba94b60af9e8d5aacf4e994c2673b43..29449c5b3fa450b6132c75885b2765fa63148135 100644
--- a/pkg/analysis_server/lib/src/domain_execution.dart
+++ b/pkg/analysis_server/lib/src/domain_execution.dart
@@ -12,6 +12,7 @@ import 'package:analysis_server/plugin/protocol/protocol.dart';
import 'package:analysis_server/src/analysis_server.dart';
import 'package:analysis_server/src/constants.dart';
import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/dart/analysis/driver.dart';
import 'package:analyzer/src/generated/engine.dart';
import 'package:analyzer/src/generated/source.dart';
@@ -99,8 +100,9 @@ class ExecutionDomainHandler implements RequestHandler {
}
SourceFactory sourceFactory;
+ AnalysisDriver driver;
if (server.options.enableNewAnalysisDriver) {
- var driver = server.getAnalysisDriver(path);
+ driver = server.getAnalysisDriver(path);
if (driver == null) {
return new Response.invalidExecutionContext(request, contextId);
}
@@ -127,8 +129,14 @@ class ExecutionDomainHandler implements RequestHandler {
return new Response.invalidParameter(
request, 'file', 'Must not refer to a directory');
}
- ContextSourcePair contextSource = server.getContextSourcePair(file);
- Source source = contextSource.source;
+
+ Source source;
+ if (server.options.enableNewAnalysisDriver) {
+ source = driver.fsState.getFileForPath(file).source;
+ } else {
+ ContextSourcePair contextSource = server.getContextSourcePair(file);
+ source = contextSource.source;
+ }
if (source.uriKind != UriKind.FILE_URI) {
uri = source.uri.toString();
} else {
« no previous file with comments | « no previous file | pkg/analysis_server/test/integration/execution/map_uri_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698