diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a59f9b..730c3ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ - Added support for `enclosing_range` on occurrences definitions - Upgraded to Dart 3.12.2 - Formatted with Dart 3.12.2 +- Upgraded to analyzer `^14.0.0` (migrated to the new element model) + - `unused_element` diagnostics are now reported with `Warning` severity + - same-package deprecated member usages are no longer reported as diagnostics ## 1.6.2 - Fixed a few minor bugs found in pubspec.yaml indexing (skips publish_to: none pubspecs, and considers "version" optional) diff --git a/lib/src/indexer.dart b/lib/src/indexer.dart index bea0c46..8d9f58b 100644 --- a/lib/src/indexer.dart +++ b/lib/src/indexer.dart @@ -40,9 +40,6 @@ Future indexPackage( final collection = AnalysisContextCollection( includedPaths: [...allPackageRoots, dirPath], - // only index dart files of the current dart package, to index nested - // packages, scip indexing can simply be re-run for that nested package - excludedPaths: nestedPackages, ); if (Flags.instance.performance) print('Analyzing Source'); @@ -52,6 +49,13 @@ Future indexPackage( final resolvedUnitFutures = context.contextRoot .analyzedFiles() .where((file) => p.extension(file) == '.dart') + // only index dart files of the current dart package, to index nested + // packages, scip indexing can simply be re-run for that nested package + .where( + (file) => !nestedPackages.any( + (nested) => p.isWithin(p.normalize(p.absolute(nested)), file), + ), + ) .map(context.currentSession.getResolvedUnit); final resolvedUnits = await Future.wait(resolvedUnitFutures); @@ -71,7 +75,7 @@ Future indexPackage( relativePath, dirPath, resUnit.lineInfo, - resUnit.errors, + resUnit.diagnostics, packageConfig, pubspec, ); diff --git a/lib/src/kind_generator.dart b/lib/src/kind_generator.dart index 3beb6e4..bc6d63e 100644 --- a/lib/src/kind_generator.dart +++ b/lib/src/kind_generator.dart @@ -24,7 +24,7 @@ SymbolInformation_Kind symbolKindFor(Element el) { return SymbolInformation_Kind.Constructor; } else if (el is MethodElement) { return SymbolInformation_Kind.Method; - } else if (el is FunctionElement) { + } else if (el is TopLevelFunctionElement || el is LocalFunctionElement) { return SymbolInformation_Kind.Function; } else if (el is TopLevelVariableElement) { return SymbolInformation_Kind.Variable; @@ -32,7 +32,7 @@ SymbolInformation_Kind symbolKindFor(Element el) { return SymbolInformation_Kind.Namespace; } else if (el is TypeParameterElement) { return SymbolInformation_Kind.TypeParameter; - } else if (el is ParameterElement) { + } else if (el is FormalParameterElement) { return SymbolInformation_Kind.Parameter; } else if (el is PropertyAccessorElement) { return SymbolInformation_Kind.Property; diff --git a/lib/src/metadata.dart b/lib/src/metadata.dart index 7f081f1..0410164 100644 --- a/lib/src/metadata.dart +++ b/lib/src/metadata.dart @@ -1,6 +1,5 @@ import 'package:analyzer/dart/element/element.dart'; import 'package:analyzer/diagnostic/diagnostic.dart'; -import 'package:analyzer/error/error.dart'; import 'package:scip_dart/src/gen/scip.pb.dart' as proto; /// The collection of AnalysisHint codes that should be considered "Unused". @@ -44,12 +43,9 @@ class SymbolMetadata { SymbolMetadata getSymbolMetadata( Element element, int offset, - List analysisErrors, + List analysisErrors, ) { - final displayString = element.getDisplayString( - withNullability: false, - multiline: true, - ); + final displayString = element.displayString(multiline: true); final docComment = element.documentationComment?.replaceAll( RegExp(r'^\s*///\s*', multiLine: true), @@ -60,12 +56,14 @@ SymbolMetadata getSymbolMetadata( .where((error) => error.offset == offset) .map( (error) => proto.Diagnostic( - code: error.errorCode.name, + code: error.diagnosticCode.lowerCaseName.toUpperCase(), message: error.message, severity: error.severity.toProto(), tags: [ - if (element.hasDeprecated) proto.DiagnosticTag.Deprecated, - if (_unusedHintCodes.contains(error.errorCode.uniqueName)) + if (element.metadata.hasDeprecated) proto.DiagnosticTag.Deprecated, + if (_unusedHintCodes.contains( + error.diagnosticCode.lowerCaseName.toUpperCase(), + )) proto.DiagnosticTag.Unnecessary, ], ), diff --git a/lib/src/relationship_generator.dart b/lib/src/relationship_generator.dart index ff4196b..0f1adfa 100644 --- a/lib/src/relationship_generator.dart +++ b/lib/src/relationship_generator.dart @@ -33,7 +33,7 @@ List? relationshipsFor( element is FieldElement || element is PropertyAccessorElement) { final parentNode = node.thisOrAncestorOfType(); - final parentElement = parentNode?.declaredElement; + final parentElement = parentNode?.declaredFragment?.element; // this shouldn't happen, but if the parent element happens to be // null, just fail fast @@ -46,16 +46,16 @@ List? relationshipsFor( .where((type) => type.name == element.name); } else if (element is FieldElement) { referencingElements = parentElement.allSupertypes - .expand((type) => type.accessors) + .expand((type) => [...type.getters, ...type.setters]) .map((acc) => acc.variable) .where((variable) => variable.name == element.name) .toSet(); // remove any duplicates caused from synthetic getters/setters } if (element is PropertyAccessorElement) { referencingElements = parentElement.allSupertypes - .expand((type) => type.accessors) - .where((acc) => acc.isSetter == element.isSetter) - .where((acc) => acc.isGetter == element.isGetter) + .expand((type) => [...type.getters, ...type.setters]) + .where((acc) => (acc is SetterElement) == (element is SetterElement)) + .where((acc) => (acc is GetterElement) == (element is GetterElement)) .where((acc) => acc.variable.name == element.variable.name); } diff --git a/lib/src/scip_visitor.dart b/lib/src/scip_visitor.dart index 083deed..4628686 100644 --- a/lib/src/scip_visitor.dart +++ b/lib/src/scip_visitor.dart @@ -1,7 +1,7 @@ import 'package:analyzer/dart/ast/ast.dart'; import 'package:analyzer/dart/ast/visitor.dart'; import 'package:analyzer/dart/element/element.dart'; -import 'package:analyzer/error/error.dart'; +import 'package:analyzer/diagnostic/diagnostic.dart' as analyzer; import 'package:analyzer/source/line_info.dart'; import 'package:package_config/package_config.dart'; import 'package:pubspec_parse/pubspec_parse.dart'; @@ -18,7 +18,7 @@ class ScipVisitor extends GeneralizingAstVisitor { final String _relativePath; final String _projectRoot; final LineInfo _lineInfo; - final List _analysisErrors; + final List _analysisErrors; final SymbolGenerator _symbolGenerator; @@ -52,10 +52,16 @@ class ScipVisitor extends GeneralizingAstVisitor { // to correctly parse all [Declaration] ast nodes. if (node is Declaration) { _visitDeclaration(node); - } else if (node is NormalFormalParameter) { - _visitNormalFormalParameter(node); + } else if (node is FormalParameter) { + _visitFormalParameter(node); } else if (node is SimpleIdentifier) { _visitSimpleIdentifier(node); + } else if (node is NamedType) { + _visitNamedType(node); + } else if (node is ImportPrefixReference) { + _visitImportPrefixReference(node); + } else if (node is NamedArgument) { + _visitNamedArgument(node); } super.visitNode(node); @@ -70,7 +76,7 @@ class ScipVisitor extends GeneralizingAstVisitor { _registerAsDefinition(element, node, relationships: relationships); } - void _visitNormalFormalParameter(NormalFormalParameter node) { + void _visitFormalParameter(FormalParameter node) { final element = _symbolGenerator.elementFor(node); if (element == null) return; @@ -78,8 +84,9 @@ class ScipVisitor extends GeneralizingAstVisitor { // it as a reference to said field, as well as a declaration of a parameter. if (node is FieldFormalParameter) { final fieldElement = (element as FieldFormalParameterElement).field; + if (fieldElement == null) return; _registerAsReference( - fieldElement!, + fieldElement, node, offset: node.name.offset, length: node.name.length, @@ -110,6 +117,42 @@ class ScipVisitor extends GeneralizingAstVisitor { } } + void _visitNamedType(NamedType node) { + final element = _symbolGenerator.elementFor(node); + if (element == null) return; + + _registerAsReference( + element, + node, + offset: node.name.offset, + length: node.name.length, + ); + } + + void _visitImportPrefixReference(ImportPrefixReference node) { + final element = _symbolGenerator.elementFor(node); + if (element == null) return; + + _registerAsReference( + element, + node, + offset: node.name.offset, + length: node.name.length, + ); + } + + void _visitNamedArgument(NamedArgument node) { + final element = _symbolGenerator.elementFor(node); + if (element == null) return; + + _registerAsReference( + element, + node, + offset: node.name.offset, + length: node.name.length, + ); + } + /// Registers the provided [element] as a reference to an existing definition /// /// [node] refers to the ast node where the reference exists, [element] diff --git a/lib/src/symbol_generator.dart b/lib/src/symbol_generator.dart index 8008c14..b58907f 100644 --- a/lib/src/symbol_generator.dart +++ b/lib/src/symbol_generator.dart @@ -27,8 +27,8 @@ class SymbolGenerator { /// that should be used to generate the symbol Element? elementFor(AstNode node) { if (node is Declaration) { - return node.declaredElement; - } else if (node is NormalFormalParameter) { + return node.declaredFragment?.element; + } else if (node is FormalParameter) { // if this parameter is a child of a GenericFunctionType (can be a // typedef, or a function as a parameter), we don't want to index it // as a definition (nothing is defined, just referenced). Return false @@ -37,12 +37,27 @@ class SymbolGenerator { ?.thisOrAncestorOfType(); if (parentParameter != null) return null; - var element = node.declaredElement; - if (element == null) return null; + return node.declaredFragment?.element; + } else if (node is NamedType) { + // `Foo()` constructor invocations reference the (unnamed) constructor, + // whereas `Foo.bar()` references the class via `Foo`, and the + // constructor via `bar` + final parent = node.parent; + if (parent is ConstructorName && parent.name == null) { + return parent.element; + } + final element = node.element; + if (element?.source == null) return null; + return element; + } else if (node is ImportPrefixReference) { + return node.element; + } else if (node is NamedArgument) { + final element = node.correspondingParameter; + if (element?.source == null) return null; return element; } else if (node is SimpleIdentifier) { - var element = node.staticElement; + var element = node.element; // A SimpleIdentifier with a direct parent of a ConstructorDeclaration // is the reference to the class itself. Skip this declaration @@ -50,39 +65,22 @@ class SymbolGenerator { return null; } - // if we're nested under a ConstructorName identifier, use the constructor - // as the element to annotate instead of the reference to the Class - final parentConstructor = node.thisOrAncestorOfType(); - if (parentConstructor != null) { - // ConstructorNames can also include an import PrefixIdentifier: `math.Rectangle()` - // both 'math' and 'Rectangle' are SimpleIdentifiers. We only want the constructor - // element for 'Rectangle' in this case - final parentPrefixIdentifier = node - .thisOrAncestorOfType(); - if (parentPrefixIdentifier?.prefix == node) return element; - - // Constructors can be named: `Foo.bar()`, both `Foo` and `bar` are SimpleIdentifiers - // When the constructor is named, 'bar' is the constructor reference and `Foo` should - // reference the class - if (parentConstructor.name == node) { - return parentConstructor.staticElement; - } else if (parentConstructor.name != null) { - return element; - } - - // Otherwise, constructor is just `Foo()`, so simply return the - // constructor's element - return parentConstructor.staticElement; + // Named constructors: `Foo.bar()`, `bar` is the SimpleIdentifier + // referencing the constructor + final parent = node.parent; + if (parent is ConstructorName && parent.name == node) { + return parent.element; } // Both `.loadLibrary()`, and `.call()` are synthetic functions that // have no definition. These should therefore should not be indexed. - if (element is FunctionElement && element.isSynthetic) { - if ([ - FunctionElement.LOAD_LIBRARY_NAME, - FunctionElement.CALL_METHOD_NAME, - ].contains(element.name)) - return null; + if (element is TopLevelFunctionElement && element.isOriginLoadLibrary) { + return null; + } + if (element is MethodElement && + !element.isOriginDeclaration && + element.name == MethodElement.CALL_METHOD_NAME) { + return null; } // [element] for assignment fields is null. If the parent node @@ -99,15 +97,15 @@ class SymbolGenerator { // When the identifier is a field, the analyzer creates synthetic getters/ // setters for it. We need to get the backing field. - if (element?.isSynthetic == true && element is PropertyAccessorElement) { + if (element is PropertyAccessorElement && element.isOriginVariable) { // The values field on enums is synthetic, and has no explicit definition like // other fields do. Skip indexing for this case. - if (element.enclosingElement is EnumElement && - element.name == 'values') { + final variable = element.variable; + if (variable is FieldElement && variable.isOriginEnumValues) { return null; } - element = element.variable; + element = variable; } // element is null if there's nothing really to do for this node. Example: `void` @@ -135,12 +133,11 @@ class SymbolGenerator { } // named parameters can be "goto'd" on the consuming symbol, and are not "local" - if (element is ParameterElement && !element.isNamed) { + if (element is FormalParameterElement && !element.isNamed) { return _localSymbolFor(element); } - // for some reason, LibraryImportElement is considered to be "private" - if (element.isPrivate && element is! LibraryImportElement) { + if (element.isPrivate) { return _localSymbolFor(element); } @@ -218,8 +215,7 @@ class SymbolGenerator { if (element.source == null) { display( 'WARN: Element has null source: ' - '${element.runtimeType} (${element}) ' - '${element.location?.components}', + '${element.runtimeType} (${element}) ', ); return null; } @@ -241,25 +237,26 @@ class SymbolGenerator { final namespace = _escapeNamespacePath(filePath); - if (element is TypeDefiningElement || // class, mixin, enum, type-alias + if (element is InterfaceElement || // class, mixin, enum, extension type + element is TypeAliasElement || element is ExtensionElement) { return '$namespace/${element.name}#'; } if (element is ConstructorElement) { final className = element.enclosingElement.name; - final constructorName = element.name.isNotEmpty + final constructorName = element.name != null && element.name != 'new' ? element.name : '``'; return '$namespace/$className#$constructorName().'; } if (element is MethodElement) { - final className = element.enclosingElement.name; + final className = element.enclosingElement?.name; return '$namespace/$className#${element.name}().'; } - if (element is FunctionElement) { + if (element is TopLevelFunctionElement || element is LocalFunctionElement) { return '$namespace/${element.name}().'; } @@ -274,28 +271,29 @@ class SymbolGenerator { } // only generate symbols for named parameters, all others are 'local x' - if (element is ParameterElement && element.isNamed) { + if (element is FormalParameterElement && element.isNamed) { final encEle = element.enclosingElement; if (encEle == null) { display('Parameter element has null enclosingElement "$element"'); return null; } - // If element is a GenericFunctionTypeElement, the function is a - // `void Function({String param})` type. For this case, [param] + // If the enclosing element is a GenericFunctionTypeElement, the function + // is a `void Function({String param})` type. For this case, [param] // is not indexable, so do not generate a symbol for it - if (element is GenericFunctionTypeElement) return null; + if (encEle is GenericFunctionTypeElement) return null; return '${_getDescriptor(encEle)}(${element.name})'; } if (element is PropertyAccessorElement) { - final parentName = element.enclosingElement.name; + final parent = element.enclosingElement; + final parentName = parent is LibraryElement ? null : parent.name; var prefix = ''; - if (element.isGetter) { + if (element is GetterElement) { prefix = ''; - } else if (element.isSetter) { + } else if (element is SetterElement) { prefix = ''; } @@ -315,7 +313,7 @@ class SymbolGenerator { '\n' 'Received unknown type (${element.runtimeType})\n' '\tname: ${element.name}\n' - '\tpath: (${element.library!.source.fullName})' + '\tpath: (${element.source?.fullName})' '\n', ); return null; @@ -341,8 +339,9 @@ class SymbolGenerator { } String _pathForSdkElement(Element element) { - if (element.enclosingElement?.source?.uri != null) { - return element.enclosingElement!.source!.uri.toString(); + final uri = element.source?.uri; + if (uri != null) { + return uri.toString(); } else { throw Exception( 'Unable to find path to dart sdk element: ${element.source!.fullName}', diff --git a/lib/src/utils.dart b/lib/src/utils.dart index 5965c8e..8649466 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -1,6 +1,8 @@ import 'dart:io'; +import 'package:analyzer/dart/element/element.dart'; import 'package:analyzer/source/line_info.dart'; +import 'package:analyzer/source/source.dart'; import 'package:path/path.dart' as p; import 'package:collection/collection.dart'; @@ -51,6 +53,33 @@ extension LineInfoExtension on LineInfo { } } +extension ElementExtension on Element { + /// The source file this element was declared in + Source? get source => firstFragment.libraryFragment?.source; + + /// The offset of this element's name within its declaring file. + /// + /// For unnamed constructors, this is the offset of the type name + int get nameOffset { + final fragment = firstFragment; + if (fragment.nameOffset != null) return fragment.nameOffset!; + if (fragment is ConstructorFragment && fragment.typeNameOffset != null) { + return fragment.typeNameOffset!; + } + return fragment.offset; + } + + /// The length of this element's name within its declaring file. + /// + /// For unnamed constructors, this is the length of the type name + int get nameLength { + final fragment = firstFragment; + if (fragment.nameOffset != null) return fragment.name?.length ?? 0; + if (fragment is ConstructorFragment) return fragment.typeName?.length ?? 0; + return 0; + } +} + String? getYamlSection( String str, Pattern startRegex, { diff --git a/lib/src/version.dart b/lib/src/version.dart index 2c27902..352a62b 100644 --- a/lib/src/version.dart +++ b/lib/src/version.dart @@ -2,4 +2,4 @@ // stored within pubspec.yaml /// The current version of scip_dart -const scipDartVersion = '1.6.2'; +const scipDartVersion = '1.7.0'; diff --git a/pubspec.lock b/pubspec.lock index d4c819a..740881d 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,18 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: ae92f5d747aee634b87f89d9946000c2de774be1d6ac3e58268224348cd0101a + sha256: fdcd9f70f9eb80df3bc5ed0fa67280df2595fd481948df8a9ab082e6a40ad04b url: "https://pub.dev" source: hosted - version: "61.0.0" + version: "108.0.0" analyzer: dependency: "direct main" description: name: analyzer - sha256: ea3d8652bda62982addfd92fdc2d0214e5f82e43325104990d4f4c4a2a313562 + sha256: a51c769bff3b6dfbe9d60199b8606d808290702a296bef0c26a4ca391d414e46 url: "https://pub.dev" source: hosted - version: "5.13.0" + version: "14.4.0" args: dependency: "direct main" description: diff --git a/pubspec.yaml b/pubspec.yaml index 12da957..3287511 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -10,7 +10,7 @@ executables: scip_dart: dependencies: - analyzer: ^5.13.0 + analyzer: ^14.0.0 args: ^2.4.0 package_config: ^2.1.0 path: ^1.8.3 @@ -23,4 +23,4 @@ dev_dependencies: chalk: ^1.2.1 dart_dev: ^4.2.3 glob: ^2.1.1 - workiva_analysis_options: ^1.4.3 \ No newline at end of file + workiva_analysis_options: ^1.4.3 diff --git a/snapshots/input/basic-project/lib/more.dart b/snapshots/input/basic-project/lib/more.dart index 370fed8..22fb022 100644 --- a/snapshots/input/basic-project/lib/more.dart +++ b/snapshots/input/basic-project/lib/more.dart @@ -70,8 +70,15 @@ void main() { print(math.Rectangle(1, 2, 3, 4)); + math.Random? random = math.Random(); + final points = >[]; + Object value = points; + print(value is math.Random); + print([random, points]); + [1, 2].reduce((a, b) => a + b); } void test(String Function(int) p) {} void deepTest(String Function(void Function(String test)) p) {} +math.Point origin(math.Random random) => math.Point(0, 0); diff --git a/snapshots/output/basic-project/lib/more.dart b/snapshots/output/basic-project/lib/more.dart index 7b6ea1b..c071270 100755 --- a/snapshots/output/basic-project/lib/more.dart +++ b/snapshots/output/basic-project/lib/more.dart @@ -178,22 +178,57 @@ // ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. // ^^^^^^^^^ reference scip-dart pub dart:math 3.13.0 dart:math/`rectangle.dart`/Rectangle#``(). + math.Random? random = math.Random(); +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. +// ^^^^^^ reference scip-dart pub dart:math 3.13.0 dart:math/`random.dart`/Random# +// ^^^^^^ definition local 8 +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. +// ^^^^^^ reference scip-dart pub dart:math 3.13.0 dart:math/`random.dart`/Random#``(). + final points = >[]; +// ^^^^^^ definition local 9 +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. +// ^^^^^ reference scip-dart pub dart:math 3.13.0 dart:math/`point.dart`/Point# +// ^^^ reference scip-dart pub dart:core 3.13.0 dart:core/`int.dart`/int# + Object value = points; +// ^^^^^^ reference scip-dart pub dart:core 3.13.0 dart:core/`object.dart`/Object# +// ^^^^^ definition local 10 +// ^^^^^^ reference local 9 + print(value is math.Random); +// ^^^^^ reference scip-dart pub dart:core 3.13.0 dart:core/`print.dart`/print(). +// ^^^^^ reference local 10 +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. +// ^^^^^^ reference scip-dart pub dart:math 3.13.0 dart:math/`random.dart`/Random# + print([random, points]); +// ^^^^^ reference scip-dart pub dart:core 3.13.0 dart:core/`print.dart`/print(). +// ^^^^^^ reference local 8 +// ^^^^^^ reference local 9 + [1, 2].reduce((a, b) => a + b); // ^^^^^^ reference scip-dart pub dart:core 3.13.0 dart:core/`iterable.dart`/Iterable#reduce(). -// ^ definition local 8 -// ^ definition local 9 -// ^ reference local 8 -// ^ reference local 9 +// ^ definition local 11 +// ^ definition local 12 +// ^ reference local 11 +// ^ reference local 12 } void test(String Function(int) p) {} // ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/test(). // ^^^^^^ reference scip-dart pub dart:core 3.13.0 dart:core/`string.dart`/String# // ^^^ reference scip-dart pub dart:core 3.13.0 dart:core/`int.dart`/int# -// ^ definition local 10 +// ^ definition local 13 void deepTest(String Function(void Function(String test)) p) {} // ^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/deepTest(). // ^^^^^^ reference scip-dart pub dart:core 3.13.0 dart:core/`string.dart`/String# // ^^^^^^ reference scip-dart pub dart:core 3.13.0 dart:core/`string.dart`/String# -// ^ definition local 11 +// ^ definition local 14 + math.Point origin(math.Random random) => math.Point(0, 0); +//^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. +// ^^^^^ reference scip-dart pub dart:math 3.13.0 dart:math/`point.dart`/Point# +// ^^^ reference scip-dart pub dart:core 3.13.0 dart:core/`int.dart`/int# +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/origin(). +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. +// ^^^^^^ reference scip-dart pub dart:math 3.13.0 dart:math/`random.dart`/Random# +// ^^^^^^ definition local 15 +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. +// ^^^^^ reference scip-dart pub dart:math 3.13.0 dart:math/`point.dart`/Point#``(). diff --git a/snapshots/output/diagnostics/lib/main.dart b/snapshots/output/diagnostics/lib/main.dart index eab53e6..45bfd1f 100755 --- a/snapshots/output/diagnostics/lib/main.dart +++ b/snapshots/output/diagnostics/lib/main.dart @@ -3,17 +3,17 @@ class _UnusedClass {} // ^^^^^^^^^^^^ definition local 0 -// diagnostic Information: +// diagnostic Warning: // > The declaration '_UnusedClass' isn't referenced. void _unusedMethod() {} // ^^^^^^^^^^^^^ definition local 1 -// diagnostic Information: +// diagnostic Warning: // > The declaration '_unusedMethod' isn't referenced. final _unusedTopLevelVariable = 'asdf'; // ^^^^^^^^^^^^^^^^^^^^^^^ definition local 2 -// diagnostic Information: +// diagnostic Warning: // > The declaration '_unusedTopLevelVariable' isn't referenced. @Deprecated('This method is deprecated') @@ -49,17 +49,11 @@ deprecatedMethod(); // ^^^^^^^^^^^^^^^^ reference scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedMethod(). -// diagnostic Information: -// > 'deprecatedMethod' is deprecated and shouldn't be used. This method is deprecated. deprecatedParam(foobar: 2); // ^^^^^^^^^^^^^^^ reference scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedParam(). // ^^^^^^ reference scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedParam().(foobar) -// diagnostic Information: -// > 'foobar' is deprecated and shouldn't be used. this param is deprecated. someDeprecatedFunc(); // ^^^^^^^^^^^^^^^^^^ reference scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/someDeprecatedFunc(). -// diagnostic Information: -// > 'someDeprecatedFunc' is deprecated and shouldn't be used. } @deprecated