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

Unified Diff: pkg/analyzer/lib/src/generated/gn.dart

Issue 2660173002: implement default analysis options in bazel (Closed)
Patch Set: merge Created 3 years, 11 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 | « pkg/analyzer/lib/src/generated/bazel.dart ('k') | pkg/analyzer/lib/src/generated/workspace.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/generated/gn.dart
diff --git a/pkg/analyzer/lib/src/generated/gn.dart b/pkg/analyzer/lib/src/generated/gn.dart
index ea198335cf12ffe806c4b68a50d3a5885d855d63..be34963a4916950e13c68ba9d8dbb104e67cf538 100644
--- a/pkg/analyzer/lib/src/generated/gn.dart
+++ b/pkg/analyzer/lib/src/generated/gn.dart
@@ -8,8 +8,10 @@ import 'dart:collection';
import 'dart:core';
import 'package:analyzer/file_system/file_system.dart';
+import 'package:analyzer/src/generated/sdk.dart';
import 'package:analyzer/src/generated/source.dart';
import 'package:analyzer/src/generated/source_io.dart';
+import 'package:analyzer/src/generated/workspace.dart';
import 'package:analyzer/src/util/fast_uri.dart';
import 'package:path/path.dart';
@@ -132,7 +134,7 @@ class GnPackageUriResolver extends UriResolver {
/**
* Information about a Gn workspace.
*/
-class GnWorkspace {
+class GnWorkspace extends Workspace {
/**
* The name of the directory that identifies the root of the workspace.
*/
@@ -156,9 +158,7 @@ class GnWorkspace {
GnWorkspace._(this.provider, this.root, this.packages);
- /**
- * Return a map of package sources.
- */
+ @override
Map<String, List<Folder>> get packageMap {
Map<String, List<Folder>> result = new HashMap<String, List<Folder>>();
packages.forEach((package, sourceDir) {
@@ -167,6 +167,20 @@ class GnWorkspace {
return result;
}
+ @override
+ UriResolver get packageUriResolver => new GnPackageUriResolver(this);
+
+ @override
+ SourceFactory createSourceFactory(DartSdk sdk) {
+ List<UriResolver> resolvers = <UriResolver>[];
+ if (sdk != null) {
+ resolvers.add(new DartUriResolver(sdk));
+ }
+ resolvers.add(packageUriResolver);
+ resolvers.add(new GnFileUriResolver(this));
+ return new SourceFactory(resolvers, null, provider);
+ }
+
/**
* Return the file with the given [absolutePath].
*
« no previous file with comments | « pkg/analyzer/lib/src/generated/bazel.dart ('k') | pkg/analyzer/lib/src/generated/workspace.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698