@@ -294,10 +294,8 @@ abstract class ContextManagerCallbacks {
294294 /// Return the notification manager associated with the server.
295295 AbstractNotificationManager get notificationManager;
296296
297- /// Create and return a new analysis driver rooted at the given [folder] , with
298- /// the given analysis [options] .
299- AnalysisDriver addAnalysisDriver (
300- Folder folder, ContextRoot contextRoot, AnalysisOptions options);
297+ /// Create and return a new analysis driver rooted at the given [folder] .
298+ AnalysisDriver addAnalysisDriver (Folder folder, ContextRoot contextRoot);
301299
302300 /// An [event] was processed, so analysis state might be different now.
303301 void afterWatchEvent (WatchEvent event);
@@ -318,9 +316,8 @@ abstract class ContextManagerCallbacks {
318316 void broadcastWatchEvent (WatchEvent event);
319317
320318 /// Create and return a context builder that can be used to create a context
321- /// for the files in the given [folder] when analyzed using the given
322- /// [options] .
323- ContextBuilder createContextBuilder (Folder folder, AnalysisOptions options);
319+ /// for the files in the given [folder] .
320+ ContextBuilder createContextBuilder (Folder folder);
324321
325322 /// Remove the context associated with the given [folder] . [flushedFiles] is
326323 /// a list of the files which will be "orphaned" by removing this context
@@ -377,9 +374,6 @@ class ContextManagerImpl implements ContextManager {
377374 /// A list of the globs used to determine which files should be analyzed.
378375 final List <Glob > analyzedFilesGlobs;
379376
380- /// The default options used to create new analysis contexts.
381- final AnalysisOptionsImpl defaultContextOptions;
382-
383377 /// The instrumentation service used to report instrumentation data.
384378 final InstrumentationService _instrumentationService;
385379
@@ -400,11 +394,11 @@ class ContextManagerImpl implements ContextManager {
400394 < Folder , StreamSubscription <WatchEvent >> {};
401395
402396 ContextManagerImpl (
403- this .resourceProvider,
404- this .sdkManager,
405- this .analyzedFilesGlobs,
406- this ._instrumentationService,
407- this .defaultContextOptions ) {
397+ this .resourceProvider,
398+ this .sdkManager,
399+ this .analyzedFilesGlobs,
400+ this ._instrumentationService,
401+ ) {
408402 pathContext = resourceProvider.pathContext;
409403 }
410404
@@ -1006,7 +1000,7 @@ class ContextManagerImpl implements ContextManager {
10061000 } catch (_) {
10071001 // Parse errors are reported elsewhere.
10081002 }
1009- AnalysisOptions options = AnalysisOptionsImpl . from (defaultContextOptions );
1003+ var options = AnalysisOptionsImpl ( );
10101004 applyToAnalysisOptions (options, optionMap);
10111005
10121006 info.setDependencies (dependencies);
@@ -1021,8 +1015,7 @@ class ContextManagerImpl implements ContextManager {
10211015 if (optionsFile != null ) {
10221016 contextRoot.optionsFilePath = optionsFile.path;
10231017 }
1024- info.analysisDriver =
1025- callbacks.addAnalysisDriver (folder, contextRoot, options);
1018+ info.analysisDriver = callbacks.addAnalysisDriver (folder, contextRoot);
10261019 if (optionsFile != null ) {
10271020 _analyzeAnalysisOptionsFile (info.analysisDriver, optionsFile.path);
10281021 }
@@ -1115,8 +1108,8 @@ class ContextManagerImpl implements ContextManager {
11151108
11161109 /// Set up a [SourceFactory] that resolves packages as appropriate for the
11171110 /// given [folder] .
1118- SourceFactory _createSourceFactory (AnalysisOptions options, Folder folder) {
1119- var builder = callbacks.createContextBuilder (folder, options );
1111+ SourceFactory _createSourceFactory (Folder folder) {
1112+ var builder = callbacks.createContextBuilder (folder);
11201113 return builder.createSourceFactory (folder.path);
11211114 }
11221115
@@ -1481,8 +1474,7 @@ class ContextManagerImpl implements ContextManager {
14811474 void _updateAnalysisOptions (ContextInfo info) {
14821475 var driver = info.analysisDriver;
14831476 var contextRoot = info.folder.path;
1484- var builder =
1485- callbacks.createContextBuilder (info.folder, defaultContextOptions);
1477+ var builder = callbacks.createContextBuilder (info.folder);
14861478 var options = builder.getAnalysisOptions (contextRoot,
14871479 contextRoot: driver.contextRoot);
14881480 var factory = builder.createSourceFactory (contextRoot);
@@ -1493,8 +1485,7 @@ class ContextManagerImpl implements ContextManager {
14931485 void _updateContextPackageUriResolver (Folder contextFolder) {
14941486 var info = getContextInfoFor (contextFolder);
14951487 var driver = info.analysisDriver;
1496- var sourceFactory =
1497- _createSourceFactory (driver.analysisOptions, contextFolder);
1488+ var sourceFactory = _createSourceFactory (contextFolder);
14981489 driver.configure (sourceFactory: sourceFactory);
14991490 }
15001491
0 commit comments