Skip to content

Commit 03af569

Browse files
author
Dart CI
committed
Version 2.12.0-7.0.dev
Merge commit '77f2019f00858ac60dbca006ed93f11576b757b4' into 'dev'
2 parents dd31207 + 77f2019 commit 03af569

File tree

100 files changed

+1556
-2678
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1556
-2678
lines changed

.dart_tool/package_config.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,6 @@
228228
"packageUri": "lib/",
229229
"languageVersion": "2.10"
230230
},
231-
{
232-
"name": "dartfix",
233-
"rootUri": "../pkg/dartfix",
234-
"packageUri": "lib/",
235-
"languageVersion": "2.8"
236-
},
237231
{
238232
"name": "dds",
239233
"rootUri": "../pkg/dds",

.packages

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ dart_internal:pkg/dart_internal/lib
3535
dart_style:third_party/pkg_tested/dart_style/lib
3636
dartdev:pkg/dartdev/lib
3737
dartdoc:third_party/pkg/dartdoc/lib
38-
dartfix:pkg/dartfix/lib
3938
dds:pkg/dds/lib
4039
dev_compiler:pkg/dev_compiler/lib
4140
diagnostic:pkg/diagnostic/lib

pkg/analysis_server/lib/src/analysis_server.dart

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -626,10 +626,6 @@ class AnalysisServerOptions {
626626
/// generally used in specific SDKs (like the internal google3 one).
627627
SdkConfiguration configurationOverrides;
628628

629-
/// The list of the names of the experiments that should be enabled by
630-
/// default, unless the analysis options file of a context overrides it.
631-
List<String> enabledExperiments = const <String>[];
632-
633629
/// Whether to use the Language Server Protocol.
634630
bool useLanguageServerProtocol = false;
635631

@@ -659,9 +655,8 @@ class ServerContextManagerCallbacks extends ContextManagerCallbacks {
659655
analysisServer.notificationManager;
660656

661657
@override
662-
nd.AnalysisDriver addAnalysisDriver(
663-
Folder folder, ContextRoot contextRoot, AnalysisOptions options) {
664-
var builder = createContextBuilder(folder, options);
658+
nd.AnalysisDriver addAnalysisDriver(Folder folder, ContextRoot contextRoot) {
659+
var builder = createContextBuilder(folder);
665660
var analysisDriver = builder.buildDriver(contextRoot);
666661
analysisDriver.results.listen((result) {
667662
var notificationManager = analysisServer.notificationManager;
@@ -814,9 +809,8 @@ class ServerContextManagerCallbacks extends ContextManagerCallbacks {
814809
}
815810

816811
@override
817-
ContextBuilder createContextBuilder(Folder folder, AnalysisOptions options) {
812+
ContextBuilder createContextBuilder(Folder folder) {
818813
var builderOptions = ContextBuilderOptions();
819-
builderOptions.defaultOptions = options;
820814
var builder = ContextBuilder(
821815
resourceProvider, analysisServer.sdkManager, null,
822816
options: builderOptions);

pkg/analysis_server/lib/src/analysis_server_abstract.dart

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import 'package:analysis_server/src/utilities/file_string_sink.dart';
2222
import 'package:analysis_server/src/utilities/null_string_sink.dart';
2323
import 'package:analysis_server/src/utilities/request_statistics.dart';
2424
import 'package:analysis_server/src/utilities/tee_string_sink.dart';
25-
import 'package:analyzer/dart/analysis/features.dart' as analyzer_features;
2625
import 'package:analyzer/dart/analysis/results.dart';
2726
import 'package:analyzer/dart/analysis/session.dart';
2827
import 'package:analyzer/dart/ast/ast.dart';
@@ -34,8 +33,6 @@ import 'package:analyzer/file_system/physical_file_system.dart';
3433
import 'package:analyzer/instrumentation/instrumentation.dart';
3534
import 'package:analyzer/src/dart/analysis/byte_store.dart';
3635
import 'package:analyzer/src/dart/analysis/driver.dart' as nd;
37-
import 'package:analyzer/src/dart/analysis/experiments.dart'
38-
as analyzer_features;
3936
import 'package:analyzer/src/dart/analysis/file_byte_store.dart'
4037
show EvictingFileByteStore;
4138
import 'package:analyzer/src/dart/analysis/performance_logger.dart';
@@ -60,10 +57,6 @@ abstract class AbstractAnalysisServer {
6057
/// context directories.
6158
ContextManager contextManager;
6259

63-
/// The default options used to create new analysis contexts. This object is
64-
/// also referenced by the ContextManager.
65-
final AnalysisOptionsImpl defaultContextOptions = AnalysisOptionsImpl();
66-
6760
/// The object used to manage sending a subset of notifications to the client.
6861
/// The subset of notifications are those to which plugins may contribute.
6962
/// This field is `null` when the new plugin support is disabled.
@@ -155,12 +148,6 @@ abstract class AbstractAnalysisServer {
155148
instrumentationService);
156149
var pluginWatcher = PluginWatcher(resourceProvider, pluginManager);
157150

158-
defaultContextOptions.contextFeatures =
159-
analyzer_features.FeatureSet.fromEnableFlags2(
160-
sdkLanguageVersion: analyzer_features.ExperimentStatus.currentVersion,
161-
flags: options.enabledExperiments,
162-
);
163-
164151
{
165152
var name = options.newAnalysisDriverLog;
166153
StringSink sink = NullStringSink();
@@ -192,7 +179,7 @@ abstract class AbstractAnalysisServer {
192179
}
193180

194181
contextManager = ContextManagerImpl(resourceProvider, sdkManager,
195-
analyzedFilesGlobs, instrumentationService, defaultContextOptions);
182+
analyzedFilesGlobs, instrumentationService);
196183
searchEngine = SearchEngineImpl(driverMap.values);
197184
}
198185

pkg/analysis_server/lib/src/context_manager.dart

Lines changed: 15 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -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

pkg/analysis_server/lib/src/lsp/lsp_analysis_server.dart

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import 'package:analyzer/src/context/builder.dart';
4343
import 'package:analyzer/src/context/context_root.dart';
4444
import 'package:analyzer/src/dart/analysis/driver.dart' as nd;
4545
import 'package:analyzer/src/dart/analysis/status.dart' as nd;
46-
import 'package:analyzer/src/generated/engine.dart';
4746
import 'package:analyzer/src/generated/sdk.dart';
4847
import 'package:analyzer_plugin/protocol/protocol_common.dart' as plugin;
4948
import 'package:analyzer_plugin/protocol/protocol_generated.dart' as plugin;
@@ -741,9 +740,8 @@ class LspServerContextManagerCallbacks extends ContextManagerCallbacks {
741740
analysisServer.notificationManager;
742741

743742
@override
744-
nd.AnalysisDriver addAnalysisDriver(
745-
Folder folder, ContextRoot contextRoot, AnalysisOptions options) {
746-
var builder = createContextBuilder(folder, options);
743+
nd.AnalysisDriver addAnalysisDriver(Folder folder, ContextRoot contextRoot) {
744+
var builder = createContextBuilder(folder);
747745
var analysisDriver = builder.buildDriver(contextRoot);
748746
final textDocumentCapabilities =
749747
analysisServer.clientCapabilities?.textDocument;
@@ -838,9 +836,8 @@ class LspServerContextManagerCallbacks extends ContextManagerCallbacks {
838836
}
839837

840838
@override
841-
ContextBuilder createContextBuilder(Folder folder, AnalysisOptions options) {
839+
ContextBuilder createContextBuilder(Folder folder) {
842840
var builderOptions = ContextBuilderOptions();
843-
builderOptions.defaultOptions = options;
844841
var builder = ContextBuilder(
845842
resourceProvider, analysisServer.sdkManager, null,
846843
options: builderOptions);

pkg/analysis_server/lib/src/server/driver.dart

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -234,9 +234,6 @@ class Driver implements ServerStarter {
234234
static const String DISABLE_SERVER_FEATURE_SEARCH =
235235
'disable-server-feature-search';
236236

237-
/// The name of the option used to enable experiments.
238-
static const String ENABLE_EXPERIMENT_OPTION = 'enable-experiment';
239-
240237
/// The name of the option used to enable instrumentation.
241238
static const String ENABLE_INSTRUMENTATION_OPTION = 'enable-instrumentation';
242239

@@ -336,10 +333,6 @@ class Driver implements ServerStarter {
336333

337334
analysisServerOptions.clientVersion = results[CLIENT_VERSION];
338335
analysisServerOptions.cacheFolder = results[CACHE_FOLDER];
339-
if (results.wasParsed(ENABLE_EXPERIMENT_OPTION)) {
340-
analysisServerOptions.enabledExperiments =
341-
(results[ENABLE_EXPERIMENT_OPTION] as List).cast<String>().toList();
342-
}
343336
analysisServerOptions.useNewRelevance = results[USE_NEW_RELEVANCE];
344337

345338
// Read in any per-SDK overrides specified in <sdk>/config/settings.json.
@@ -769,11 +762,6 @@ class Driver implements ServerStarter {
769762
help: 'disable all completion features', defaultsTo: false, hide: true);
770763
parser.addFlag(DISABLE_SERVER_FEATURE_SEARCH,
771764
help: 'disable all search features', defaultsTo: false, hide: true);
772-
parser.addMultiOption(ENABLE_EXPERIMENT_OPTION,
773-
help: 'Enable one or more experimental features. If multiple features '
774-
'are being added, they should be comma separated.',
775-
hide: true,
776-
splitCommas: true);
777765
parser.addFlag(ENABLE_INSTRUMENTATION_OPTION,
778766
help: 'enable sending instrumentation information to a server',
779767
defaultsTo: false,

pkg/analysis_server/lib/src/services/correction/fix/data_driven/transform_set_parser.dart

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,9 @@ class TransformSetParser {
405405
Change _translateChange(YamlNode node, ErrorContext context) {
406406
assert(node != null);
407407
if (node is YamlMap) {
408-
var kind = _translateString(node.valueAt(_kindKey),
409-
ErrorContext(key: _kindKey, parentNode: node));
408+
var kindNode = node.valueAt(_kindKey);
409+
var kindContext = ErrorContext(key: _kindKey, parentNode: node);
410+
var kind = _translateString(kindNode, kindContext);
410411
if (kind == null) {
411412
return null;
412413
} else if (kind == _addParameterKind) {
@@ -420,7 +421,7 @@ class TransformSetParser {
420421
} else if (kind == _renameKind) {
421422
return _translateRenameChange(node);
422423
}
423-
return _reportInvalidValueOneOf(node, context, [
424+
return _reportInvalidValueOneOf(kindNode, kindContext, [
424425
_addParameterKind,
425426
_addTypeParameterKind,
426427
_removeParameterKind,
@@ -879,16 +880,17 @@ class TransformSetParser {
879880
/// error.
880881
ValueGenerator _translateValueGenerator(YamlNode node, ErrorContext context) {
881882
if (node is YamlMap) {
882-
var kind = _translateString(node.valueAt(_kindKey),
883-
ErrorContext(key: _kindKey, parentNode: node));
883+
var kindNode = node.valueAt(_kindKey);
884+
var kindContext = ErrorContext(key: _kindKey, parentNode: node);
885+
var kind = _translateString(kindNode, kindContext);
884886
if (kind == null) {
885887
return null;
886888
} else if (kind == _fragmentKind) {
887889
return _translateCodeFragment(node);
888890
} else if (kind == _importKind) {
889891
return _translateImportValue(node);
890892
}
891-
return _reportInvalidValueOneOf(node, context, [
893+
return _reportInvalidValueOneOf(kindNode, kindContext, [
892894
_fragmentKind,
893895
_importKind,
894896
]);

pkg/analysis_server/test/context_manager_test.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1591,11 +1591,11 @@ abstract class ContextManagerTest with ResourceProviderMixin {
15911591
MockSdk(resourceProvider: resourceProvider);
15921592
var sdkManager = DartSdkManager(convertPath(sdkRoot));
15931593
manager = ContextManagerImpl(
1594-
resourceProvider,
1595-
sdkManager,
1596-
analysisFilesGlobs,
1597-
InstrumentationService.NULL_SERVICE,
1598-
AnalysisOptionsImpl());
1594+
resourceProvider,
1595+
sdkManager,
1596+
analysisFilesGlobs,
1597+
InstrumentationService.NULL_SERVICE,
1598+
);
15991599
var logger = PerformanceLog(NullStringSink());
16001600
var scheduler = AnalysisDriverScheduler(logger);
16011601
callbacks = TestContextManagerCallbacks(
@@ -2280,15 +2280,14 @@ class TestContextManagerCallbacks extends ContextManagerCallbacks {
22802280
SourceFactory get sourceFactory => currentDriver?.sourceFactory;
22812281

22822282
@override
2283-
AnalysisDriver addAnalysisDriver(
2284-
Folder folder, ContextRoot contextRoot, AnalysisOptions options) {
2283+
AnalysisDriver addAnalysisDriver(Folder folder, ContextRoot contextRoot) {
22852284
var path = folder.path;
22862285
expect(currentContextRoots, isNot(contains(path)));
22872286
expect(contextRoot, isNotNull);
22882287
expect(contextRoot.root, path);
22892288
currentContextTimestamps[path] = now;
22902289

2291-
var builder = createContextBuilder(folder, options);
2290+
var builder = createContextBuilder(folder);
22922291
builder.analysisDriverScheduler = scheduler;
22932292
builder.byteStore = MemoryByteStore();
22942293
builder.performanceLog = logger;
@@ -2345,9 +2344,8 @@ class TestContextManagerCallbacks extends ContextManagerCallbacks {
23452344
}
23462345

23472346
@override
2348-
ContextBuilder createContextBuilder(Folder folder, AnalysisOptions options) {
2347+
ContextBuilder createContextBuilder(Folder folder) {
23492348
var builderOptions = ContextBuilderOptions();
2350-
builderOptions.defaultOptions = options;
23512349
var builder = ContextBuilder(resourceProvider, sdkManager, null,
23522350
options: builderOptions);
23532351
return builder;

pkg/analysis_server/test/lsp/signature_help_test.dart

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
// BSD-style license that can be found in the LICENSE file.
44

55
import 'package:analysis_server/lsp_protocol/protocol_generated.dart';
6-
import 'package:analysis_server/src/analysis_server.dart';
76
import 'package:test/test.dart';
87
import 'package:test_reflective_loader/test_reflective_loader.dart';
98

@@ -449,10 +448,6 @@ class SignatureHelpTest extends AbstractLspAnalysisServerTest
449448
class SignatureHelpWithNullSafetyTest extends AbstractLspAnalysisServerTest
450449
with SignatureHelpMixin {
451450
@override
452-
AnalysisServerOptions get serverOptions =>
453-
AnalysisServerOptions()..enabledExperiments = ['non-nullable'];
454-
455-
@override
456451
String get testPackageLanguageVersion => latestLanguageVersion;
457452

458453
Future<void> test_params_requiredNamed() async {

0 commit comments

Comments
 (0)