From 5270364e5e268fcf5ba3b0f5811b251f3a4542ce Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Sun, 21 Jan 2024 14:35:37 -0700 Subject: [PATCH 1/6] fixed issue calculating formal parameters --- lib/src/scip_visitor.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/src/scip_visitor.dart b/lib/src/scip_visitor.dart index 49c35f29..a5b200cb 100644 --- a/lib/src/scip_visitor.dart +++ b/lib/src/scip_visitor.dart @@ -92,9 +92,10 @@ class ScipVisitor extends GeneralizingAstVisitor { _registerAsReference( fieldElement!, node, - offset: node.thisKeyword.offset, - length: node.thisKeyword.length, + offset: node.name.offset, + length: node.name.length, ); + return; } _registerAsDefinition(element, node); From 12cd6a5326cee1ce09bcf00d9047e08e111f8d65 Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Sun, 21 Jan 2024 14:36:21 -0700 Subject: [PATCH 2/6] regen snaps --- Makefile | 1 - snapshots/output/basic-project/lib/more.dart | 60 +++++++++---------- snapshots/output/basic-project/lib/other.dart | 20 +++---- .../basic-project/lib/relationships.dart | 54 +++++++++++++++++ 4 files changed, 91 insertions(+), 44 deletions(-) create mode 100755 snapshots/output/basic-project/lib/relationships.dart diff --git a/Makefile b/Makefile index 4e35121f..d8bd220b 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ gen-snaps: make gen-snap_basic-project - make gen-snap_relationships-project make gen-snap_diagnostics gen-snap_basic-project: diff --git a/snapshots/output/basic-project/lib/more.dart b/snapshots/output/basic-project/lib/more.dart index a7258783..33893abf 100755 --- a/snapshots/output/basic-project/lib/more.dart +++ b/snapshots/output/basic-project/lib/more.dart @@ -35,6 +35,7 @@ class Animal with SleepMixin { // ^^^^^^ 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# String name; // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/string.dart/String# @@ -53,12 +54,8 @@ // ^^^^^^ 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 +// ^^^^ 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. switch (type) { // ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#type. case AnimalType.cat: @@ -102,6 +99,7 @@ // ^^^^^^ reference scip-dart pub dart:core 2.19.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.19.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. @@ -114,17 +112,17 @@ // documentation ```dart // ^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/list.dart/List# // ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/int.dart/int# -// ^^^^^^^ definition local 1 +// ^^^^^^^ definition local 0 // documentation ```dart return numbers.reduce((value, element) => value + element); -// ^^^^^^^ reference local 1 +// ^^^^^^^ reference local 0 // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/iterable.dart/Iterable#reduce(). -// ^^^^^ definition local 2 +// ^^^^^ definition local 1 // documentation ```dart -// ^^^^^^^ definition local 3 +// ^^^^^^^ definition local 2 // documentation ```dart -// ^^^^^ reference local 2 -// ^^^^^^^ reference local 3 +// ^^^^^ reference local 1 +// ^^^^^^^ reference local 2 } void main() { @@ -133,18 +131,18 @@ List numbers = [1, 2, 3, 4, 5]; // ^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/list.dart/List# // ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/int.dart/int# -// ^^^^^^^ definition local 4 +// ^^^^^^^ definition local 3 // documentation ```dart int sum = calculateSum(numbers); // ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/int.dart/int# -// ^^^ definition local 5 +// ^^^ definition local 4 // documentation ```dart // ^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/calculateSum(). -// ^^^^^^^ reference local 4 +// ^^^^^^^ reference local 3 Animal cat = Animal('Kitty', type: AnimalType.cat); // ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal# -// ^^^ definition local 6 +// ^^^ definition local 5 // 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) @@ -152,7 +150,7 @@ // ^^^ 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 +// ^^^ 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) @@ -160,29 +158,29 @@ // ^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. cat.makeSound(); -// ^^^ reference local 6 +// ^^^ reference local 5 // ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). cat.sleep(); -// ^^^ reference local 6 +// ^^^ reference local 5 // ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). dog.makeSound(); -// ^^^ reference local 7 +// ^^^ reference local 6 // ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). dog.sleep(); -// ^^^ reference local 7 +// ^^^ reference local 6 // ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). print(cat); // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/print.dart/print(). -// ^^^ reference local 6 +// ^^^ reference local 5 print(dog); // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/print.dart/print(). -// ^^^ reference local 7 +// ^^^ reference local 6 print('The sum of $numbers is $sum'); // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/print.dart/print(). -// ^^^^^^^ reference local 4 -// ^^^ reference local 5 +// ^^^^^^^ reference local 3 +// ^^^ reference local 4 print(math.Rectangle(1,2,3,4)); // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/print.dart/print(). @@ -191,12 +189,12 @@ [1,2].reduce((a, b) => a + b); // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/iterable.dart/Iterable#reduce(). -// ^ definition local 8 +// ^ definition local 7 // documentation ```dart -// ^ definition local 9 +// ^ definition local 8 // documentation ```dart -// ^ reference local 8 -// ^ reference local 9 +// ^ reference local 7 +// ^ reference local 8 } void test(String Function(int) p) {} @@ -204,12 +202,12 @@ // documentation ```dart // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/string.dart/String# // ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/int.dart/int# -// ^ definition local 10 +// ^ definition local 9 // documentation ```dart void deepTest(String Function(void Function(String test)) p) {} // ^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/deepTest(). // documentation ```dart // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/string.dart/String# // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/string.dart/String# -// ^ definition local 11 +// ^ definition local 10 // documentation ```dart diff --git a/snapshots/output/basic-project/lib/other.dart b/snapshots/output/basic-project/lib/other.dart index 8ec58509..85bf30c7 100755 --- a/snapshots/output/basic-project/lib/other.dart +++ b/snapshots/output/basic-project/lib/other.dart @@ -26,9 +26,7 @@ // ^^^ 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 +// ^^^^ reference local 0 } class Bar { @@ -36,24 +34,22 @@ // documentation ```dart String _someValue; // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/string.dart/String# -// ^^^^^^^^^^ definition local 2 +// ^^^^^^^^^^ definition local 1 // 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 +// ^^^^^^^^^^ reference local 1 void someMethod() { // ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#someMethod(). // documentation ```dart _someValue = 'asdf'; -// ^^^^^^^^^^ reference local 2 +// ^^^^^^^^^^ reference local 1 print(_someValue); // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/print.dart/print(). -// ^^^^^^^^^^ reference local 2 +// ^^^^^^^^^^ reference local 1 } } @@ -63,7 +59,7 @@ more.loadLibrary().then((_) => { // ^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/more. // ^^^^ reference scip-dart pub dart:async 2.19.0 dart:async/future.dart/Future#then(). -// ^ definition local 4 +// ^ definition local 2 // documentation ```dart Bar('a').someMethod.call() // ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# @@ -75,7 +71,7 @@ // ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#value. final someStr = 'someStr'; -// ^^^^^^^ definition local 5 +// ^^^^^^^ definition local 3 // documentation ```dart Foo() // ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# @@ -83,7 +79,7 @@ // ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#value. ..value2 = someStr // ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#value2. -// ^^^^^^^ reference local 5 +// ^^^^^^^ reference local 3 ..value3 = 2.15 // ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#value3. } diff --git a/snapshots/output/basic-project/lib/relationships.dart b/snapshots/output/basic-project/lib/relationships.dart new file mode 100755 index 00000000..c720841a --- /dev/null +++ b/snapshots/output/basic-project/lib/relationships.dart @@ -0,0 +1,54 @@ + 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.19.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 +// 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# + String sound() => 'NOISE!'; +// ^^^^^^ reference scip-dart pub dart:core 2.19.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.19.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 +// 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# + @override +// ^^^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/annotations.dart/override. + String sound() => 'woof'; +// ^^^^^^ reference scip-dart pub dart:core 2.19.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.19.0 dart:core/annotations.dart/override. + String get hierarchy => 'dog.animal.mammal'; +// ^^^^^^ reference scip-dart pub dart:core 2.19.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 + } From a8160c0513f2798a5d46fdc7516fac12456e05ce Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Sun, 21 Jan 2024 14:42:48 -0700 Subject: [PATCH 3/6] fixed non-running unit tests --- .github/workflows/tests.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f52c1b7a..6763d0ef 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -66,8 +66,8 @@ jobs: run: dart pub get working-directory: ./snapshots/input/diagnostics - - name: Install jq - uses: dcarbone/install-jq-action@v2.0.2 + - name: Install JQ + run: sudo apt-get install jq - name: Snapshots Diff Check run: | From 8d1a2d34db592288a73938e3fb8dbd29a46387fa Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Sun, 21 Jan 2024 14:44:30 -0700 Subject: [PATCH 4/6] fixed tests again --- .github/workflows/tests.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 6763d0ef..2fd88b57 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -28,10 +28,6 @@ jobs: run: dart pub get working-directory: ./snapshots/input/basic-project - - name: dart 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 @@ -58,7 +54,7 @@ jobs: ./scip --version - uses: dart-lang/setup-dart@v1 with: - sdk: 2.18.7 + sdk: 2.19.6 - name: pub get scip-dart package run: dart pub get From 11b30b9df43c8af131f518108fe60aa1c4abd01e Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Sun, 21 Jan 2024 14:48:01 -0700 Subject: [PATCH 5/6] attempted fix of diagnostics test --- .github/workflows/tests.yaml | 12 +++-- .../relationships-project/lib/main.dart | 54 ------------------- 2 files changed, 7 insertions(+), 59 deletions(-) delete mode 100755 snapshots/output/relationships-project/lib/main.dart diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 2fd88b57..95ed94e6 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -48,10 +48,6 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Install scip cli - run: | - 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 with: sdk: 2.19.6 @@ -62,12 +58,18 @@ jobs: run: dart pub get working-directory: ./snapshots/input/diagnostics + - name: Install scip cli + run: | + bash -c 'curl -L "https://github.com/sourcegraph/scip/releases/download/v0.3.0/scip-linux-amd64.tar.gz"' | tar xzf - scip + ./scip --version + - name: Install JQ run: sudo apt-get install jq - name: Snapshots Diff Check run: | - make gen-snap_diagnostics + dart run scip_dart ./snapshots/input/diagnostics + ./scip print --json ./index.scip | jq '.documents[].occurrences[] | select(.diagnostics)' | jq -s . > ./snapshots/output/diagnostics/output.json if [[ -z "$(git status --porcelain ./snapshots/output)" ]]; then diff --git a/snapshots/output/relationships-project/lib/main.dart b/snapshots/output/relationships-project/lib/main.dart deleted file mode 100755 index d458121d..00000000 --- a/snapshots/output/relationships-project/lib/main.dart +++ /dev/null @@ -1,54 +0,0 @@ - abstract class Mammal { -// definition scip-dart pub dart_test 1.0.0 lib/main.dart/ -// ^^^^^^ 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.19.0 dart:core/string.dart/String# -// ^^^^^^^^^ 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 dart_test 1.0.0 lib/main.dart/Animal# -// documentation ```dart -// 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.19.0 dart:core/string.dart/String# -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/Animal#sound(). -// documentation ```dart - } - - mixin SwimAction { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/SwimAction# -// documentation ```dart - void execute() => print('swimming...'); -// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/SwimAction#execute(). -// documentation ```dart -// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/print.dart/print(). - } - - class Dog extends Animal with SwimAction { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/Dog# -// documentation ```dart -// 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.19.0 dart:core/annotations.dart/override. - String sound() => 'woof'; -// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/string.dart/String# -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/Dog#sound(). -// documentation ```dart -// relationship scip-dart pub dart_test 1.0.0 lib/main.dart/Animal#sound(). implementation reference - - @override -// ^^^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/annotations.dart/override. - String get hierarchy => 'dog.animal.mammal'; -// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/string.dart/String# -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/main.dart/Dog#hierarchy. -// documentation ```dart -// relationship scip-dart pub dart_test 1.0.0 lib/main.dart/Mammal#hierarchy. implementation reference - } From 388725770d57f2de8f9ef03063c92fb2dd9e3bdf Mon Sep 17 00:00:00 2001 From: Matthew Nitschke Date: Tue, 30 Jan 2024 19:18:39 -0700 Subject: [PATCH 6/6] regen snaps --- snapshots/output/basic-project/lib/more.dart | 88 +++++++++---------- snapshots/output/basic-project/lib/other.dart | 41 ++++----- .../basic-project/lib/relationships.dart | 8 +- 3 files changed, 65 insertions(+), 72 deletions(-) diff --git a/snapshots/output/basic-project/lib/more.dart b/snapshots/output/basic-project/lib/more.dart index 029de942..4b8c8894 100755 --- a/snapshots/output/basic-project/lib/more.dart +++ b/snapshots/output/basic-project/lib/more.dart @@ -1,7 +1,7 @@ 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. - + enum AnimalType { // ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# cat, @@ -11,10 +11,10 @@ bird, // ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#bird. } - + typedef SoundMaker = void Function(); // ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/SoundMaker# - + mixin SleepMixin { // ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin# void sleep() { @@ -23,7 +23,7 @@ // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). } } - + class Animal with SleepMixin { // ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# // relationship scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin# implementation @@ -37,14 +37,12 @@ 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. - + Animal(this.name, {required this.type}) { // ^^^^^^ definition 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# -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#name. -// ^^^^ definition local 0 -// ^^^^ 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#name. +// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#type. switch (type) { // ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#type. case AnimalType.cat: @@ -74,13 +72,13 @@ // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). } } - + void makeSound() { // ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). soundMaker?.call(); // ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#soundMaker. } - + @override // ^^^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`annotations.dart`/override. String toString() { @@ -92,94 +90,94 @@ // ^^^^ 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.19.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.19.0 dart:core/`list.dart`/List# // ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int# -// ^^^^^^^ definition local 1 +// ^^^^^^^ definition local 0 return numbers.reduce((value, element) => value + element); -// ^^^^^^^ reference local 1 +// ^^^^^^^ reference local 0 // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`iterable.dart`/Iterable#reduce(). -// ^^^^^ definition local 2 -// ^^^^^^^ definition local 3 -// ^^^^^ reference local 2 -// ^^^^^^^ reference local 3 +// ^^^^^ definition local 1 +// ^^^^^^^ definition local 2 +// ^^^^^ reference local 1 +// ^^^^^^^ reference local 2 } - + void main() { // ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/main(). List numbers = [1, 2, 3, 4, 5]; // ^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`list.dart`/List# // ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int# -// ^^^^^^^ definition local 4 +// ^^^^^^^ definition local 3 int sum = calculateSum(numbers); // ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int# -// ^^^ definition local 5 +// ^^^ definition local 4 // ^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/calculateSum(). -// ^^^^^^^ reference local 4 - +// ^^^^^^^ reference local 3 + Animal cat = Animal('Kitty', type: AnimalType.cat); // ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# -// ^^^ definition local 6 +// ^^^ definition local 5 // ^^^^^^ 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 +// ^^^ definition local 6 // ^^^^^^ 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 local 5 // ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). cat.sleep(); -// ^^^ reference local 6 +// ^^^ reference local 5 // ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). - + dog.makeSound(); -// ^^^ reference local 7 +// ^^^ reference local 6 // ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). dog.sleep(); -// ^^^ reference local 7 +// ^^^ reference local 6 // ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). - + print(cat); // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). -// ^^^ reference local 6 +// ^^^ reference local 5 print(dog); // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). -// ^^^ reference local 7 +// ^^^ reference local 6 print('The sum of $numbers is $sum'); // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). -// ^^^^^^^ reference local 4 -// ^^^ reference local 5 - +// ^^^^^^^ reference local 3 +// ^^^ reference local 4 + print(math.Rectangle(1,2,3,4)); // ^^^^^ reference scip-dart pub dart:core 2.19.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.19.0 dart:math/`rectangle.dart`/Rectangle# - + [1,2].reduce((a, b) => a + b); // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`iterable.dart`/Iterable#reduce(). -// ^ definition local 8 -// ^ definition local 9 -// ^ reference local 8 -// ^ reference local 9 +// ^ definition local 7 +// ^ definition local 8 +// ^ reference local 7 +// ^ reference local 8 } - + void test(String Function(int) p) {} // ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/test(). // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`string.dart`/String# // ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int# -// ^ definition local 10 +// ^ definition local 9 void deepTest(String Function(void Function(String test)) p) {} // ^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/deepTest(). // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`string.dart`/String# // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`string.dart`/String# -// ^ definition local 11 +// ^ definition local 10 diff --git a/snapshots/output/basic-project/lib/other.dart b/snapshots/output/basic-project/lib/other.dart index 9b2c26e6..8bd2eef0 100755 --- a/snapshots/output/basic-project/lib/other.dart +++ b/snapshots/output/basic-project/lib/other.dart @@ -1,7 +1,7 @@ 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. - + class Foo { // ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo# int _far; @@ -20,64 +20,59 @@ // ^^^ definition 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# this._far, { -// ^^^^ reference local 0 -// ^^^^ definition local 1 +// ^^^^ reference local 0 required this.value, -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value. -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#``().(value) +// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value. required this.value2, -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value2. -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#``().(value2) +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value2. this.value3, -// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value3. -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#``().(value3) +// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value3. }) { print(_far); // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). // ^^^^ reference local 0 } } - + class Bar { // ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar# String _someValue; // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`string.dart`/String# -// ^^^^^^^^^^ definition local 2 +// ^^^^^^^^^^ definition local 1 Bar(this._someValue); // ^^^ definition 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 - +// ^^^^^^^^^^ reference local 1 + void someMethod() { // ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar#someMethod(). _someValue = 'asdf'; // ^^^^^^^^^^ reference local 1 print(_someValue); // ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). -// ^^^^^^^^^^ reference local 2 +// ^^^^^^^^^^ reference local 1 } } - + void main() { // ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/main(). more.loadLibrary().then((_) => { // ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/more. // ^^^^ reference scip-dart pub dart:async 2.19.0 dart:async/`future.dart`/Future#then(). -// ^ definition local 4 +// ^ definition local 2 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(). }); - + Foo(1, value: true, value2: 'asdf')..value = false; // ^^^ 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#``().(value) // ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#``().(value2) // ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value. - + final someStr = 'someStr'; -// ^^^^^^^ definition local 5 +// ^^^^^^^ definition local 3 Foo(2, value: false, value2: 'some Val!') // ^^^ 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#``().(value) @@ -86,12 +81,12 @@ // ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value. ..value2 = someStr // ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value2. -// ^^^^^^^ reference local 5 +// ^^^^^^^ reference local 3 ..value3 = 2.15; // ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value3. - + more.test((_) => 'val'); // ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/more. // ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/test(). -// ^ definition local 6 +// ^ definition local 4 } diff --git a/snapshots/output/basic-project/lib/relationships.dart b/snapshots/output/basic-project/lib/relationships.dart index 49b0b5a2..25ee4e05 100755 --- a/snapshots/output/basic-project/lib/relationships.dart +++ b/snapshots/output/basic-project/lib/relationships.dart @@ -5,7 +5,7 @@ // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`string.dart`/String# // ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Mammal#hierarchy. } - + abstract class Animal extends Mammal { // ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Animal# // relationship scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Mammal# implementation @@ -14,14 +14,14 @@ // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`string.dart`/String# // ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Animal#sound(). } - + mixin SwimAction { // ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/SwimAction# void execute() => print('swimming...'); // ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/SwimAction#execute(). // ^^^^^ reference scip-dart pub dart:core 2.19.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# // relationship scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Animal# implementation @@ -35,7 +35,7 @@ // ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`string.dart`/String# // ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Dog#sound(). // relationship scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Animal#sound(). implementation reference - + @override // ^^^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`annotations.dart`/override. String get hierarchy => 'dog.animal.mammal';