diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index f52c1b7..216e787 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.3.0/scip-linux-amd64.tar.gz"' | tar xzf - scip + bash -c 'curl -L "https://github.com/sourcegraph/scip/releases/download/v0.3.3/scip-linux-amd64.tar.gz"' | tar xzf - scip ./scip --version - uses: dart-lang/setup-dart@v1 @@ -28,50 +28,17 @@ jobs: run: dart pub get working-directory: ./snapshots/input/basic-project - - name: dart pub get relationships-project directory + - name: dart pub get diagnostics directory run: dart pub get - working-directory: ./snapshots/input/relationships-project + working-directory: ./snapshots/input/diagnostics - name: Snapshots Diff Check run: | dart run scip_dart ./snapshots/input/basic-project ./scip snapshot --to ./snapshots/output/basic-project - if [[ -z "$(git status --porcelain ./snapshots/output)" ]]; - then - echo "No changes to snapshot files" - else - echo - echo "Snapshot diff detected differences, run 'make gen-snaps' to re-generate snapshots" - git status --short ./snapshots/output - echo - exit 1 - fi - - snapshots-diagnostics: - 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.18.7 - - name: pub get scip-dart package - run: dart pub get - - - name: pub get diagnostics directory - run: dart pub get - working-directory: ./snapshots/input/diagnostics - - - name: Install jq - uses: dcarbone/install-jq-action@v2.0.2 - - - name: Snapshots Diff Check - run: | - make gen-snap_diagnostics + dart run scip_dart ./snapshots/input/diagnostics + ./scip snapshot --to ./snapshots/output/diagnostics if [[ -z "$(git status --porcelain ./snapshots/output)" ]]; then @@ -86,7 +53,6 @@ jobs: consumer: runs-on: ubuntu-latest - strategy: matrix: repo: [ diff --git a/Makefile b/Makefile index 4e35121..bdf9185 100644 --- a/Makefile +++ b/Makefile @@ -1,15 +1,9 @@ -gen-snaps: - make gen-snap_basic-project - make gen-snap_relationships-project - make gen-snap_diagnostics - -gen-snap_basic-project: +regen-snapshots: dart run scip_dart ./snapshots/input/basic-project scip snapshot --to ./snapshots/output/basic-project -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 + scip snapshot --to ./snapshots/output/diagnostics run: dart run scip_dart ./snapshots/input/staging-project --verbose diff --git a/snapshots/output/basic-project/lib/main.dart b/snapshots/output/basic-project/lib/main.dart index de66257..cdaed41 100755 --- a/snapshots/output/basic-project/lib/main.dart +++ b/snapshots/output/basic-project/lib/main.dart @@ -1,107 +1,159 @@ 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.19.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.19.0 dart:core/int.dart/int# +//^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/fib(). +// documentation +// > ```dart +// > int fib(int n) +// > ``` +// documentation +// > This is a fib function +// > Takes a number +// > Returns a number +// ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int# // ^ definition local 0 -// documentation ```dart +// documentation +// > ```dart +// > int n +// > ``` 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(). -// documentation ```dart -// ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/int.dart/int# +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/print_fib(). +// documentation +// > ```dart +// > void print_fib(int a) +// > ``` +// ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int# // ^ definition local 1 -// documentation ```dart +// documentation +// > ```dart +// > int a +// > ``` print(fib(a)); -// ^^^^^ reference scip-dart pub dart:core 2.19.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.19.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. -// documentation ```dart +// ^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/y. +// documentation +// > ```dart +// > String y +// > ``` String capture() { -//^^^^^^ 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/capture(). -// documentation ```dart +//^^^^^^ 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`/capture(). +// documentation +// > ```dart +// > String capture() +// > ``` 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. -// documentation ```dart -// ^ reference scip-dart pub dart_test 1.0.0 lib/main.dart/y. +// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/capture_lambda. +// documentation +// > ```dart +// > String Function() capture_lambda +// > ``` +// ^ 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 +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/main(). +// documentation +// > ```dart +// > void main() +// > ``` for (var i = 0; i <= 10; i++) {} // ^ definition local 2 -// documentation ```dart +// documentation +// > ```dart +// > int i +// > ``` // ^ reference local 2 // ^ reference local 2 for (var i in [1, 2, 3]) { // ^ definition local 3 -// documentation ```dart +// documentation +// > ```dart +// > int i +// > ``` print(i); -// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). // ^ reference local 3 } var a = 0; // ^ definition local 4 -// documentation ```dart +// documentation +// > ```dart +// > int a +// > ``` 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(). -// documentation ```dart +// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/forever(). +// documentation +// > ```dart +// > void forever() +// > ``` 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# -// documentation ```dart +// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/SomeLocalClass# +// documentation +// > ```dart +// > class SomeLocalClass +// > ``` /// 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(). -// documentation ```dart -// documentation Reference parameter: [value] -// ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/int.dart/int# +// ^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/someFunction(). +// documentation +// > ```dart +// > void someFunction(int value) +// > ``` +// documentation +// > Reference parameter: [value] +// > Reference class: [SomeLocalClass] +// > Reference external class: [Foo] +// > Missing Reference: [IDontExist] +// ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int# // ^^^^^ definition local 5 -// documentation ```dart +// documentation +// > ```dart +// > int value +// > ``` 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 a725878..9857ba2 100755 --- a/snapshots/output/basic-project/lib/more.dart +++ b/snapshots/output/basic-project/lib/more.dart @@ -1,215 +1,313 @@ 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 +// 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 +// > as math +// > ``` enum AnimalType { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType# -// documentation ```dart +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType# +// documentation +// > ```dart +// > enum AnimalType +// > ``` cat, -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#cat. -// documentation ```dart +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#cat. +// documentation +// > ```dart +// > AnimalType cat +// > ``` dog, -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#dog. -// documentation ```dart +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#dog. +// documentation +// > ```dart +// > AnimalType dog +// > ``` bird, -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/AnimalType#bird. -// documentation ```dart +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/AnimalType#bird. +// documentation +// > ```dart +// > AnimalType bird +// > ``` } typedef SoundMaker = void Function(); -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SoundMaker# -// documentation ```dart +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/SoundMaker# +// documentation +// > ```dart +// > typedef SoundMaker = void Function() +// > ``` mixin SleepMixin { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin# -// documentation ```dart +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin# +// documentation +// > ```dart +// > mixin SleepMixin on Object +// > ``` void sleep() { -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin#sleep(). -// documentation ```dart +// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). +// documentation +// > ```dart +// > void sleep() +// > ``` print('zzz...'); -// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/print.dart/print(). +// ^^^^^ 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# -// documentation ```dart -// ^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/SleepMixin# +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# +// documentation +// > ```dart +// > class Animal with SleepMixin +// > ``` +// 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# -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#name. -// documentation ```dart +// ^^^^^^ 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#name. +// documentation +// > ```dart +// > String name +// > ``` 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 +// ^^^^^^^^^^ 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 +// > AnimalType type +// > ``` 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 +// ^^^^^^^^^^ 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 +// > void Function() soundMaker +// > ``` 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 scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#``(). +// documentation +// > ```dart +// > Animal Animal(String name, {required AnimalType type}) +// > ``` +// ^^^^^^ 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 +// documentation +// > ```dart +// > String name +// > ``` +// ^^^^ 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 +// > {required AnimalType type} +// > ``` 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.19.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.19.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.19.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.19.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.19.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.19.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.19.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.19.0 dart:core/`print.dart`/print(). } } void makeSound() { -// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/Animal#makeSound(). -// documentation ```dart +// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). +// documentation +// > ```dart +// > void makeSound() +// > ``` 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.19.0 dart:core/annotations.dart/override. +// ^^^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`annotations.dart`/override. String toString() { -// ^^^^^^ 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 +// ^^^^^^ 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 +// > String toString() +// > ``` +// 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. +// ^^^^ 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.19.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.19.0 dart:core/list.dart/List# -// ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/int.dart/int# +//^^^ 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(). +// documentation +// > ```dart +// > int calculateSum(List numbers) +// > ``` +// ^^^^ 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 -// documentation ```dart +// documentation +// > ```dart +// > List numbers +// > ``` return numbers.reduce((value, element) => value + element); // ^^^^^^^ reference local 1 -// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/iterable.dart/Iterable#reduce(). +// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`iterable.dart`/Iterable#reduce(). // ^^^^^ definition local 2 -// documentation ```dart +// documentation +// > ```dart +// > int value +// > ``` // ^^^^^^^ definition local 3 -// documentation ```dart +// documentation +// > ```dart +// > int element +// > ``` // ^^^^^ reference local 2 // ^^^^^^^ reference local 3 } void main() { -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/main(). -// documentation ```dart +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/main(). +// documentation +// > ```dart +// > void 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# +// ^^^^ 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 -// documentation ```dart +// documentation +// > ```dart +// > List numbers +// > ``` int sum = calculateSum(numbers); -// ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/int.dart/int# +// ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int# // ^^^ definition local 5 -// documentation ```dart -// ^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/calculateSum(). +// documentation +// > ```dart +// > int sum +// > ``` +// ^^^^^^^^^^^^ 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. +// documentation +// > ```dart +// > Animal 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. +// documentation +// > ```dart +// > Animal 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.19.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). // ^^^ reference local 6 print(dog); -// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). // ^^^ reference local 7 print('The sum of $numbers is $sum'); -// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.19.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.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# +// ^^^^^ 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(). +// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`iterable.dart`/Iterable#reduce(). // ^ definition local 8 -// documentation ```dart +// documentation +// > ```dart +// > int a +// > ``` // ^ definition local 9 -// documentation ```dart +// documentation +// > ```dart +// > int b +// > ``` // ^ reference local 8 // ^ reference local 9 } void test(String Function(int) p) {} -// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/more.dart/test(). -// 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 scip-dart pub dart_test 1.0.0 lib/`more.dart`/test(). +// documentation +// > ```dart +// > void test(String Function(int) p) +// > ``` +// ^^^^^^ 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 -// documentation ```dart +// documentation +// > ```dart +// > String Function(int) p +// > ``` 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 scip-dart pub dart_test 1.0.0 lib/`more.dart`/deepTest(). +// documentation +// > ```dart +// > void deepTest(String Function(void Function(String)) p) +// > ``` +// ^^^^^^ 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 -// documentation ```dart +// documentation +// > ```dart +// > String Function(void Function(String)) p +// > ``` diff --git a/snapshots/output/basic-project/lib/other.dart b/snapshots/output/basic-project/lib/other.dart index 8ec5850..be295c2 100755 --- a/snapshots/output/basic-project/lib/other.dart +++ b/snapshots/output/basic-project/lib/other.dart @@ -1,89 +1,151 @@ 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 +// 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 +// > as more +// > ``` class Foo { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo# -// documentation ```dart +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo# +// documentation +// > ```dart +// > class Foo +// > ``` int _far; -// ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/int.dart/int# +// ^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`int.dart`/int# // ^^^^ definition local 0 -// documentation ```dart +// documentation +// > ```dart +// > int _far +// > ``` +// diagnostic Information: +// > The value of the field '_far' isn't used. bool value; -// ^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/bool.dart/bool# -// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#value. -// documentation ```dart +// ^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`bool.dart`/bool# +// ^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value. +// documentation +// > ```dart +// > bool value +// > ``` String value2; -// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/string.dart/String# -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#value2. -// documentation ```dart +// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`string.dart`/String# +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value2. +// documentation +// > ```dart +// > String value2 +// > ``` double value3; -// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/double.dart/double# -// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#value3. -// documentation ```dart +// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`double.dart`/double# +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value3. +// documentation +// > ```dart +// > double value3 +// > ``` 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# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#``(). +// documentation +// > ```dart +// > Foo Foo(int _far) +// > ``` +// diagnostic Error: +// > Non-nullable instance field 'value' must be initialized. +// diagnostic Error: +// > Non-nullable instance field 'value2' must be initialized. +// diagnostic Error: +// > Non-nullable instance field 'value3' must be initialized. +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo# +// diagnostic Error: +// > Non-nullable instance field 'value' must be initialized. +// diagnostic Error: +// > Non-nullable instance field 'value2' must be initialized. +// diagnostic Error: +// > Non-nullable instance field 'value3' must be initialized. // ^^^^ reference local 0 // ^^^^ definition local 1 -// documentation ```dart +// documentation +// > ```dart +// > int _far +// > ``` } class Bar { -// ^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar# -// documentation ```dart +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar# +// documentation +// > ```dart +// > class Bar +// > ``` String _someValue; -// ^^^^^^ 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 2 -// documentation ```dart +// documentation +// > ```dart +// > String _someValue +// > ``` 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# +// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar#``(). +// documentation +// > ```dart +// > Bar Bar(String _someValue) +// > ``` +// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar# // ^^^^ reference local 2 // ^^^^^^^^^^ definition local 3 -// documentation ```dart +// documentation +// > ```dart +// > String _someValue +// > ``` void someMethod() { -// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/other.dart/Bar#someMethod(). -// documentation ```dart +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/Bar#someMethod(). +// documentation +// > ```dart +// > void someMethod() +// > ``` _someValue = 'asdf'; // ^^^^^^^^^^ reference local 2 print(_someValue); -// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/print.dart/print(). +// ^^^^^ reference scip-dart pub dart:core 2.19.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 +// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`other.dart`/main(). +// documentation +// > ```dart +// > void 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(). +// ^^^^ 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 -// documentation ```dart +// documentation +// > ```dart +// > dynamic _ +// > ``` 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(). }); Foo()..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# +// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#value. final someStr = 'someStr'; // ^^^^^^^ definition local 5 -// documentation ```dart +// documentation +// > ```dart +// > String someStr +// > ``` 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# ..value = true -// ^^^^^ 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#value. ..value2 = someStr -// ^^^^^^ 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#value2. // ^^^^^^^ reference local 5 ..value3 = 2.15 -// ^^^^^^ reference 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. } diff --git a/snapshots/output/basic-project/lib/relationships.dart b/snapshots/output/basic-project/lib/relationships.dart new file mode 100755 index 0000000..174afc4 --- /dev/null +++ b/snapshots/output/basic-project/lib/relationships.dart @@ -0,0 +1,81 @@ + 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 +// > abstract class Mammal +// > ``` + 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 +// > String get hierarchy +// > ``` + } + + abstract class Animal extends Mammal { +// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/Animal# +// documentation +// > ```dart +// > abstract class Animal extends Mammal +// > ``` +// 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 +// > String sound() +// > ``` + } + + mixin SwimAction { +// ^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/SwimAction# +// documentation +// > ```dart +// > mixin SwimAction on Object +// > ``` + void execute() => print('swimming...'); +// ^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`relationships.dart`/SwimAction#execute(). +// documentation +// > ```dart +// > void 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# +// documentation +// > ```dart +// > class Dog extends Animal with SwimAction +// > ``` +// 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 +// > String 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'; +// ^^^^^^ 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 +// > String get hierarchy +// > ``` +// 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 a7506aa..e06a01f 100755 --- a/snapshots/output/basic-project/test/basic_test.dart +++ b/snapshots/output/basic-project/test/basic_test.dart @@ -1,15 +1,18 @@ 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(). -// documentation ```dart +// ^^^^ definition scip-dart pub dart_test 1.0.0 test/`basic_test.dart`/main(). +// documentation +// > ```dart +// > void main() +// > ``` 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(). }); }); } diff --git a/snapshots/output/diagnostics/lib/main.dart b/snapshots/output/diagnostics/lib/main.dart new file mode 100755 index 0000000..d49fda0 --- /dev/null +++ b/snapshots/output/diagnostics/lib/main.dart @@ -0,0 +1,105 @@ + import 'dart:collection'; // unused import +// definition scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/ + + class _UnusedClass {} +// ^^^^^^^^^^^^ definition local 0 +// documentation +// > ```dart +// > class _UnusedClass +// > ``` +// diagnostic Information: +// > The declaration '_UnusedClass' isn't referenced. + + void _unusedMethod() {} +// ^^^^^^^^^^^^^ definition local 1 +// documentation +// > ```dart +// > void _unusedMethod() +// > ``` +// diagnostic Information: +// > The declaration '_unusedMethod' isn't referenced. + + String _unusedTopLevelVariable = 'asdf'; +//^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`string.dart`/String# +// ^^^^^^^^^^^^^^^^^^^^^^^ definition local 2 +// documentation +// > ```dart +// > String _unusedTopLevelVariable +// > ``` +// diagnostic Information: +// > The declaration '_unusedTopLevelVariable' isn't referenced. + + @Deprecated('This method is deprecated') +// ^^^^^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`annotations.dart`/Deprecated# + void deprecatedMethod() {} +// ^^^^^^^^^^^^^^^^ definition scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedMethod(). +// documentation +// > ```dart +// > void deprecatedMethod() +// > ``` + + void deprecatedParam({ +// ^^^^^^^^^^^^^^^ definition scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedParam(). +// documentation +// > ```dart +// > void deprecatedParam({dynamic foobar}) +// > ``` + @Deprecated('this param is deprecated') dynamic foobar +// ^^^^^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`annotations.dart`/Deprecated# +// ^^^^^^ definition scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedParam().(foobar) +// documentation +// > ```dart +// > {dynamic foobar} +// > ``` + }) {} + + void main() { +// ^^^^ definition scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/main(). +// documentation +// > ```dart +// > void main() +// > ``` + final unusedVariable = 'asdf'; +// ^^^^^^^^^^^^^^ definition local 3 +// documentation +// > ```dart +// > String unusedVariable +// > ``` +// diagnostic Information: +// > The value of the local variable 'unusedVariable' isn't used. + + String variableWithUnecssaryDeclaration = 'asdf'; +// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`string.dart`/String# +// ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ definition local 4 +// documentation +// > ```dart +// > String variableWithUnecssaryDeclaration +// > ``` +// diagnostic Information: +// > The value of the local variable 'variableWithUnecssaryDeclaration' isn't used. + + // dead_code example + if (true) { } else { + print('This condition is never met!'); +// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). + } + + deprecatedMethod(); +// ^^^^^^^^^^^^^^^^ reference scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedMethod(). +// diagnostic Information: +// > 'deprecatedMethod' is deprecated and shouldn't be used. This method is deprecated. + deprecatedParam(foobar: 2); +// ^^^^^^^^^^^^^^^ reference scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedParam(). +// ^^^^^^ reference scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedParam().(foobar) +// diagnostic Information: +// > 'foobar' is deprecated and shouldn't be used. this param is deprecated. + } + + @deprecated +// ^^^^^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`annotations.dart`/deprecated. + void someDeprecatedFunc() {} +// ^^^^^^^^^^^^^^^^^^ definition scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/someDeprecatedFunc(). +// documentation +// > ```dart +// > void someDeprecatedFunc() +// > ``` diff --git a/snapshots/output/diagnostics/output.json b/snapshots/output/diagnostics/output.json deleted file mode 100644 index fc58227..0000000 --- a/snapshots/output/diagnostics/output.json +++ /dev/null @@ -1,118 +0,0 @@ -[ - { - "range": [ - 2, - 6, - 18 - ], - "symbol": "local 0", - "symbolRoles": 1, - "diagnostics": [ - { - "severity": "Information", - "code": "UNUSED_ELEMENT", - "message": "The declaration '_UnusedClass' isn't referenced." - } - ] - }, - { - "range": [ - 4, - 5, - 18 - ], - "symbol": "local 1", - "symbolRoles": 1, - "diagnostics": [ - { - "severity": "Information", - "code": "UNUSED_ELEMENT", - "message": "The declaration '_unusedMethod' isn't referenced." - } - ] - }, - { - "range": [ - 6, - 7, - 30 - ], - "symbol": "local 2", - "symbolRoles": 1, - "diagnostics": [ - { - "severity": "Information", - "code": "UNUSED_ELEMENT", - "message": "The declaration '_unusedTopLevelVariable' isn't referenced." - } - ] - }, - { - "range": [ - 16, - 8, - 22 - ], - "symbol": "local 3", - "symbolRoles": 1, - "diagnostics": [ - { - "severity": "Information", - "code": "UNUSED_LOCAL_VARIABLE", - "message": "The value of the local variable 'unusedVariable' isn't used." - } - ] - }, - { - "range": [ - 18, - 9, - 41 - ], - "symbol": "local 4", - "symbolRoles": 1, - "diagnostics": [ - { - "severity": "Information", - "code": "UNUSED_LOCAL_VARIABLE", - "message": "The value of the local variable 'variableWithUnecssaryDeclaration' isn't used." - } - ] - }, - { - "range": [ - 25, - 2, - 18 - ], - "symbol": "scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedMethod().", - "diagnostics": [ - { - "severity": "Information", - "code": "DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE", - "message": "'deprecatedMethod' is deprecated and shouldn't be used. This method is deprecated.", - "tags": [ - "Deprecated" - ] - } - ] - }, - { - "range": [ - 26, - 18, - 24 - ], - "symbol": "scip-dart pub dart_test_diagnostics 1.0.0 lib/`main.dart`/deprecatedParam().(foobar)", - "diagnostics": [ - { - "severity": "Information", - "code": "DEPRECATED_MEMBER_USE_FROM_SAME_PACKAGE", - "message": "'foobar' is deprecated and shouldn't be used. this param is deprecated.", - "tags": [ - "Deprecated" - ] - } - ] - } -] diff --git a/snapshots/output/relationships-project/lib/main.dart b/snapshots/output/relationships-project/lib/main.dart deleted file mode 100755 index d458121..0000000 --- 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 - }