From 60ecc5d6b9f432bdbed846703a95a1751fed3a22 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Wed, 9 Aug 2023 15:39:51 -0600 Subject: [PATCH 1/8] put relationship indexing behind a flag --- bin/scip_dart.dart | 9 ++++++++- lib/src/flags.dart | 4 ++++ lib/src/scip_visitor.dart | 9 ++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/bin/scip_dart.dart b/bin/scip_dart.dart index ff375553..c310fe24 100644 --- a/bin/scip_dart.dart +++ b/bin/scip_dart.dart @@ -10,6 +10,13 @@ import 'package:scip_dart/src/version.dart'; Future main(List args) async { final result = (ArgParser() + ..addFlag( + 'index-relationships', + defaultsTo: false, + help: 'Whether or not to index symbol relationships. ' + 'This functionality is currently in alpha, and should not be ' + 'considered stable and accurate.', + ) ..addFlag( 'performance', aliases: ['perf'], @@ -23,7 +30,7 @@ Future main(List args) async { help: 'Whether or not to display debugging text during indexing', ) ..addFlag('version', - defaultsTo: false, help: 'Display the current version of scip-dart') + defaultsTo: false, help: 'Display the current version of scip-dart',) ..addMultiOption( 'path', abbr: 'p', diff --git a/lib/src/flags.dart b/lib/src/flags.dart index cc1a7d66..3d660175 100644 --- a/lib/src/flags.dart +++ b/lib/src/flags.dart @@ -7,9 +7,13 @@ class Flags { bool get performance => _performance; bool _performance = false; + bool get indexRelationships => _indexRelationships; + bool _indexRelationships = false; + void init(ArgResults results) { _verbose = results['verbose'] as bool? ?? false; _performance = results['performance'] as bool? ?? false; + _indexRelationships = results['index-relationships'] as bool? ?? false; } static Flags get instance => _instance; diff --git a/lib/src/scip_visitor.dart b/lib/src/scip_visitor.dart index 9a5a8cc5..d3002ee2 100644 --- a/lib/src/scip_visitor.dart +++ b/lib/src/scip_visitor.dart @@ -4,6 +4,7 @@ import 'package:analyzer/dart/element/element.dart'; import 'package:analyzer/source/line_info.dart'; import 'package:package_config/package_config.dart'; import 'package:pubspec_parse/pubspec_parse.dart'; +import 'package:scip_dart/src/flags.dart'; import 'package:scip_dart/src/metadata.dart'; import 'package:scip_dart/src/gen/scip.pb.dart'; import 'package:scip_dart/src/relationship_generator.dart'; @@ -62,9 +63,15 @@ class ScipVisitor extends GeneralizingAstVisitor { if (node.declaredElement == null) return; final element = node.declaredElement!; + + List? relationships; + if (Flags.instance.indexRelationships) { + relationships = relationshipsFor(node, element, _symbolGenerator); + } + _registerAsDefinition( element, - relationships: relationshipsFor(node, element, _symbolGenerator), + relationships: relationships, ); } From b19daa6eca6afadfaf9f287febe1ed2a64b6b6b5 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Wed, 9 Aug 2023 15:42:04 -0600 Subject: [PATCH 2/8] fmt --- bin/scip_dart.dart | 11 +- pubspec.lock | 4 +- snapshots/output/basic-project/lib/main.dart | 54 +++---- snapshots/output/basic-project/lib/more.dart | 152 +++++++++--------- snapshots/output/basic-project/lib/other.dart | 34 ++-- .../basic-project/lib/relationships.dart | 46 +++--- .../output/basic-project/test/basic_test.dart | 10 +- 7 files changed, 153 insertions(+), 158 deletions(-) diff --git a/bin/scip_dart.dart b/bin/scip_dart.dart index c310fe24..189546a7 100644 --- a/bin/scip_dart.dart +++ b/bin/scip_dart.dart @@ -14,8 +14,8 @@ Future main(List args) async { 'index-relationships', defaultsTo: false, help: 'Whether or not to index symbol relationships. ' - 'This functionality is currently in alpha, and should not be ' - 'considered stable and accurate.', + 'This functionality is currently in alpha, and should not be ' + 'considered stable and accurate.', ) ..addFlag( 'performance', @@ -29,8 +29,11 @@ Future main(List args) async { defaultsTo: false, help: 'Whether or not to display debugging text during indexing', ) - ..addFlag('version', - defaultsTo: false, help: 'Display the current version of scip-dart',) + ..addFlag( + 'version', + defaultsTo: false, + help: 'Display the current version of scip-dart', + ) ..addMultiOption( 'path', abbr: 'p', diff --git a/pubspec.lock b/pubspec.lock index ca9fe15d..ecdf8539 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -21,7 +21,7 @@ packages: name: args url: "https://pub.dartlang.org" source: hosted - version: "2.4.2" + version: "2.4.1" async: dependency: transitive description: @@ -175,7 +175,7 @@ packages: name: glob url: "https://pub.dartlang.org" source: hosted - version: "2.1.2" + version: "2.1.1" graphs: dependency: transitive description: diff --git a/snapshots/output/basic-project/lib/main.dart b/snapshots/output/basic-project/lib/main.dart index b20c0acd..33967e39 100755 --- a/snapshots/output/basic-project/lib/main.dart +++ b/snapshots/output/basic-project/lib/main.dart @@ -1,57 +1,57 @@ import 'package:dart_test/other.dart'; -// definition scip-dart pub dart_test 1.0.0 lib/main.dart/ +// definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/ /// This is a fib function /// /// Takes a number /// Returns a number int fib(int n) { -//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). +//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/fib(). // documentation ```dart // documentation This is a fib function -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# // ^ definition local 0 // documentation ```dart if (n <= 1) return 0; // ^ reference local 0 return fib(n - 1) + fib(n - 2); -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/fib(). // ^ reference local 0 -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/fib(). // ^ reference local 0 } void print_fib(int a) { -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/print_fib(). +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/print_fib(). // documentation ```dart -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# // ^ definition local 1 // documentation ```dart print(fib(a)); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/fib(). // ^ reference local 1 } final y = 'Hello'; -// ^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/y. +// ^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/y. // documentation ```dart String capture() { -//^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/capture(). +//^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# +// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/capture(). // documentation ```dart return y; -// ^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/y. +// ^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/y. } final capture_lambda = () => y; -// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/capture_lambda. +// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/capture_lambda. // documentation ```dart -// ^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/y. +// ^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/y. void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/main(). +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/main(). // documentation ```dart for (var i = 0; i <= 10; i++) {} // ^ definition local 2 @@ -63,7 +63,7 @@ // ^ definition local 3 // documentation ```dart print(i); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). // ^ reference local 3 } @@ -73,35 +73,35 @@ a = 1; // ^ reference local 4 print_fib(a); -// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/print_fib(). +// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/print_fib(). // ^ reference local 4 } void forever() { -// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/forever(). +// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/forever(). // documentation ```dart return forever(); -// ^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/forever(). +// ^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/forever(). } class SomeLocalClass {} -// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/SomeLocalClass# +// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/SomeLocalClass# // documentation ```dart /// Reference parameter: [value] // ^^^^^ reference local 5 /// Reference class: [SomeLocalClass] -// ^^^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/SomeLocalClass# +// ^^^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/SomeLocalClass# /// Reference external class: [Foo] -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo# /// Missing Reference: [IDontExist] void someFunction(int value) { -// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/someFunction(). +// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/someFunction(). // documentation ```dart // documentation Reference parameter: [value] -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# // ^^^^^ definition local 5 // documentation ```dart Foo(1); -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo# } diff --git a/snapshots/output/basic-project/lib/more.dart b/snapshots/output/basic-project/lib/more.dart index 28b9dbe9..7cbac40c 100755 --- a/snapshots/output/basic-project/lib/more.dart +++ b/snapshots/output/basic-project/lib/more.dart @@ -1,126 +1,124 @@ import 'dart:math' as math; -// definition scip-dart pub dart_test 1.0.0 lib/more.dart/ -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/math. +// definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/ +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. // documentation ```dart enum AnimalType { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# // documentation ```dart cat, -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#cat. // documentation ```dart dog, -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#dog. // documentation ```dart bird, -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#bird. +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#bird. // documentation ```dart } typedef SoundMaker = void Function(); -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SoundMaker# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/SoundMaker# // documentation ```dart mixin SleepMixin { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin# // documentation ```dart void sleep() { -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). +// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). // documentation ```dart print('zzz...'); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). } } class Animal with SleepMixin { -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# // documentation ```dart -// relationship scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin# implementation -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin# +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin# String name; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#name. // documentation ```dart AnimalType type; -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#type. // documentation ```dart SoundMaker? soundMaker; -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SoundMaker# -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SoundMaker# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. // documentation ```dart Animal(this.name, {required this.type}) { -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#(). +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#``(). // documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#name. // ^^^^ definition local 0 // documentation ```dart -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#type. +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#``().(type) // documentation ```dart switch (type) { -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#type. case AnimalType.cat: -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#cat. soundMaker = () => print('Meow!'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). break; case AnimalType.dog: -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#dog. soundMaker = () => print('Woof!'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). break; case AnimalType.bird: -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#bird. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#bird. soundMaker = () => print('Chirp!'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). break; default: soundMaker = () => print('Unknown animal type'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). } } void makeSound() { -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). // documentation ```dart soundMaker?.call(); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. } @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. +// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`annotations.dart`/override. String toString() { -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#toString(). +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# +// ^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#toString(). // documentation ```dart -// relationship scip-dart pub dart:core 2.18.0 dart:core/object.dart/Object#toString(). implementation reference return '$name the $type'; -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#name. +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#type. } } int calculateSum(List numbers) { -//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# -// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/calculateSum(). +//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# +// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/calculateSum(). // documentation ```dart -// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/list.dart/List# -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`list.dart`/List# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# // ^^^^^^^ definition local 1 // documentation ```dart return numbers.reduce((value, element) => value + element); // ^^^^^^^ reference local 1 -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/iterable.dart/Iterable#reduce(). +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`iterable.dart`/Iterable#reduce(). // ^^^^^ definition local 2 // documentation ```dart // ^^^^^^^ definition local 3 @@ -130,65 +128,65 @@ } void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/main(). +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/main(). // documentation ```dart List numbers = [1, 2, 3, 4, 5]; -// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/list.dart/List# -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`list.dart`/List# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# // ^^^^^^^ definition local 4 // documentation ```dart int sum = calculateSum(numbers); -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# // ^^^ definition local 5 // documentation ```dart -// ^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/calculateSum(). +// ^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/calculateSum(). // ^^^^^^^ reference local 4 Animal cat = Animal('Kitty', type: AnimalType.cat); -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# // ^^^ definition local 6 // documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#``().(type) +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#cat. Animal dog = Animal('Buddy', type: AnimalType.dog); -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# // ^^^ definition local 7 // documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#``().(type) +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#dog. cat.makeSound(); // ^^^ reference local 6 -// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). +// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). cat.sleep(); // ^^^ reference local 6 -// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). +// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). dog.makeSound(); // ^^^ reference local 7 -// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). +// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). dog.sleep(); // ^^^ reference local 7 -// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). +// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). print(cat); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). // ^^^ reference local 6 print(dog); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). // ^^^ reference local 7 print('The sum of $numbers is $sum'); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). // ^^^^^^^ reference local 4 // ^^^ reference local 5 print(math.Rectangle(1,2,3,4)); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/math. -// ^^^^^^^^^ reference scip-dart pub dart:math 2.18.0 dart:math/rectangle.dart/Rectangle# +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. +// ^^^^^^^^^ reference scip-dart pub dart:math 2.18.0 dart:math/`rectangle.dart`/Rectangle# } diff --git a/snapshots/output/basic-project/lib/other.dart b/snapshots/output/basic-project/lib/other.dart index d8eadfed..15fcfd92 100755 --- a/snapshots/output/basic-project/lib/other.dart +++ b/snapshots/output/basic-project/lib/other.dart @@ -1,60 +1,60 @@ import 'more.dart' deferred as more; -// definition scip-dart pub dart_test 1.0.0 lib/other.dart/ -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/more. +// definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/ +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/more. // documentation ```dart class Foo { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo# // documentation ```dart int _far; -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# // ^^^^ definition local 0 // documentation ```dart Foo(this._far); -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#(). +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#``(). // documentation ```dart -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo# // ^^^^ reference local 0 // ^^^^ definition local 1 // documentation ```dart } class Bar { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar# // documentation ```dart String _someValue; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# // ^^^^^^^^^^ definition local 2 // documentation ```dart Bar(this._someValue); -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#(). +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar#``(). // documentation ```dart -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar# // ^^^^ reference local 2 // ^^^^^^^^^^ definition local 3 // documentation ```dart void someMethod() { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#someMethod(). +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar#someMethod(). // documentation ```dart _someValue = 'asdf'; // ^^^^^^^^^^ reference local 2 print(_someValue); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). // ^^^^^^^^^^ reference local 2 } } void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/main(). +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/main(). // documentation ```dart more.loadLibrary().then((_) => { -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/more. -// ^^^^ reference scip-dart pub dart:async 2.18.0 dart:async/future.dart/Future#then(). +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/more. +// ^^^^ reference scip-dart pub dart:async 2.18.0 dart:async/`future.dart`/Future#then(). // ^ definition local 4 // documentation ```dart Bar('a').someMethod.call() -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#someMethod(). +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar# +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar#someMethod(). }); } diff --git a/snapshots/output/basic-project/lib/relationships.dart b/snapshots/output/basic-project/lib/relationships.dart index 29b0f412..29bf7e95 100755 --- a/snapshots/output/basic-project/lib/relationships.dart +++ b/snapshots/output/basic-project/lib/relationships.dart @@ -1,54 +1,48 @@ abstract class Mammal { -// definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/ -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal# +// definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/ +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Mammal# // documentation ```dart String get hierarchy; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal#hierarchy. +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Mammal#hierarchy. // documentation ```dart } abstract class Animal extends Mammal { -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Animal# +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Animal# // documentation ```dart -// relationship scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal# implementation -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal# +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Mammal# String sound() => 'NOISE!'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Animal#sound(). +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# +// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Animal#sound(). // documentation ```dart } mixin SwimAction { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/SwimAction# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/SwimAction# // documentation ```dart void execute() => print('swimming...'); -// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/SwimAction#execute(). +// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/SwimAction#execute(). // documentation ```dart -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). } class Dog extends Animal with SwimAction { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Dog# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Dog# // documentation ```dart -// relationship scip-dart pub dart_test 1.0.0 lib/relationships.dart/Animal# implementation -// relationship scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal# implementation -// relationship scip-dart pub dart_test 1.0.0 lib/relationships.dart/SwimAction# implementation -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/relationships.dart/Animal# -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/relationships.dart/SwimAction# +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Animal# +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/SwimAction# @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. +// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`annotations.dart`/override. String sound() => 'woof'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Dog#sound(). +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# +// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Dog#sound(). // documentation ```dart -// relationship scip-dart pub dart_test 1.0.0 lib/relationships.dart/Animal#sound(). implementation reference @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. +// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`annotations.dart`/override. String get hierarchy => 'dog.animal.mammal'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Dog#hierarchy. +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Dog#hierarchy. // documentation ```dart -// relationship scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal#hierarchy. implementation reference } diff --git a/snapshots/output/basic-project/test/basic_test.dart b/snapshots/output/basic-project/test/basic_test.dart index a7506aae..7d1cefed 100755 --- a/snapshots/output/basic-project/test/basic_test.dart +++ b/snapshots/output/basic-project/test/basic_test.dart @@ -1,15 +1,15 @@ import 'package:test/test.dart'; -// definition scip-dart pub dart_test 1.0.0 test/basic_test.dart/ +// definition scip-dart pub dart_test 1.0.0 test/`basic_test.dart`/ void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 test/basic_test.dart/main(). +// ^^^^ definition scip-dart pub dart_test 1.0.0 test/`basic_test.dart`/main(). // documentation ```dart group('some test', () { -// ^^^^^ reference scip-dart pub test_core 0.5.3 lib/scaffolding.dart/group(). +// ^^^^^ reference scip-dart pub test_core 0.5.3 lib/`scaffolding.dart`/group(). test('equality', () { -// ^^^^ reference scip-dart pub test_core 0.5.3 lib/scaffolding.dart/test(). +// ^^^^ reference scip-dart pub test_core 0.5.3 lib/`scaffolding.dart`/test(). expect(1, 1); -// ^^^^^^ reference scip-dart pub matcher 0.12.16 lib/src/expect/expect.dart/expect(). +// ^^^^^^ reference scip-dart pub matcher 0.12.16 lib/src/expect/`expect.dart`/expect(). }); }); } From ee592846d5d9846ccff2a37210c660e4c92dc9b0 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Thu, 10 Aug 2023 09:51:22 -0600 Subject: [PATCH 3/8] bumped scip version --- .github/workflows/tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index b8241116..22e11ea1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -14,7 +14,7 @@ jobs: - uses: actions/checkout@v3 - name: Install scip cli run: | - bash -c 'curl -L "https://github.com/sourcegraph/scip/releases/download/v0.2.3/scip-linux-amd64.tar.gz"' | tar xzf - scip + bash -c 'curl -L "https://github.com/sourcegraph/scip/releases/download/v0.3.0/scip-linux-amd64.tar.gz"' | tar xzf - scip ./scip --version - uses: dart-lang/setup-dart@v1 From 3a6954a848a903210b20350648847490cc6019cb Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Thu, 10 Aug 2023 09:56:04 -0600 Subject: [PATCH 4/8] added diff check --- .github/workflows/tests.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 22e11ea1..ba7b1f34 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -40,6 +40,7 @@ jobs: echo echo "Snapshot diff detected differences, run 'make run snap' to re-generate snapshots" git status --short ./snapshots/output + git diff echo exit 1 fi From bc05f70b7eb547692faaeb0629d6cdd8c66cbbb1 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Thu, 10 Aug 2023 10:07:17 -0600 Subject: [PATCH 5/8] regen snaps with released scip version --- .github/workflows/tests.yaml | 1 - snapshots/output/basic-project/lib/main.dart | 54 +++---- snapshots/output/basic-project/lib/more.dart | 150 +++++++++--------- snapshots/output/basic-project/lib/other.dart | 34 ++-- .../basic-project/lib/relationships.dart | 40 ++--- .../output/basic-project/test/basic_test.dart | 10 +- 6 files changed, 144 insertions(+), 145 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index ba7b1f34..22e11ea1 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -40,7 +40,6 @@ jobs: echo echo "Snapshot diff detected differences, run 'make run snap' to re-generate snapshots" git status --short ./snapshots/output - git diff echo exit 1 fi diff --git a/snapshots/output/basic-project/lib/main.dart b/snapshots/output/basic-project/lib/main.dart index 33967e39..b20c0acd 100755 --- a/snapshots/output/basic-project/lib/main.dart +++ b/snapshots/output/basic-project/lib/main.dart @@ -1,57 +1,57 @@ import 'package:dart_test/other.dart'; -// definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/ +// definition scip-dart pub dart_test 1.0.0 lib/main.dart/ /// This is a fib function /// /// Takes a number /// Returns a number int fib(int n) { -//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/fib(). +//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). // documentation ```dart // documentation This is a fib function -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# // ^ definition local 0 // documentation ```dart if (n <= 1) return 0; // ^ reference local 0 return fib(n - 1) + fib(n - 2); -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/fib(). +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). // ^ reference local 0 -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/fib(). +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). // ^ reference local 0 } void print_fib(int a) { -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/print_fib(). +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/print_fib(). // documentation ```dart -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# // ^ definition local 1 // documentation ```dart print(fib(a)); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/fib(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). // ^ reference local 1 } final y = 'Hello'; -// ^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/y. +// ^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/y. // documentation ```dart String capture() { -//^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# -// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/capture(). +//^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/capture(). // documentation ```dart return y; -// ^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/y. +// ^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/y. } final capture_lambda = () => y; -// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/capture_lambda. +// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/capture_lambda. // documentation ```dart -// ^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/y. +// ^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/y. void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/main(). +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/main(). // documentation ```dart for (var i = 0; i <= 10; i++) {} // ^ definition local 2 @@ -63,7 +63,7 @@ // ^ definition local 3 // documentation ```dart print(i); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). // ^ reference local 3 } @@ -73,35 +73,35 @@ a = 1; // ^ reference local 4 print_fib(a); -// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/print_fib(). +// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/print_fib(). // ^ reference local 4 } void forever() { -// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/forever(). +// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/forever(). // documentation ```dart return forever(); -// ^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/forever(). +// ^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/forever(). } class SomeLocalClass {} -// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/SomeLocalClass# +// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/SomeLocalClass# // documentation ```dart /// Reference parameter: [value] // ^^^^^ reference local 5 /// Reference class: [SomeLocalClass] -// ^^^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`main.dart`/SomeLocalClass# +// ^^^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/SomeLocalClass# /// Reference external class: [Foo] -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# /// Missing Reference: [IDontExist] void someFunction(int value) { -// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/someFunction(). +// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/someFunction(). // documentation ```dart // documentation Reference parameter: [value] -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# // ^^^^^ definition local 5 // documentation ```dart Foo(1); -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# } diff --git a/snapshots/output/basic-project/lib/more.dart b/snapshots/output/basic-project/lib/more.dart index 7cbac40c..94af943f 100755 --- a/snapshots/output/basic-project/lib/more.dart +++ b/snapshots/output/basic-project/lib/more.dart @@ -1,124 +1,124 @@ import 'dart:math' as math; -// definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/ -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. +// definition scip-dart pub dart_test 1.0.0 lib/more.dart/ +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/math. // documentation ```dart enum AnimalType { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# // documentation ```dart cat, -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#cat. +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. // documentation ```dart dog, -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#dog. +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. // documentation ```dart bird, -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#bird. +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#bird. // documentation ```dart } typedef SoundMaker = void Function(); -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/SoundMaker# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SoundMaker# // documentation ```dart mixin SleepMixin { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin# // documentation ```dart void sleep() { -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). +// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). // documentation ```dart print('zzz...'); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). } } class Animal with SleepMixin { -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# // documentation ```dart -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin# +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin# String name; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#name. +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. // documentation ```dart AnimalType type; -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#type. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. // documentation ```dart SoundMaker? soundMaker; -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SoundMaker# -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SoundMaker# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. // documentation ```dart Animal(this.name, {required this.type}) { -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#``(). +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#(). // documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#name. +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. // ^^^^ definition local 0 // documentation ```dart -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#type. -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#``().(type) +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) // documentation ```dart switch (type) { -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#type. +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. case AnimalType.cat: -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#cat. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. soundMaker = () => print('Meow!'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). break; case AnimalType.dog: -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#dog. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. soundMaker = () => print('Woof!'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). break; case AnimalType.bird: -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#bird. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#bird. soundMaker = () => print('Chirp!'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). break; default: soundMaker = () => print('Unknown animal type'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). } } void makeSound() { -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). // documentation ```dart soundMaker?.call(); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. } @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`annotations.dart`/override. +// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. String toString() { -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# -// ^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#toString(). +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#toString(). // documentation ```dart return '$name the $type'; -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#name. -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#type. +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. } } int calculateSum(List numbers) { -//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# -// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/calculateSum(). +//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/calculateSum(). // documentation ```dart -// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`list.dart`/List# -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# +// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/list.dart/List# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# // ^^^^^^^ definition local 1 // documentation ```dart return numbers.reduce((value, element) => value + element); // ^^^^^^^ reference local 1 -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`iterable.dart`/Iterable#reduce(). +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/iterable.dart/Iterable#reduce(). // ^^^^^ definition local 2 // documentation ```dart // ^^^^^^^ definition local 3 @@ -128,65 +128,65 @@ } void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/main(). +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/main(). // documentation ```dart List numbers = [1, 2, 3, 4, 5]; -// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`list.dart`/List# -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# +// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/list.dart/List# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# // ^^^^^^^ definition local 4 // documentation ```dart int sum = calculateSum(numbers); -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# // ^^^ definition local 5 // documentation ```dart -// ^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/calculateSum(). +// ^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/calculateSum(). // ^^^^^^^ reference local 4 Animal cat = Animal('Kitty', type: AnimalType.cat); -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# // ^^^ definition local 6 // documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#``().(type) -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#cat. +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. Animal dog = Animal('Buddy', type: AnimalType.dog); -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# // ^^^ definition local 7 // documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#``().(type) -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#dog. +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. cat.makeSound(); // ^^^ reference local 6 -// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). +// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). cat.sleep(); // ^^^ reference local 6 -// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). +// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). dog.makeSound(); // ^^^ reference local 7 -// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). +// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). dog.sleep(); // ^^^ reference local 7 -// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). +// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). print(cat); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). // ^^^ reference local 6 print(dog); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). // ^^^ reference local 7 print('The sum of $numbers is $sum'); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). // ^^^^^^^ reference local 4 // ^^^ reference local 5 print(math.Rectangle(1,2,3,4)); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/math. -// ^^^^^^^^^ reference scip-dart pub dart:math 2.18.0 dart:math/`rectangle.dart`/Rectangle# +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/math. +// ^^^^^^^^^ reference scip-dart pub dart:math 2.18.0 dart:math/rectangle.dart/Rectangle# } diff --git a/snapshots/output/basic-project/lib/other.dart b/snapshots/output/basic-project/lib/other.dart index 15fcfd92..d8eadfed 100755 --- a/snapshots/output/basic-project/lib/other.dart +++ b/snapshots/output/basic-project/lib/other.dart @@ -1,60 +1,60 @@ import 'more.dart' deferred as more; -// definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/ -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/more. +// definition scip-dart pub dart_test 1.0.0 lib/other.dart/ +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/more. // documentation ```dart class Foo { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# // documentation ```dart int _far; -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`int.dart`/int# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# // ^^^^ definition local 0 // documentation ```dart Foo(this._far); -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#``(). +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#(). // documentation ```dart -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# // ^^^^ reference local 0 // ^^^^ definition local 1 // documentation ```dart } class Bar { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# // documentation ```dart String _someValue; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# // ^^^^^^^^^^ definition local 2 // documentation ```dart Bar(this._someValue); -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar#``(). +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#(). // documentation ```dart -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# // ^^^^ reference local 2 // ^^^^^^^^^^ definition local 3 // documentation ```dart void someMethod() { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar#someMethod(). +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#someMethod(). // documentation ```dart _someValue = 'asdf'; // ^^^^^^^^^^ reference local 2 print(_someValue); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). // ^^^^^^^^^^ reference local 2 } } void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/main(). +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/main(). // documentation ```dart more.loadLibrary().then((_) => { -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/more. -// ^^^^ reference scip-dart pub dart:async 2.18.0 dart:async/`future.dart`/Future#then(). +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/more. +// ^^^^ reference scip-dart pub dart:async 2.18.0 dart:async/future.dart/Future#then(). // ^ definition local 4 // documentation ```dart Bar('a').someMethod.call() -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar# -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar#someMethod(). +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#someMethod(). }); } diff --git a/snapshots/output/basic-project/lib/relationships.dart b/snapshots/output/basic-project/lib/relationships.dart index 29bf7e95..1c6ade22 100755 --- a/snapshots/output/basic-project/lib/relationships.dart +++ b/snapshots/output/basic-project/lib/relationships.dart @@ -1,48 +1,48 @@ abstract class Mammal { -// definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/ -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Mammal# +// definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/ +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal# // documentation ```dart String get hierarchy; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Mammal#hierarchy. +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal#hierarchy. // documentation ```dart } abstract class Animal extends Mammal { -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Animal# +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Animal# // documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Mammal# +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal# String sound() => 'NOISE!'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Animal#sound(). +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Animal#sound(). // documentation ```dart } mixin SwimAction { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/SwimAction# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/SwimAction# // documentation ```dart void execute() => print('swimming...'); -// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/SwimAction#execute(). +// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/SwimAction#execute(). // documentation ```dart -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`print.dart`/print(). +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). } class Dog extends Animal with SwimAction { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Dog# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Dog# // documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Animal# -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/SwimAction# +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/relationships.dart/Animal# +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/relationships.dart/SwimAction# @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`annotations.dart`/override. +// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. String sound() => 'woof'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Dog#sound(). +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Dog#sound(). // documentation ```dart @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`annotations.dart`/override. +// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. String get hierarchy => 'dog.animal.mammal'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/`string.dart`/String# -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Dog#hierarchy. +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Dog#hierarchy. // documentation ```dart } diff --git a/snapshots/output/basic-project/test/basic_test.dart b/snapshots/output/basic-project/test/basic_test.dart index 7d1cefed..a7506aae 100755 --- a/snapshots/output/basic-project/test/basic_test.dart +++ b/snapshots/output/basic-project/test/basic_test.dart @@ -1,15 +1,15 @@ import 'package:test/test.dart'; -// definition scip-dart pub dart_test 1.0.0 test/`basic_test.dart`/ +// definition scip-dart pub dart_test 1.0.0 test/basic_test.dart/ void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 test/`basic_test.dart`/main(). +// ^^^^ definition scip-dart pub dart_test 1.0.0 test/basic_test.dart/main(). // documentation ```dart group('some test', () { -// ^^^^^ reference scip-dart pub test_core 0.5.3 lib/`scaffolding.dart`/group(). +// ^^^^^ reference scip-dart pub test_core 0.5.3 lib/scaffolding.dart/group(). test('equality', () { -// ^^^^ reference scip-dart pub test_core 0.5.3 lib/`scaffolding.dart`/test(). +// ^^^^ reference scip-dart pub test_core 0.5.3 lib/scaffolding.dart/test(). expect(1, 1); -// ^^^^^^ reference scip-dart pub matcher 0.12.16 lib/src/expect/`expect.dart`/expect(). +// ^^^^^^ reference scip-dart pub matcher 0.12.16 lib/src/expect/expect.dart/expect(). }); }); } From 52c9c5fbc7285983bff63442906398928980fd3e Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Thu, 10 Aug 2023 10:11:35 -0600 Subject: [PATCH 6/8] added tests for relationships --- .github/workflows/tests.yaml | 9 +- Makefile | 5 +- .../lib/main.dart} | 0 .../input/relationships-project/pubspec.lock | 320 ++++++++++++++++++ .../input/relationships-project/pubspec.yaml | 8 + snapshots/output/basic-project/lib/main.dart | 139 +++----- snapshots/output/basic-project/lib/more.dart | 192 ----------- snapshots/output/basic-project/lib/other.dart | 60 ---- .../basic-project/lib/relationships.dart | 48 --- .../output/basic-project/test/basic_test.dart | 15 - .../relationships-project/lib/main.dart | 54 +++ 11 files changed, 437 insertions(+), 413 deletions(-) rename snapshots/input/{basic-project/lib/relationships.dart => relationships-project/lib/main.dart} (100%) create mode 100644 snapshots/input/relationships-project/pubspec.lock create mode 100644 snapshots/input/relationships-project/pubspec.yaml delete mode 100755 snapshots/output/basic-project/lib/more.dart delete mode 100755 snapshots/output/basic-project/lib/other.dart delete mode 100755 snapshots/output/basic-project/lib/relationships.dart delete mode 100755 snapshots/output/basic-project/test/basic_test.dart create mode 100755 snapshots/output/relationships-project/lib/main.dart diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 22e11ea1..bd19c67e 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -24,14 +24,21 @@ jobs: - name: pub get scip-dart package run: dart pub get - - name: pub get snapshots directory + - name: pub get basic-project directory run: dart pub get working-directory: ./snapshots/input/basic-project + - name: pub get relationships-project directory + run: dart pub get + working-directory: ./snapshots/input/relationships-project + - name: Snapshots Diff Check run: | dart run scip_dart ./snapshots/input/basic-project + dart run scip_dart --index-relationships ./snapshots/input/relationships-project + ./scip snapshot --to ./snapshots/output/basic-project + ./scip snapshot --to ./snapshots/output/relationships-project if [[ -z "$(git status --porcelain ./snapshots/output)" ]]; then diff --git a/Makefile b/Makefile index 3a08157d..a8eec4e2 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,9 @@ regen-snapshots: - dart run scip_dart ./snapshots/input/basic-project --verbose + dart run scip_dart ./snapshots/input/basic-project + dart run scip_dart --index-relationships ./snapshots/input/relationships-project + scip snapshot --to ./snapshots/output/basic-project + scip snapshot --to ./snapshots/output/relationships-project run: dart run scip_dart ./snapshots/input/staging-project --verbose diff --git a/snapshots/input/basic-project/lib/relationships.dart b/snapshots/input/relationships-project/lib/main.dart similarity index 100% rename from snapshots/input/basic-project/lib/relationships.dart rename to snapshots/input/relationships-project/lib/main.dart diff --git a/snapshots/input/relationships-project/pubspec.lock b/snapshots/input/relationships-project/pubspec.lock new file mode 100644 index 00000000..c8839aa8 --- /dev/null +++ b/snapshots/input/relationships-project/pubspec.lock @@ -0,0 +1,320 @@ +# Generated by pub +# See https://dart.dev/tools/pub/glossary#lockfile +packages: + _fe_analyzer_shared: + dependency: transitive + description: + name: _fe_analyzer_shared + url: "https://pub.dartlang.org" + source: hosted + version: "54.0.0" + analyzer: + dependency: transitive + description: + name: analyzer + url: "https://pub.dartlang.org" + source: hosted + version: "5.6.0" + args: + dependency: transitive + description: + name: args + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.1" + async: + dependency: transitive + description: + name: async + url: "https://pub.dartlang.org" + source: hosted + version: "2.11.0" + boolean_selector: + dependency: transitive + description: + name: boolean_selector + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + collection: + dependency: transitive + description: + name: collection + url: "https://pub.dartlang.org" + source: hosted + version: "1.18.0" + convert: + dependency: transitive + description: + name: convert + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" + coverage: + dependency: transitive + description: + name: coverage + url: "https://pub.dartlang.org" + source: hosted + version: "1.6.3" + crypto: + dependency: transitive + description: + name: crypto + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + file: + dependency: transitive + description: + name: file + url: "https://pub.dartlang.org" + source: hosted + version: "6.1.4" + frontend_server_client: + dependency: transitive + description: + name: frontend_server_client + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.0" + glob: + dependency: transitive + description: + name: glob + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + http_multi_server: + dependency: transitive + description: + name: http_multi_server + url: "https://pub.dartlang.org" + source: hosted + version: "3.2.1" + http_parser: + dependency: transitive + description: + name: http_parser + url: "https://pub.dartlang.org" + source: hosted + version: "4.0.2" + io: + dependency: transitive + description: + name: io + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + js: + dependency: transitive + description: + name: js + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.5" + logging: + dependency: transitive + description: + name: logging + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.1" + matcher: + dependency: transitive + description: + name: matcher + url: "https://pub.dartlang.org" + source: hosted + version: "0.12.16" + meta: + dependency: transitive + description: + name: meta + url: "https://pub.dartlang.org" + source: hosted + version: "1.9.1" + mime: + dependency: transitive + description: + name: mime + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + node_preamble: + dependency: transitive + description: + name: node_preamble + url: "https://pub.dartlang.org" + source: hosted + version: "2.0.2" + package_config: + dependency: transitive + description: + name: package_config + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.0" + path: + dependency: transitive + description: + name: path + url: "https://pub.dartlang.org" + source: hosted + version: "1.8.3" + pool: + dependency: transitive + description: + name: pool + url: "https://pub.dartlang.org" + source: hosted + version: "1.5.1" + pub_semver: + dependency: transitive + description: + name: pub_semver + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.4" + shelf: + dependency: transitive + description: + name: shelf + url: "https://pub.dartlang.org" + source: hosted + version: "1.4.1" + shelf_packages_handler: + dependency: transitive + description: + name: shelf_packages_handler + url: "https://pub.dartlang.org" + source: hosted + version: "3.0.2" + shelf_static: + dependency: transitive + description: + name: shelf_static + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.2" + shelf_web_socket: + dependency: transitive + description: + name: shelf_web_socket + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.4" + source_map_stack_trace: + dependency: transitive + description: + name: source_map_stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + source_maps: + dependency: transitive + description: + name: source_maps + url: "https://pub.dartlang.org" + source: hosted + version: "0.10.12" + source_span: + dependency: transitive + description: + name: source_span + url: "https://pub.dartlang.org" + source: hosted + version: "1.10.0" + stack_trace: + dependency: transitive + description: + name: stack_trace + url: "https://pub.dartlang.org" + source: hosted + version: "1.11.1" + stream_channel: + dependency: transitive + description: + name: stream_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.1" + string_scanner: + dependency: transitive + description: + name: string_scanner + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + term_glyph: + dependency: transitive + description: + name: term_glyph + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.1" + test: + dependency: "direct main" + description: + name: test + url: "https://pub.dartlang.org" + source: hosted + version: "1.24.3" + test_api: + dependency: transitive + description: + name: test_api + url: "https://pub.dartlang.org" + source: hosted + version: "0.6.0" + test_core: + dependency: transitive + description: + name: test_core + url: "https://pub.dartlang.org" + source: hosted + version: "0.5.3" + typed_data: + dependency: transitive + description: + name: typed_data + url: "https://pub.dartlang.org" + source: hosted + version: "1.3.2" + vm_service: + dependency: transitive + description: + name: vm_service + url: "https://pub.dartlang.org" + source: hosted + version: "11.2.0" + watcher: + dependency: transitive + description: + name: watcher + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.2" + web_socket_channel: + dependency: transitive + description: + name: web_socket_channel + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" + webkit_inspection_protocol: + dependency: transitive + description: + name: webkit_inspection_protocol + url: "https://pub.dartlang.org" + source: hosted + version: "1.2.0" + yaml: + dependency: transitive + description: + name: yaml + url: "https://pub.dartlang.org" + source: hosted + version: "3.1.1" +sdks: + dart: ">=2.18.0 <3.0.0" diff --git a/snapshots/input/relationships-project/pubspec.yaml b/snapshots/input/relationships-project/pubspec.yaml new file mode 100644 index 00000000..5b2fdcb4 --- /dev/null +++ b/snapshots/input/relationships-project/pubspec.yaml @@ -0,0 +1,8 @@ +name: dart_test +version: 1.0.0 + +environment: + sdk: ">=2.18.0 <3.0.0" + +dependencies: + test: ^1.24.3 \ No newline at end of file diff --git a/snapshots/output/basic-project/lib/main.dart b/snapshots/output/basic-project/lib/main.dart index b20c0acd..7190d788 100755 --- a/snapshots/output/basic-project/lib/main.dart +++ b/snapshots/output/basic-project/lib/main.dart @@ -1,107 +1,54 @@ - import 'package:dart_test/other.dart'; + abstract class Mammal { // definition scip-dart pub dart_test 1.0.0 lib/main.dart/ - - /// This is a fib function - /// - /// Takes a number - /// Returns a number - int fib(int n) { -//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). -// documentation ```dart -// documentation This is a fib function -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# -// ^ definition local 0 -// documentation ```dart - if (n <= 1) return 0; -// ^ reference local 0 - return fib(n - 1) + fib(n - 2); -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). -// ^ reference local 0 -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). -// ^ reference local 0 +// ^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# +// documentation ```dart + String get hierarchy; +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal#hierarchy. +// documentation ```dart } - void print_fib(int a) { -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/print_fib(). -// documentation ```dart -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# -// ^ definition local 1 -// documentation ```dart - print(fib(a)); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). -// ^ reference local 1 + abstract class Animal extends Mammal { +// ^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# +// documentation ```dart +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# implementation +// ^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# + String sound() => 'NOISE!'; +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal#sound(). +// documentation ```dart } - final y = 'Hello'; -// ^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/y. + mixin SwimAction { +// ^^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# // documentation ```dart - String capture() { -//^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/capture(). + void execute() => print('swimming...'); +// ^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction#execute(). // documentation ```dart - return y; -// ^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/y. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). } - final capture_lambda = () => y; -// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/capture_lambda. -// documentation ```dart -// ^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/y. - - void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/main(). -// documentation ```dart - for (var i = 0; i <= 10; i++) {} -// ^ definition local 2 -// documentation ```dart -// ^ reference local 2 -// ^ reference local 2 - - for (var i in [1, 2, 3]) { -// ^ definition local 3 -// documentation ```dart - print(i); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). -// ^ reference local 3 - } - - var a = 0; -// ^ definition local 4 + class Dog extends Animal with SwimAction { +// ^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog# // documentation ```dart - a = 1; -// ^ reference local 4 - print_fib(a); -// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/print_fib(). -// ^ reference local 4 - } - - void forever() { -// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/forever(). -// documentation ```dart - return forever(); -// ^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/forever(). - } - - class SomeLocalClass {} -// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/SomeLocalClass# -// documentation ```dart - - /// Reference parameter: [value] -// ^^^^^ reference local 5 - /// Reference class: [SomeLocalClass] -// ^^^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/SomeLocalClass# - /// Reference external class: [Foo] -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# - /// Missing Reference: [IDontExist] - void someFunction(int value) { -// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/someFunction(). -// documentation ```dart -// documentation Reference parameter: [value] -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# -// ^^^^^ definition local 5 -// documentation ```dart - Foo(1); -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# implementation +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# implementation +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# implementation +// ^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# +// ^^^^^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# + @override +// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. + String sound() => 'woof'; +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog#sound(). +// documentation ```dart +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal#sound(). implementation reference + + @override +// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. + String get hierarchy => 'dog.animal.mammal'; +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog#hierarchy. +// documentation ```dart +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal#hierarchy. implementation reference } diff --git a/snapshots/output/basic-project/lib/more.dart b/snapshots/output/basic-project/lib/more.dart deleted file mode 100755 index 94af943f..00000000 --- a/snapshots/output/basic-project/lib/more.dart +++ /dev/null @@ -1,192 +0,0 @@ - import 'dart:math' as math; -// definition scip-dart pub dart_test 1.0.0 lib/more.dart/ -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/math. -// documentation ```dart - - enum AnimalType { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// documentation ```dart - cat, -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. -// documentation ```dart - dog, -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. -// documentation ```dart - bird, -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#bird. -// documentation ```dart - } - - typedef SoundMaker = void Function(); -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SoundMaker# -// documentation ```dart - - mixin SleepMixin { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin# -// documentation ```dart - void sleep() { -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). -// documentation ```dart - print('zzz...'); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). - } - } - - class Animal with SleepMixin { -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# -// documentation ```dart -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin# - String name; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. -// documentation ```dart - AnimalType type; -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. -// documentation ```dart - SoundMaker? soundMaker; -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SoundMaker# -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. -// documentation ```dart - - Animal(this.name, {required this.type}) { -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#(). -// documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. -// ^^^^ definition local 0 -// documentation ```dart -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) -// documentation ```dart - switch (type) { -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. - case AnimalType.cat: -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. - soundMaker = () => print('Meow!'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). - break; - case AnimalType.dog: -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. - soundMaker = () => print('Woof!'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). - break; - case AnimalType.bird: -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#bird. - soundMaker = () => print('Chirp!'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). - break; - default: - soundMaker = () => print('Unknown animal type'); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). - } - } - - void makeSound() { -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). -// documentation ```dart - soundMaker?.call(); -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. - } - - @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. - String toString() { -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#toString(). -// documentation ```dart - return '$name the $type'; -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. - } - } - - int calculateSum(List numbers) { -//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# -// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/calculateSum(). -// documentation ```dart -// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/list.dart/List# -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# -// ^^^^^^^ definition local 1 -// documentation ```dart - return numbers.reduce((value, element) => value + element); -// ^^^^^^^ reference local 1 -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/iterable.dart/Iterable#reduce(). -// ^^^^^ definition local 2 -// documentation ```dart -// ^^^^^^^ definition local 3 -// documentation ```dart -// ^^^^^ reference local 2 -// ^^^^^^^ reference local 3 - } - - void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/main(). -// documentation ```dart - List numbers = [1, 2, 3, 4, 5]; -// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/list.dart/List# -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# -// ^^^^^^^ definition local 4 -// documentation ```dart - int sum = calculateSum(numbers); -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# -// ^^^ definition local 5 -// documentation ```dart -// ^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/calculateSum(). -// ^^^^^^^ reference local 4 - - Animal cat = Animal('Kitty', type: AnimalType.cat); -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# -// ^^^ definition local 6 -// documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. - Animal dog = Animal('Buddy', type: AnimalType.dog); -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# -// ^^^ definition local 7 -// documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. - - cat.makeSound(); -// ^^^ reference local 6 -// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). - cat.sleep(); -// ^^^ reference local 6 -// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). - - dog.makeSound(); -// ^^^ reference local 7 -// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). - dog.sleep(); -// ^^^ reference local 7 -// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). - - print(cat); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). -// ^^^ reference local 6 - print(dog); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). -// ^^^ reference local 7 - print('The sum of $numbers is $sum'); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). -// ^^^^^^^ reference local 4 -// ^^^ reference local 5 - - print(math.Rectangle(1,2,3,4)); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/math. -// ^^^^^^^^^ reference scip-dart pub dart:math 2.18.0 dart:math/rectangle.dart/Rectangle# - } - diff --git a/snapshots/output/basic-project/lib/other.dart b/snapshots/output/basic-project/lib/other.dart deleted file mode 100755 index d8eadfed..00000000 --- a/snapshots/output/basic-project/lib/other.dart +++ /dev/null @@ -1,60 +0,0 @@ - import 'more.dart' deferred as more; -// definition scip-dart pub dart_test 1.0.0 lib/other.dart/ -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/more. -// documentation ```dart - - class Foo { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# -// documentation ```dart - int _far; -// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# -// ^^^^ definition local 0 -// documentation ```dart - Foo(this._far); -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#(). -// documentation ```dart -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# -// ^^^^ reference local 0 -// ^^^^ definition local 1 -// documentation ```dart - } - - class Bar { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# -// documentation ```dart - String _someValue; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^^^^ definition local 2 -// documentation ```dart - Bar(this._someValue); -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#(). -// documentation ```dart -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# -// ^^^^ reference local 2 -// ^^^^^^^^^^ definition local 3 -// documentation ```dart - - void someMethod() { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#someMethod(). -// documentation ```dart - _someValue = 'asdf'; -// ^^^^^^^^^^ reference local 2 - print(_someValue); -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). -// ^^^^^^^^^^ reference local 2 - } - } - - void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/main(). -// documentation ```dart - more.loadLibrary().then((_) => { -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/more. -// ^^^^ reference scip-dart pub dart:async 2.18.0 dart:async/future.dart/Future#then(). -// ^ definition local 4 -// documentation ```dart - Bar('a').someMethod.call() -// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#someMethod(). - }); - } diff --git a/snapshots/output/basic-project/lib/relationships.dart b/snapshots/output/basic-project/lib/relationships.dart deleted file mode 100755 index 1c6ade22..00000000 --- a/snapshots/output/basic-project/lib/relationships.dart +++ /dev/null @@ -1,48 +0,0 @@ - abstract class Mammal { -// definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/ -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal# -// documentation ```dart - String get hierarchy; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal#hierarchy. -// documentation ```dart - } - - abstract class Animal extends Mammal { -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Animal# -// documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/relationships.dart/Mammal# - String sound() => 'NOISE!'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Animal#sound(). -// documentation ```dart - } - - mixin SwimAction { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/SwimAction# -// documentation ```dart - void execute() => print('swimming...'); -// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/SwimAction#execute(). -// documentation ```dart -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). - } - - class Dog extends Animal with SwimAction { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Dog# -// documentation ```dart -// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/relationships.dart/Animal# -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/relationships.dart/SwimAction# - @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. - String sound() => 'woof'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Dog#sound(). -// documentation ```dart - - @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. - String get hierarchy => 'dog.animal.mammal'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/relationships.dart/Dog#hierarchy. -// documentation ```dart - } diff --git a/snapshots/output/basic-project/test/basic_test.dart b/snapshots/output/basic-project/test/basic_test.dart deleted file mode 100755 index a7506aae..00000000 --- a/snapshots/output/basic-project/test/basic_test.dart +++ /dev/null @@ -1,15 +0,0 @@ - import 'package:test/test.dart'; -// definition scip-dart pub dart_test 1.0.0 test/basic_test.dart/ - - void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 test/basic_test.dart/main(). -// documentation ```dart - group('some test', () { -// ^^^^^ reference scip-dart pub test_core 0.5.3 lib/scaffolding.dart/group(). - test('equality', () { -// ^^^^ reference scip-dart pub test_core 0.5.3 lib/scaffolding.dart/test(). - expect(1, 1); -// ^^^^^^ reference scip-dart pub matcher 0.12.16 lib/src/expect/expect.dart/expect(). - }); - }); - } diff --git a/snapshots/output/relationships-project/lib/main.dart b/snapshots/output/relationships-project/lib/main.dart new file mode 100755 index 00000000..7190d788 --- /dev/null +++ b/snapshots/output/relationships-project/lib/main.dart @@ -0,0 +1,54 @@ + abstract class Mammal { +// definition scip-dart pub dart_test 1.0.0 lib/main.dart/ +// ^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# +// documentation ```dart + String get hierarchy; +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal#hierarchy. +// documentation ```dart + } + + abstract class Animal extends Mammal { +// ^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# +// documentation ```dart +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# implementation +// ^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# + String sound() => 'NOISE!'; +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal#sound(). +// documentation ```dart + } + + mixin SwimAction { +// ^^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# +// documentation ```dart + void execute() => print('swimming...'); +// ^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction#execute(). +// documentation ```dart +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). + } + + class Dog extends Animal with SwimAction { +// ^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog# +// documentation ```dart +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# implementation +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# implementation +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# implementation +// ^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# +// ^^^^^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# + @override +// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. + String sound() => 'woof'; +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog#sound(). +// documentation ```dart +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal#sound(). implementation reference + + @override +// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. + String get hierarchy => 'dog.animal.mammal'; +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog#hierarchy. +// documentation ```dart +// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal#hierarchy. implementation reference + } From b5287760c3fdef51a6a6e46402a4199da488fe54 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Thu, 10 Aug 2023 10:12:17 -0600 Subject: [PATCH 7/8] smaller pubspec --- .../input/relationships-project/pubspec.lock | 317 +----------------- .../input/relationships-project/pubspec.yaml | 5 +- 2 files changed, 2 insertions(+), 320 deletions(-) diff --git a/snapshots/input/relationships-project/pubspec.lock b/snapshots/input/relationships-project/pubspec.lock index c8839aa8..89b205e1 100644 --- a/snapshots/input/relationships-project/pubspec.lock +++ b/snapshots/input/relationships-project/pubspec.lock @@ -1,320 +1,5 @@ # Generated by pub # See https://dart.dev/tools/pub/glossary#lockfile -packages: - _fe_analyzer_shared: - dependency: transitive - description: - name: _fe_analyzer_shared - url: "https://pub.dartlang.org" - source: hosted - version: "54.0.0" - analyzer: - dependency: transitive - description: - name: analyzer - url: "https://pub.dartlang.org" - source: hosted - version: "5.6.0" - args: - dependency: transitive - description: - name: args - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.1" - async: - dependency: transitive - description: - name: async - url: "https://pub.dartlang.org" - source: hosted - version: "2.11.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - collection: - dependency: transitive - description: - name: collection - url: "https://pub.dartlang.org" - source: hosted - version: "1.18.0" - convert: - dependency: transitive - description: - name: convert - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.1" - coverage: - dependency: transitive - description: - name: coverage - url: "https://pub.dartlang.org" - source: hosted - version: "1.6.3" - crypto: - dependency: transitive - description: - name: crypto - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" - file: - dependency: transitive - description: - name: file - url: "https://pub.dartlang.org" - source: hosted - version: "6.1.4" - frontend_server_client: - dependency: transitive - description: - name: frontend_server_client - url: "https://pub.dartlang.org" - source: hosted - version: "3.2.0" - glob: - dependency: transitive - description: - name: glob - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - http_multi_server: - dependency: transitive - description: - name: http_multi_server - url: "https://pub.dartlang.org" - source: hosted - version: "3.2.1" - http_parser: - dependency: transitive - description: - name: http_parser - url: "https://pub.dartlang.org" - source: hosted - version: "4.0.2" - io: - dependency: transitive - description: - name: io - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - js: - dependency: transitive - description: - name: js - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.5" - logging: - dependency: transitive - description: - name: logging - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.1" - matcher: - dependency: transitive - description: - name: matcher - url: "https://pub.dartlang.org" - source: hosted - version: "0.12.16" - meta: - dependency: transitive - description: - name: meta - url: "https://pub.dartlang.org" - source: hosted - version: "1.9.1" - mime: - dependency: transitive - description: - name: mime - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - node_preamble: - dependency: transitive - description: - name: node_preamble - url: "https://pub.dartlang.org" - source: hosted - version: "2.0.2" - package_config: - dependency: transitive - description: - name: package_config - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.0" - path: - dependency: transitive - description: - name: path - url: "https://pub.dartlang.org" - source: hosted - version: "1.8.3" - pool: - dependency: transitive - description: - name: pool - url: "https://pub.dartlang.org" - source: hosted - version: "1.5.1" - pub_semver: - dependency: transitive - description: - name: pub_semver - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.4" - shelf: - dependency: transitive - description: - name: shelf - url: "https://pub.dartlang.org" - source: hosted - version: "1.4.1" - shelf_packages_handler: - dependency: transitive - description: - name: shelf_packages_handler - url: "https://pub.dartlang.org" - source: hosted - version: "3.0.2" - shelf_static: - dependency: transitive - description: - name: shelf_static - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.2" - shelf_web_socket: - dependency: transitive - description: - name: shelf_web_socket - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.4" - source_map_stack_trace: - dependency: transitive - description: - name: source_map_stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - source_maps: - dependency: transitive - description: - name: source_maps - url: "https://pub.dartlang.org" - source: hosted - version: "0.10.12" - source_span: - dependency: transitive - description: - name: source_span - url: "https://pub.dartlang.org" - source: hosted - version: "1.10.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - url: "https://pub.dartlang.org" - source: hosted - version: "1.11.1" - stream_channel: - dependency: transitive - description: - name: stream_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.1.1" - string_scanner: - dependency: transitive - description: - name: string_scanner - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - term_glyph: - dependency: transitive - description: - name: term_glyph - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.1" - test: - dependency: "direct main" - description: - name: test - url: "https://pub.dartlang.org" - source: hosted - version: "1.24.3" - test_api: - dependency: transitive - description: - name: test_api - url: "https://pub.dartlang.org" - source: hosted - version: "0.6.0" - test_core: - dependency: transitive - description: - name: test_core - url: "https://pub.dartlang.org" - source: hosted - version: "0.5.3" - typed_data: - dependency: transitive - description: - name: typed_data - url: "https://pub.dartlang.org" - source: hosted - version: "1.3.2" - vm_service: - dependency: transitive - description: - name: vm_service - url: "https://pub.dartlang.org" - source: hosted - version: "11.2.0" - watcher: - dependency: transitive - description: - name: watcher - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.2" - web_socket_channel: - dependency: transitive - description: - name: web_socket_channel - url: "https://pub.dartlang.org" - source: hosted - version: "2.4.0" - webkit_inspection_protocol: - dependency: transitive - description: - name: webkit_inspection_protocol - url: "https://pub.dartlang.org" - source: hosted - version: "1.2.0" - yaml: - dependency: transitive - description: - name: yaml - url: "https://pub.dartlang.org" - source: hosted - version: "3.1.1" +packages: {} sdks: dart: ">=2.18.0 <3.0.0" diff --git a/snapshots/input/relationships-project/pubspec.yaml b/snapshots/input/relationships-project/pubspec.yaml index 5b2fdcb4..e565a0b3 100644 --- a/snapshots/input/relationships-project/pubspec.yaml +++ b/snapshots/input/relationships-project/pubspec.yaml @@ -2,7 +2,4 @@ name: dart_test version: 1.0.0 environment: - sdk: ">=2.18.0 <3.0.0" - -dependencies: - test: ^1.24.3 \ No newline at end of file + sdk: ">=2.18.0 <3.0.0" \ No newline at end of file From 11c62c6a82f8d70a4c4dbbb5652706d8798a1eb5 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Thu, 10 Aug 2023 10:14:15 -0600 Subject: [PATCH 8/8] fixed incorrect indexing --- .github/workflows/tests.yaml | 4 +- Makefile | 4 +- snapshots/output/basic-project/lib/main.dart | 139 +++++++++---- snapshots/output/basic-project/lib/more.dart | 192 ++++++++++++++++++ snapshots/output/basic-project/lib/other.dart | 60 ++++++ .../output/basic-project/test/basic_test.dart | 15 ++ .../relationships-project/lib/main.dart | 36 ++-- 7 files changed, 385 insertions(+), 65 deletions(-) create mode 100755 snapshots/output/basic-project/lib/more.dart create mode 100755 snapshots/output/basic-project/lib/other.dart create mode 100755 snapshots/output/basic-project/test/basic_test.dart diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index bd19c67e..4c680288 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -35,9 +35,9 @@ jobs: - name: Snapshots Diff Check run: | dart run scip_dart ./snapshots/input/basic-project - dart run scip_dart --index-relationships ./snapshots/input/relationships-project - ./scip snapshot --to ./snapshots/output/basic-project + + dart run scip_dart --index-relationships ./snapshots/input/relationships-project ./scip snapshot --to ./snapshots/output/relationships-project if [[ -z "$(git status --porcelain ./snapshots/output)" ]]; diff --git a/Makefile b/Makefile index a8eec4e2..a57f6ae7 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ regen-snapshots: dart run scip_dart ./snapshots/input/basic-project - dart run scip_dart --index-relationships ./snapshots/input/relationships-project - scip snapshot --to ./snapshots/output/basic-project + + dart run scip_dart --index-relationships ./snapshots/input/relationships-project scip snapshot --to ./snapshots/output/relationships-project run: diff --git a/snapshots/output/basic-project/lib/main.dart b/snapshots/output/basic-project/lib/main.dart index 7190d788..b20c0acd 100755 --- a/snapshots/output/basic-project/lib/main.dart +++ b/snapshots/output/basic-project/lib/main.dart @@ -1,54 +1,107 @@ - abstract class Mammal { + import 'package:dart_test/other.dart'; // definition scip-dart pub dart_test 1.0.0 lib/main.dart/ -// ^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# -// documentation ```dart - String get hierarchy; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal#hierarchy. -// documentation ```dart + + /// This is a fib function + /// + /// Takes a number + /// Returns a number + int fib(int n) { +//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). +// documentation ```dart +// documentation This is a fib function +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^ definition local 0 +// documentation ```dart + if (n <= 1) return 0; +// ^ reference local 0 + return fib(n - 1) + fib(n - 2); +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). +// ^ reference local 0 +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). +// ^ reference local 0 } - abstract class Animal extends Mammal { -// ^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# -// documentation ```dart -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# implementation -// ^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# - String sound() => 'NOISE!'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal#sound(). -// documentation ```dart + void print_fib(int a) { +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/print_fib(). +// documentation ```dart +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^ definition local 1 +// documentation ```dart + print(fib(a)); +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/fib(). +// ^ reference local 1 } - mixin SwimAction { -// ^^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# + final y = 'Hello'; +// ^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/y. // documentation ```dart - void execute() => print('swimming...'); -// ^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction#execute(). + String capture() { +//^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/capture(). // documentation ```dart -// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). + return y; +// ^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/y. } - class Dog extends Animal with SwimAction { -// ^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog# + final capture_lambda = () => y; +// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/capture_lambda. +// documentation ```dart +// ^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/y. + + void main() { +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/main(). +// documentation ```dart + for (var i = 0; i <= 10; i++) {} +// ^ definition local 2 +// documentation ```dart +// ^ reference local 2 +// ^ reference local 2 + + for (var i in [1, 2, 3]) { +// ^ definition local 3 +// documentation ```dart + print(i); +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^ reference local 3 + } + + var a = 0; +// ^ definition local 4 // documentation ```dart -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# implementation -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# implementation -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# implementation -// ^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# -// ^^^^^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# - @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. - String sound() => 'woof'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog#sound(). -// documentation ```dart -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal#sound(). implementation reference - - @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. - String get hierarchy => 'dog.animal.mammal'; -// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog#hierarchy. -// documentation ```dart -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal#hierarchy. implementation reference + a = 1; +// ^ reference local 4 + print_fib(a); +// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/print_fib(). +// ^ reference local 4 + } + + void forever() { +// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/forever(). +// documentation ```dart + return forever(); +// ^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/forever(). + } + + class SomeLocalClass {} +// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/SomeLocalClass# +// documentation ```dart + + /// Reference parameter: [value] +// ^^^^^ reference local 5 + /// Reference class: [SomeLocalClass] +// ^^^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/SomeLocalClass# + /// Reference external class: [Foo] +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# + /// Missing Reference: [IDontExist] + void someFunction(int value) { +// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/someFunction(). +// documentation ```dart +// documentation Reference parameter: [value] +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^^^ definition local 5 +// documentation ```dart + Foo(1); +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# } diff --git a/snapshots/output/basic-project/lib/more.dart b/snapshots/output/basic-project/lib/more.dart new file mode 100755 index 00000000..94af943f --- /dev/null +++ b/snapshots/output/basic-project/lib/more.dart @@ -0,0 +1,192 @@ + import 'dart:math' as math; +// definition scip-dart pub dart_test 1.0.0 lib/more.dart/ +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/math. +// documentation ```dart + + enum AnimalType { +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// documentation ```dart + cat, +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. +// documentation ```dart + dog, +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. +// documentation ```dart + bird, +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#bird. +// documentation ```dart + } + + typedef SoundMaker = void Function(); +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SoundMaker# +// documentation ```dart + + mixin SleepMixin { +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin# +// documentation ```dart + void sleep() { +// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). +// documentation ```dart + print('zzz...'); +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). + } + } + + class Animal with SleepMixin { +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// documentation ```dart +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin# + String name; +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. +// documentation ```dart + AnimalType type; +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. +// documentation ```dart + SoundMaker? soundMaker; +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SoundMaker# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. +// documentation ```dart + + Animal(this.name, {required this.type}) { +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#(). +// documentation ```dart +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. +// ^^^^ definition local 0 +// documentation ```dart +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) +// documentation ```dart + switch (type) { +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. + case AnimalType.cat: +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. + soundMaker = () => print('Meow!'); +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). + break; + case AnimalType.dog: +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. + soundMaker = () => print('Woof!'); +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). + break; + case AnimalType.bird: +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#bird. + soundMaker = () => print('Chirp!'); +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). + break; + default: + soundMaker = () => print('Unknown animal type'); +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). + } + } + + void makeSound() { +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). +// documentation ```dart + soundMaker?.call(); +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#soundMaker. + } + + @override +// ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. + String toString() { +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#toString(). +// documentation ```dart + return '$name the $type'; +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. + } + } + + int calculateSum(List numbers) { +//^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/calculateSum(). +// documentation ```dart +// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/list.dart/List# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^^^^^ definition local 1 +// documentation ```dart + return numbers.reduce((value, element) => value + element); +// ^^^^^^^ reference local 1 +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/iterable.dart/Iterable#reduce(). +// ^^^^^ definition local 2 +// documentation ```dart +// ^^^^^^^ definition local 3 +// documentation ```dart +// ^^^^^ reference local 2 +// ^^^^^^^ reference local 3 + } + + void main() { +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/main(). +// documentation ```dart + List numbers = [1, 2, 3, 4, 5]; +// ^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/list.dart/List# +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^^^^^ definition local 4 +// documentation ```dart + int sum = calculateSum(numbers); +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^ definition local 5 +// documentation ```dart +// ^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/calculateSum(). +// ^^^^^^^ reference local 4 + + Animal cat = Animal('Kitty', type: AnimalType.cat); +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// ^^^ definition local 6 +// documentation ```dart +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. + Animal dog = Animal('Buddy', type: AnimalType.dog); +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// ^^^ definition local 7 +// documentation ```dart +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#().(type) +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. + + cat.makeSound(); +// ^^^ reference local 6 +// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). + cat.sleep(); +// ^^^ reference local 6 +// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). + + dog.makeSound(); +// ^^^ reference local 7 +// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). + dog.sleep(); +// ^^^ reference local 7 +// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). + + print(cat); +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^ reference local 6 + print(dog); +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^ reference local 7 + print('The sum of $numbers is $sum'); +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^^^ reference local 4 +// ^^^ reference local 5 + + print(math.Rectangle(1,2,3,4)); +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/math. +// ^^^^^^^^^ reference scip-dart pub dart:math 2.18.0 dart:math/rectangle.dart/Rectangle# + } + diff --git a/snapshots/output/basic-project/lib/other.dart b/snapshots/output/basic-project/lib/other.dart new file mode 100755 index 00000000..d8eadfed --- /dev/null +++ b/snapshots/output/basic-project/lib/other.dart @@ -0,0 +1,60 @@ + import 'more.dart' deferred as more; +// definition scip-dart pub dart_test 1.0.0 lib/other.dart/ +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/more. +// documentation ```dart + + class Foo { +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# +// documentation ```dart + int _far; +// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int# +// ^^^^ definition local 0 +// documentation ```dart + Foo(this._far); +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#(). +// documentation ```dart +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# +// ^^^^ reference local 0 +// ^^^^ definition local 1 +// documentation ```dart + } + + class Bar { +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# +// documentation ```dart + String _someValue; +// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# +// ^^^^^^^^^^ definition local 2 +// documentation ```dart + Bar(this._someValue); +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#(). +// documentation ```dart +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# +// ^^^^ reference local 2 +// ^^^^^^^^^^ definition local 3 +// documentation ```dart + + void someMethod() { +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#someMethod(). +// documentation ```dart + _someValue = 'asdf'; +// ^^^^^^^^^^ reference local 2 + print(_someValue); +// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). +// ^^^^^^^^^^ reference local 2 + } + } + + void main() { +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/main(). +// documentation ```dart + more.loadLibrary().then((_) => { +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/more. +// ^^^^ reference scip-dart pub dart:async 2.18.0 dart:async/future.dart/Future#then(). +// ^ definition local 4 +// documentation ```dart + Bar('a').someMethod.call() +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#someMethod(). + }); + } diff --git a/snapshots/output/basic-project/test/basic_test.dart b/snapshots/output/basic-project/test/basic_test.dart new file mode 100755 index 00000000..a7506aae --- /dev/null +++ b/snapshots/output/basic-project/test/basic_test.dart @@ -0,0 +1,15 @@ + import 'package:test/test.dart'; +// definition scip-dart pub dart_test 1.0.0 test/basic_test.dart/ + + void main() { +// ^^^^ definition scip-dart pub dart_test 1.0.0 test/basic_test.dart/main(). +// documentation ```dart + group('some test', () { +// ^^^^^ reference scip-dart pub test_core 0.5.3 lib/scaffolding.dart/group(). + test('equality', () { +// ^^^^ reference scip-dart pub test_core 0.5.3 lib/scaffolding.dart/test(). + expect(1, 1); +// ^^^^^^ reference scip-dart pub matcher 0.12.16 lib/src/expect/expect.dart/expect(). + }); + }); + } diff --git a/snapshots/output/relationships-project/lib/main.dart b/snapshots/output/relationships-project/lib/main.dart index 7190d788..b99c84b9 100755 --- a/snapshots/output/relationships-project/lib/main.dart +++ b/snapshots/output/relationships-project/lib/main.dart @@ -1,54 +1,54 @@ abstract class Mammal { // definition scip-dart pub dart_test 1.0.0 lib/main.dart/ -// ^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/Mammal# // documentation ```dart String get hierarchy; // ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal#hierarchy. +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/Mammal#hierarchy. // documentation ```dart } abstract class Animal extends Mammal { -// ^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/Animal# // documentation ```dart -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# implementation -// ^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# +// relationship scip-dart pub dart_test 1.0.0 lib/main.dart/Mammal# implementation +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/Mammal# String sound() => 'NOISE!'; // ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal#sound(). +// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/Animal#sound(). // documentation ```dart } mixin SwimAction { -// ^^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/SwimAction# // documentation ```dart void execute() => print('swimming...'); -// ^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction#execute(). +// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/SwimAction#execute(). // documentation ```dart // ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print(). } class Dog extends Animal with SwimAction { -// ^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/Dog# // documentation ```dart -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# implementation -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal# implementation -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# implementation -// ^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal# -// ^^^^^^^^^^ reference scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/SwimAction# +// relationship scip-dart pub dart_test 1.0.0 lib/main.dart/Animal# implementation +// relationship scip-dart pub dart_test 1.0.0 lib/main.dart/Mammal# implementation +// relationship scip-dart pub dart_test 1.0.0 lib/main.dart/SwimAction# implementation +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/Animal# +// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/SwimAction# @override // ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. String sound() => 'woof'; // ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog#sound(). +// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/Dog#sound(). // documentation ```dart -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Animal#sound(). implementation reference +// relationship scip-dart pub dart_test 1.0.0 lib/main.dart/Animal#sound(). implementation reference @override // ^^^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/annotations.dart/override. String get hierarchy => 'dog.animal.mammal'; // ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String# -// ^^^^^^^^^ definition scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Dog#hierarchy. +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/Dog#hierarchy. // documentation ```dart -// relationship scip-dart pub scip_dart 1.1.3 snapshots/input/relationships-project/lib/main.dart/Mammal#hierarchy. implementation reference +// relationship scip-dart pub dart_test 1.0.0 lib/main.dart/Mammal#hierarchy. implementation reference }