Update dependency analyzer to v7 - autoclosed #25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
^0.39.5->^7.0.0Release Notes
dart-lang/sdk (analyzer)
v7.0.0DartType.element2.DartType.isDynamic.DartType.isVoid.DartType.resolveToBound.IfElement.condition.IfStatement.condition.AstNode.getPropertyandAstNode.setProperty.File.createSource(), it violates levels of abstraction.You can get
Sourceinstances fromAnalysisResults.LibraryElement.toLegacyTypeIfOptOut.LibraryElement.toLegacyElementIfOptOut.LibraryElement.isNonNullableByDefault.File.changesandFolder.changes.Resource.parent2.OnClause.ContextBuilder, useAnalysisContextCollection.ContextLocator, useAnalysisContextCollection.ClassOrAugmentationDeclaration..MixinOrAugmentationDeclaration..AnalysisError.TypeSystem.instantiateToBounds2.buildSdkSummary2().FileSource.fileReadMode.ErrorReporter.Comment.isBlock,isDocumentation,isEndOfLine.Element.enclosingElement.PropertyAccessor.variable.LibraryOrAugmentationElement.LibraryElementproperties.enabledPluginNamesandhintfromAnalysisOptions.source_io.dart.lint/Spelunker.source_resource.dart.MultiplyInheritedExecutableElement.AnalyzeFunctionBodiesPredicate.normalParameterNamesandoptionalParameterNamesfromFunctionType.v6.11.0LibraryElement.exportedLibraries.LibraryElement.importedLibraries.v6.10.0LibraryElement.accessibleExtensions, useCompilationUnitElement.accessibleExtensionsinstead.LibraryElement.exportedLibraries.LibraryElement.importedLibraries.LibraryElement.isBrowserApplication.LibraryElement.libraryExports,use
CompilationUnitElement.libraryExportsinstead.LibraryElement.libraryImports,use
CompilationUnitElement.libraryImportsinstead.LibraryElement.prefixes,use
CompilationUnitElement.libraryImportPrefixesinstead.LibraryElement.parts,use
CompilationUnitElement.partsinstead.LibraryElement.scope,use
CompilationUnitElement.scopeinstead.v6.9.0NormalFormalParameternow implementsAnnotatedNode.Element.enclosingElement, useenclosingElement3.v6.8.0AnalysisContextCollection.dispose(). It must be invoked at the end.ContextLocatorandContextBuilder.Use
AnalysisContextCollectioninstead.v6.7.0File.createSource(), it violates levels of abstraction.You can get
Sourceinstances fromAnalysisResults.AnalysisError.v6.6.0src/file_system/file_system.dartfrom
file_system/file_system.dart.package:analyzer/src/source/source_resource.dart,import
package:analyzer/source/file_source.dartinstead.package:analyzer/src/source/source.dart,import
package:analyzer/source/source.dartinstead.v6.5.2macros: '>=0.1.2-0 <0.1.3'.v6.5.1macros: '>=0.1.1-0 <0.1.2'.v6.5.0LibraryElement.toLegacyTypeIfOptOut.LibraryElement.toLegacyElementIfOptOut.LibraryElement.isNonNullableByDefault.InterfaceElement.lookUpGetter,InterfaceElement.lookUpMethod,and
InterfaceElement.lookUpSetter.GeneralizingAstVisitor.visitNamedTypeto invokevisitTypeAnnotation.PropertyInducingElement get variableinPropertyAccessorElement,use
PropertyInducingElement? get variable2instead.The reason for this is that when the property accessor is an augmentation
without the corresponding declaration, there is no corresponding variable.
ExtensionDeclaration.onKeywordandextendedType.Use
ExtensionOnClause? get onClauseinstead.Extension augmentations are not allowed to have
onClause.OnClause, useMixinOnClauseinstead.@doNotSubmit.@mustBeConst.constructor,directive,enumValue, andtypeParameter.AstNode.getPropertyandAstNode.setProperty. Clients who needthe ability to add arbitrary decorations to AST nodes can achieve the same
effect using Dart's built-in
Expando class.
v6.4.1v6.3.03.3.ConstantEvaluator.v6.2.0v6.1.0InstanceElement, a super-interface forInterfaceElementand
ExtensionElement.TypeSystem.greatestLowerBound.v6.0.0declaredElement2from AST.element2from AST.name2from AST.FunctionBody.isPotentiallyMutatedInClosure.extensionName,staticElementfromExtensionOverride.namefromNamedType.v5.13.0InvalidTypeis now used when types or property cannot be resolved.Previously
DynamicTypewas used.v5.12.0DartType.isDynamic, useis DynamicTypeinstead.NamedTypeto useimportPrefixandname2token.The deprecated
namenode is still visited in this version, but will stopin the next major version.
ExtensionOverrideto useimportPrefixandnametoken.The deprecated
extensionNamenode is still visited in this version, butwill stop in the next major version.
AnalysisErrorconstructor, usetmpconstructor,with names formal parameters. Theoretically no clients should use either,
but practically there are two uses currently.
InvalidType, used when a named type cannot be resolved, or aproperty cannot be resolved, etc. Previously
DynamicTypewas used.In the future
DynamicTypewill be used only when specified explicitly,or a property is resolved against a dynamic target. The clients should
prepare by checking also for
InvalidTypein addition toDynamicType.v5.11.1finalKeyword,interfaceKeywordandsealedKeywordofMixinElement. We added them preliminary whileworking on the class modifiers feature, but eventually decided to remove.
https://github.com/dart-lang/sdk/issues/52159es/52159 for details.
v5.11.0@experimentalfrom AST nodes and elements for records and patterns.IfStatement.condition, useexpressioninstead.NamedType.importPrefix,NamedType.name2, andNamedType.element.Deprecated
NamedType.name. CurrentlyIdentifieris an expression, andan expression as a name of a type does not make sense. So, instead we model
it as a name token, the
Elementthat it references, and an optional importlibrary prefix reference.
v5.10.0DartType.isDartCoreType.v5.9.0FunctionBody.isPotentiallyMutatedInClosure, not used by clients.FunctionBody.isPotentiallyMutatedInScopeand pattern assignment.v5.8.0DartType.isVoid, useis VoidTypeinstead.records,patterns, andclass-modifiersfeatures enabled by default.v5.7.1>=2.19.0 <3.0.0to usePathNotFoundExceptionfromdart:io.v5.6.0DartPattern.precedence.v5.5.0RecordPatternFieldtoPatternField.RecordPatternFieldNametoPatternFieldName.v5.4.0v5.3.1collection: ^1.17.0because we useelementAtOrNull.v5.2.0Element.enclosingElement3, useenclosingElementinstead.Directive.element2, useelementinstead.CatchClause.exceptionParameter2, useexceptionParameterinstead.CatchClause.stackTraceParameter2, usestackTraceParameterinstead.DartType.element2, useelementinstead.Element.isAccessibleIn2(), useisAccessibleIn()instead.CompilationUnitElement.enums2, useenumsinstead.CompilationUnitElement.getEnum2(), usegetEnum()instead.CompilationUnitElement.mixins2, usemixinsinstead.LibraryElement.parts2, usepartsinstead.ImportElement.imports2, useimportsinstead.AnalysisDriverForPackageBuild.sdkLibraryUris.buildSdkSummary2(), usebuildSdkSummary()instead.v5.1.0AstNode.name2, usenameinstead.AstNode.declaredElement2, usedeclaredElementinstead.v5.0.0DiagnosticMessage.message.LibraryElement.getImportsWithPrefix().ParameterElement.isNotOptional.DartType.displayName.AnalysisDriver.ClassOrMixinDeclaration.Declaration.declaredElement.Element.enclosingElementandenclosingElement2.ExportElement,ImportElement.NamedCompilationUnitMember.name.Declaration.declaredElement.DartType.element.v4.7.0addXyztoNodeLintRegistry.lookUpInheritedConcreteX()toInterfaceElement.v4.6.0DartType.element2, so thatInterfaceType.element2overrides it.v4.5.0FormalParameter.identifier.ClassOrMixinDeclaration, useClassDeclarationandMixinDeclarationdirectly.Declaration.declaredElement, usedeclaredElement2instead.This is necessary to separate
ClassElement,EnumElement, andMixinElement.And, in the future, augmentations like
ClassAugmentationElement, etc.TypeSystem.instantiateToBounds2(), useinstantiateInterfaceToBounds()orinstantiateTypeAliasToBounds()instead.v4.4.0ClassDeclaration.isAbstract, useabstractKeywordinstead.ClassTypeAlias.isAbstract, useabstractKeywordinstead.ClassOrMixinDeclaration.getField, filtermembersinstead.ClassOrMixinDeclaration.getMethod, filtermembersinstead.ClassDeclaration.getConstructor, filtermembersinstead.Directive.element, useelement2instead.ClassElement.hasStaticMember, it is not useful for clients.NamespaceDirective.uriElement, useelement2.uriwithDirectiveUriWithLibraryinstead.UriBasedDirective.uriContent,UriBasedDirective.uriElement,UriBasedDirective.uriSource.Use
Directive.element2.uriinstead.NamespaceDirective.selectedSource, useelement2.uriwithDirectiveUriWithSourceinstead.Configuration.uriSource, useresolvedUriinstead.CatchClause.exceptionParameterandCatchClause.stackTraceParameter.Use
exceptionParameter2andstackTraceParameter2instead.FileResult.isAugmentationandisLibraryto complementisPart.name2anddeclaredElementinstead.Element.enclosingElement2, useenclosingElement3instead. The meaningful change is thatConstructorElement.enclosingElement3returns nowInterfaceElement, notClassElement.get enums/mixin, useget enums2/mixins2instead.DartType.element, check forInterfaceType,TypeParameterType, and then ask the element.ClassElement.isEnumandisMixin. Check foris EnumElementandis MixinElementinstead.LibraryElement.getType()usegetClass()instead.v4.3.1identifierforLibraryExportElementandLibraryImportElement.v4.3.0Directive.keyword, use correspondingxyzTokenin specific directives.LibraryElement.parts, useparts2instead.LibraryElement.exports, uselibraryExportsinstead.LibraryElement.imports, uselibraryImportsinstead.Element.enclosingElement, useenclosingElement2instead.Memberis not equal toElementImpl, useElement.declaration.v4.2.0>=2.17.0 <3.0.0.ImportDirective.COMPARATOR, use appropriate custom logic, if necessary.Element.isAccessibleIn(), useisAccessibleIn2()instead.v4.1.0ParameterElement.isNotOptional, useisRequiredinstead.ResourceProviderMixin.newFile2, usenewFileinstead.ResourceProviderMixin.newAnalysisOptionsYamlFile2, usenewAnalysisOptionsYamlFileinstead.DartType.resolveToBound, useTypeSystem.resolveToBoundinstead.LibraryElement.getImportsWithPrefix, usePrefixElement.importsinstead.AnalysisSession.getFile()to return updated content afterapplyPendingFileChanges.v4.0.0UriKindandSource.uriKind.LibraryElement.hasExtUri.LibraryElement.hasLoadLibraryFunction.ImportElement.prefixOffset.CompilationUnitElement.types.Source.encoding.Source.isInSystemLibrary.Source.modificationStamp.stampinMemoryResourceProvider.SourceFactory.restoreUri, usepathToUriinstead.AnalysisContext.workspace.isNonNullableByDefaultparameter inErrorReporteris now required.Element.SORT_BY_OFFSET, it is not used.AnalysisSession.getFileandgetParsedUnitto failif there are pending file changes, instead of reading. As for any other
AnalysisSessionmethod, awaitAnalysisContext.applyPendingFileChanges().Token.copy()andcopyComments().CommentToken.remove().astFactoryandAstFactory.AnalysisOptions.signatureandsignaturesEqual.buildSdkSummary().v3.4.1Compare Source
AnalysisSession.v3.4.0Compare Source
Resource.parent2, useparentinstead.astFactory, clients should not create AST nodes manually.CompilationUnit.lineInfoto be non-nullable.CompilationUnitElement.lineInfoto be non-nullable.ResourceProviderMixin.newFile, usenewFile2instead.ResourceProviderMixin.newAnalysisOptionsYamlFile.AnalysisContext.changeFileandAnalysisContext.applyPendingFileChanges.buildSdkSummary, use asynchronousbuildSdkSummary2instead.v3.3.1Compare Source
v3.3.0Compare Source
getFieldtoExtensionElement.isGenerativetoConstructorElement.isDartCoreEnumtoClassElementandDartType.superclass2,mixinTypes2, etc. Usesuperclass,mixinTypes, etc.enhanced-enumslanguage feature.v3.2.0Compare Source
changesgetter inFileandFolder, usewatch()instead.v3.1.0Compare Source
package:dart_style.MockSdkclass.AnalysisDriverconstructor.2.17.v3.0.0DartType.aliasElement/aliasArguments.FeatureSet.UnitElementResult.signature- unused by clients.AnalysisError.withNamedArguments.ErrorReporter.reportErrorMessage.ResourceProvider.getModificationTimes().MemoryResourceProvider.newDummyLink().MemoryResourceProvider.updateFile().Resource.parent.ResultStateandAnalysisResult.state.summary_file_builderlibrary.messageandcorrectionfromErrorCode.lookUpmethods fromInterfaceType.InterfaceType.getSmartLeastUpperBound.pathandurifromAnalysisResult.AnalysisSession.TypeNameand corresponding methods.TypeProvider.v2.8.0getXyzmethods inAnalysisDriver.doublein mock SDK.pathandurifromAnalysisResult.UriResolver.restoreAbsolute, usepathToUriinstead.SourceFactory.restoreAbsolute, usepathToUriinstead.UriKindandSource.uriKind.Source.modificationStamp.Source.isInSystemLibrary, useuri.isScheme('dart')instead.v2.7.0Compare Source
ConstructorElement.displayNameto eitherClassorClass.constructor.InterfaceType.getSmartLeastUpperBound, useTypeSystem.leastUpperBoundinstead.MockSdk, usecreateMockSdkandFolderBasedDartSdkinstead.v2.6.0Compare Source
AnalysisResult.state, check for specific valid or invalid subtypes.ResultState.LibraryElement.hasExtUri, FFI should be used instead.v2.5.0Compare Source
MockSdkto include more declarations.v2.4.0Compare Source
ResourceProvider.getModificationTimes().MemoryResourceProvider.newDummyLink().MemoryResourceProvider.updateFile().TypeName, useNamedTypeinstead.AstVisitor.visitNamedType()instead ofvisitTypeName().ClassTypeAlias.superclass, usesuperclass2instead.ConstructorName.type, usetype2instead.ExtendsClause.superclass, usesuperclass2instead.ImplementsClause.interfaces, useinterfaces2instead.OnClause.superclassConstraints, usesuperclassConstraints2instead.TypeLiteral.typeName, usetypeinstead.WithClause.mixinTypes, usemixinTypes2instead.AstFactory.typeName(), usenamedType()instead.v2.3.0Compare Source
constructor-tearoffsfeature by default in2.15.v2.2.0Compare Source
v2.1.0Compare Source
AnalysisResult.pathto be non-nullable.ParsedLibraryResult.unitsto be non-nullable.ResolvedLibraryResult.elementto be non-nullable.ResolvedLibraryResult.unitsto be non-nullable.ResolvedUnitResult.contentto be non-nullable.ResolvedUnitResult.unitto be non-nullable.AnalysisSession.getXyz2()intogetXyz().AnalysisDriver.resultstoStream<Object>.It used to always produce
ResolvedUnitResults, but sometimes itscontentandunitwerenull, when the result actually had only errors.Now it produces either
ResolvedUnitResult, orErrorsResult, orsome other results that might be added in the future.
DartType.aliaswith information about instantiated type alias.The type alias element and arguments are present or absent together.
DartType.aliasElementandDartType.aliasArguments.2.15.v2.0.0Compare Source
Scope.lookup2().FunctionTypeAliasElement.LineInfo.getLocation()to returnCharacterLocation.LineInfo_Location.AnalysisSession.DartObject.typefromParameterizedType?toDartType?.FunctionTypeto implementDartType, notParameterizedType.FunctionType.elementandFunctionType.typeArguments.DartObject.typefromParameterizedType?toDartType?.FunctionTypeto implementDartType, notParameterizedType.FunctionType.elementandFunctionType.typeArguments.StringInterpolation.firstStringandlastString, to expressexplicitly that there are always (possibly empty) strings as the first
and the last elements of an interpolation.
ImportElement.prefixOffset, useprefix.nameOffsetinstead.CompilationUnitElement.types, useclassesinstead.Element.nonSynthetic, use it to get the element that caused creationof this element, e.g. the field for a synthetic getter.
FieldElement.isFinalistrueonly when the field is not synthetic.-1asnameOffset.defaultValueCodeisnullfor field formal parameters.LibraryElement.nameso that it is non-nullable.v1.7.2Compare Source
v1.7.1Compare Source
v1.7.0Compare Source
meta: ^1.4.0.v1.6.0Compare Source
AnalysisDriverdefault constructor. Addedtmp1. The goalis to allow deprecating and removing unused parameters.
tearoffs" feature:
ConstructorReference,FunctionReference, andTypeLiteral.v1.5.0Compare Source
2.14.AnalysisSession.getUnitElement().Use
AnalysisSession.getUnitElement2()instead.AnalysisSession.getResolvedUnit().Use
AnalysisSession.getResolvedUnit2()instead.AnalysisSession.getResolvedLibrary().Use
AnalysisSession.getResolvedLibrary2()instead.AnalysisSession.getResolvedLibraryByElement().Use
AnalysisSession.getResolvedLibraryByElement2()instead.AnalysisSession.getLibraryByUri().Use
AnalysisSession.getLibraryByUri2()instead.AnalysisSession.getErrors().Use
AnalysisSession.getErrors2()instead.AnalysisSession.getParsedLibrary().Use
AnalysisSession.getParsedLibrary2()instead.AnalysisSession.getParsedLibraryByElement().Use
AnalysisSession.getParsedLibraryByElement2()instead.AnalysisSession.getParsedUnit().Use
AnalysisSession.getParsedUnit2()instead.AnalysisSession.getFile()andgetSourceKind().Use
AnalysisSession.getFile2()instead.AnalysisSession.getUnitElementSignature().This method is not used by any known client, and will be removed.
v1.4.0Compare Source
TypeProvider.nonSubtypableClasses.Use
TypeProvider.isNonSubtypableClassinstead.sdkPathtoAnalysisContextCollectionconstructor.nonfunction-type-aliasesis enabled by default in thelanguage version
2.13.v1.3.0Compare Source
Expression.inConstantContextto API.null.CompilationUnitElement.mixinsbeforetypes.v1.2.0Compare Source
parseString()instead.AnalysisSession.getErrors()does not returnnull, check itsstate.aliasElementandaliasArgumentsfor aliases ofInterfaceTypes andTypeParameterTypes.v1.1.0TypeProvider.futureType2(),iterableType2(), etc.Use corresponding
TypeProvider.futureType(),iterableType(), etc.Resource.parent2and deprecatedResource.parent.Folder.isRoot.FolderExtensionwithwithAncestors.ContextRoot.workspace, deprecatedAnalysisContext.workspace.ElementVisitor.visitFunctionTypeAliasElement().Override
ElementVisitor.visitTypeAliasElement()instead.FunctionTypeAliasElement. UseTypeAliasElementinstead.v1.0.0v0.41.1PackageBuildWorkspacethat supportspackage:buildto stopat the first directory with
pubspec.yaml, and don't try to go upand find another one with both
pubspec.yamland.dart_tool/build.ErrorCodeclass. It will be used tomigrate existing
ErrorCodesubclasses, and then deprecated and removed.v0.41.0Scope.lookup({id, setter})withlookup(id).Scope.lookup2(id), uselookup()instead.Member.baseElement.package:analyzer/analyzer.dartlibrary.ElementAnnotation.constantValue.VariableElement.constantValue.VariableElement.initializer.auxiliaryElements.FunctionType.elementfor types created from atypedefis now
FunctionTypeAliasElement, not its function element.GenericTypeAliasElement.PhysicalResourceProvider.NORMALIZE_EOL_ALWAYS.PhysicalResourceProviderconstructor to no longer take arequired positional parameter (removed the existing
fileReadModepositionalparameter).
v0.40.6Instead of the latest known language version, the language version of the
SDK (against which analysis is done, not necessary the same as used to run
the analyzer) is used.
v0.40.5GenericTypeAliasElement. UseFunctionTypeAliasElement.AnalysisDriver.Specifically,
parseFileSyncwill not read any referenced files.identifiers in metadata (still set in arguments).
v0.40.4IndexExpression.auxiliaryElementsandSimpleIdentifier.auxiliaryElements. UseCompoundAssignmentExpression.getReadType, useCompoundAssignmentExpression.v0.40.32.11.43462, 43439, 43162, 43397, 43200.
v0.40.2meta: ^1.2.3.v0.40.1LocalVariableElement.hasInitializer,PropertyInducingElement.hasInitializer,ParameterElement.hasDefaultValue.ElementImpl.toString()usesgetDisplayString(withNullability: true).ElementAnnotation.constantValue, it does not guarantee thatthe value has been computed. Use
computeConstantValue()instead.CompoundAssignmentExpressionwith read/write element/type getters.This interface is implemented by
AssignmentExpression,PostfixExpressionand
PrefixExpression. Use it instead ofstaticElementandstaticTypeof the left-hand side expressions (target expressions in case of postfix
or prefix expressions with increment operator).
43032, 43073.
v0.40.0LibraryElement.featureSet.EmbedderSdkand related classes.FunctionTypereturned fromExecutableElement.typereturnnullas its
element. UseExecutableElements directly if necessary.FunctionTypeAliasElementdoes not implementFunctionTypedElementanymore, implements
TypeParameterizedElementinstead.CustomUriResolver.ExplicitSourceResolver,FileUriResolver,LocalSourcePredicate,PackageUriResolver,RelativeFileUriResolver.ErrorCodeinstances.withNullabilityflag inDartType.getDisplayString()is now required.DartType.substitute2, andFunctionType.substitute3,use
ClassElement.instantiate,FunctionTypeAliasElement.instantiate(),or
FunctionType.instantiate().FunctionType.boundTypeParameters, usetypeFormalsfor now. Later, it will be deprecated, and replaced with
typeParameters.InterfaceType.instantiate(),InterfaceType.substitute4,use
ClassElement.instantiate().typeParametersandinstantiate()fromParameterizedType.Use
typeParametersandinstantiate()fromClassElement.DeclaredVariables.typeProviderandtypeSystemgetters.Use corresponding
LibraryElementgetters instead.AnalysisOptions.ClassElement.hasReferenceToSuper.DartType.isObject.Use
DartType.isDartCoreObjectinstead.AnalysisContextandContextLocator.ParseResultandResolveResult.AnalysisContext.typeProviderandtypeSystem.Use the corresponding getters of
LibraryElement.AnalysisSession.dart/ast/ast.dart.AstFactory.parseFile2..TypeDefiningElement.type.Featureare not constants anymore.Feature.firstSupportedVersionwithreleaseVersion.Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.