Skip to content

Commit

Permalink
regen all snaps
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewnitschke-wk committed Jan 25, 2024
1 parent 9b837e3 commit 4b33945
Show file tree
Hide file tree
Showing 9 changed files with 612 additions and 389 deletions.
10 changes: 2 additions & 8 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
140 changes: 96 additions & 44 deletions snapshots/output/basic-project/lib/main.dart
Original file line number Diff line number Diff line change
@@ -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#
}
Loading

0 comments on commit 4b33945

Please sign in to comment.