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

Unified Diff: pkg/analyzer/lib/analyzer.dart

Issue 2060263006: Deprecate FileUriResolver and RelativeFileUriResolver in source_io.dart, replace the usages with Re… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 6 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
Index: pkg/analyzer/lib/analyzer.dart
diff --git a/pkg/analyzer/lib/analyzer.dart b/pkg/analyzer/lib/analyzer.dart
index c4642e8e8044d70aa98d30f34dac482d424a9368..59fea172ff8d0fc6bc19603f5a4af23b608cd572 100644
--- a/pkg/analyzer/lib/analyzer.dart
+++ b/pkg/analyzer/lib/analyzer.dart
@@ -14,6 +14,8 @@ import 'package:analyzer/src/generated/error.dart';
import 'package:analyzer/src/generated/parser.dart';
import 'package:analyzer/src/generated/source_io.dart';
import 'package:analyzer/src/string_source.dart';
+import 'package:analyzer/file_system/file_system.dart' hide File;
+import 'package:analyzer/file_system/physical_file_system.dart';
import 'package:path/path.dart' as pathos;
export 'package:analyzer/dart/ast/ast.dart';
@@ -50,7 +52,8 @@ CompilationUnit parseCompilationUnit(String contents,
CompilationUnit parseDartFile(String path,
{bool suppressErrors: false, bool parseFunctionBodies: true}) {
String contents = new File(path).readAsStringSync();
- var sourceFactory = new SourceFactory([new FileUriResolver()]);
+ var sourceFactory = new SourceFactory(
+ [new ResourceUriResolver(PhysicalResourceProvider.INSTANCE)]);
var absolutePath = pathos.absolute(path);
var source = sourceFactory.forUri(pathos.toUri(absolutePath).toString());

Powered by Google App Engine
This is Rietveld 408576698