-
Notifications
You must be signed in to change notification settings - Fork 2
FEDX-2227: Fixed logic for constructor references #165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8c052dc
cfb8388
169275a
d29d685
f003e51
3c62e21
69bb98d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,6 @@ | |
|
||
Animal(this.name, {required this.type}) { | ||
// ^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#`<constructor>`(). | ||
// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# | ||
// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#name. | ||
// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#type. | ||
// ^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#`<constructor>`().(type) | ||
|
@@ -77,6 +76,13 @@ | |
} | ||
} | ||
|
||
factory Animal.cat() => Animal('Timmy', type: AnimalType.cat); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very frustratingly, in named constructors, This isn't the case for SimpleIdentifiers for the call sight, but only the constructor declarations The result of this, is we can only index a single element here, and I've decided to index, the arguably more important, definition for factory Animal.cat() => ...
// ^^^^^^ NOT INDEXED
// ^^^ definition ... Animal#cat(). Solving this is a problem for another day... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I created a ticket to track this here: #166 |
||
// ^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#cat(). | ||
// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#`<constructor>`(). | ||
// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#`<constructor>`().(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. | ||
|
||
void makeSound() { | ||
// ^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). | ||
soundMaker?.call(); | ||
|
@@ -122,27 +128,32 @@ | |
// ^^^^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/calculateSum(). | ||
// ^^^^^^^ reference local 3 | ||
|
||
Animal cat = Animal('Kitty', type: AnimalType.cat); | ||
Animal bird = Animal('Kitty', type: AnimalType.bird); | ||
// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# | ||
// ^^^ 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#`<constructor>`().(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. | ||
// ^^^^ definition local 5 | ||
// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#`<constructor>`(). | ||
// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#`<constructor>`().(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#bird. | ||
Animal dog = Animal('Buddy', type: AnimalType.dog); | ||
// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# | ||
// ^^^ 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#`<constructor>`(). | ||
// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#`<constructor>`().(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. | ||
Animal cat = Animal.cat(); | ||
// ^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal# | ||
// ^^^ definition local 7 | ||
// ^^^^^^ 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#cat(). | ||
|
||
cat.makeSound(); | ||
// ^^^ reference local 5 | ||
// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). | ||
cat.sleep(); | ||
// ^^^ reference local 5 | ||
// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). | ||
bird.makeSound(); | ||
// ^^^^ reference local 5 | ||
// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). | ||
bird.sleep(); | ||
// ^^^^ reference local 5 | ||
// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). | ||
|
||
dog.makeSound(); | ||
// ^^^ reference local 6 | ||
|
@@ -151,9 +162,13 @@ | |
// ^^^ reference local 6 | ||
// ^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/SleepMixin#sleep(). | ||
|
||
print(cat); | ||
cat.makeSound(); | ||
// ^^^ reference local 7 | ||
// ^^^^^^^^^ reference scip-dart pub dart_test 1.0.0 lib/`more.dart`/Animal#makeSound(). | ||
|
||
print(bird); | ||
// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). | ||
// ^^^ reference local 5 | ||
// ^^^^ reference local 5 | ||
print(dog); | ||
// ^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`print.dart`/print(). | ||
// ^^^ reference local 6 | ||
|
@@ -165,23 +180,23 @@ | |
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:math 2.19.0 dart:math/`rectangle.dart`/Rectangle#`<constructor>`(). | ||
|
||
[1,2].reduce((a, b) => a + b); | ||
// ^^^^^^ reference scip-dart pub dart:core 2.19.0 dart:core/`iterable.dart`/Iterable#reduce(). | ||
// ^ definition local 7 | ||
// ^ definition local 8 | ||
// ^ reference local 7 | ||
// ^ reference local 8 | ||
// ^ definition local 8 | ||
// ^ definition local 9 | ||
// ^ 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(). | ||
// ^^^^^^ 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 9 | ||
// ^ definition local 10 | ||
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 10 | ||
// ^ definition local 11 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now we're correctly referencing
<constructor>
, fixed by: https://github.com/Workiva/scip-dart/pull/165/files#diff-0ab533d80a9e11da530798d9b92364a97087c4754ab8251de00d85b635c6a4e4R76