diff --git a/pkg/analyzer/lib/src/dart/analysis/context_builder.dart b/pkg/analyzer/lib/src/dart/analysis/context_builder.dart index 6bda1ac70c5..ba3dd42f461 100644 --- a/pkg/analyzer/lib/src/dart/analysis/context_builder.dart +++ b/pkg/analyzer/lib/src/dart/analysis/context_builder.dart @@ -247,8 +247,7 @@ class ContextBuilderImpl { ); { - // TODO(scheglov): We already had partial SourceFactory in ContextLocatorImpl. - var partialSourceFactory = workspace.createSourceFactory(null, null); + var partialSourceFactory = workspace.partialSourceFactory; var embedderYamlSource = partialSourceFactory.forUri( 'package:sky_engine/_embedder.yaml', ); diff --git a/pkg/analyzer/lib/src/dart/analysis/context_locator.dart b/pkg/analyzer/lib/src/dart/analysis/context_locator.dart index d0ceea0d09f..d19089a3a59 100644 --- a/pkg/analyzer/lib/src/dart/analysis/context_locator.dart +++ b/pkg/analyzer/lib/src/dart/analysis/context_locator.dart @@ -242,7 +242,9 @@ class _ContextLocator { required _RootLocation location, }) { if (location.workspace is WorkspaceWithDefaultAnalysisOptions) { - optionsFile ??= _findDefaultOptionsFile(location.sourceFactory); + optionsFile ??= _findDefaultOptionsFile( + location.workspace.partialSourceFactory, + ); } var root = ContextRootImpl( @@ -257,7 +259,7 @@ class _ContextLocator { } root.excludedGlobs.addAll( - _getExcludedGlobs(optionsFile, location.sourceFactory), + _getExcludedGlobs(optionsFile, location.workspace.partialSourceFactory), ); roots.add(root); return root; @@ -918,9 +920,6 @@ class _RootLocation { final File? optionsFile; final File? packageConfigFile; - /// A single source factory for [workspace]. - late final sourceFactory = workspace.createSourceFactory(null, null); - _RootLocation({ required this.rootFolder, required this.workspace,