Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
version: 2
updates:
- package-ecosystem: "pub"
directory: "/"
- package-ecosystem: pub
versioning-strategy: increase
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

directory: /
schedule:
interval: "weekly"
interval: weekly
15 changes: 15 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This lets the debugger be used for indexing staging-project

{
"name": "scip-dart",
"request": "launch",
"program": "bin/scip_dart.dart",
"type": "dart",
"args": ["./snapshots/input/staging-project"]
}
]
}
8 changes: 8 additions & 0 deletions lib/src/scip_visitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@ class ScipVisitor extends GeneralizingAstVisitor {
final element = node.declaredElement;
if (element == null) return;

// if this parameter is a child of a GenericFunctionType (can be a
// typedef, or a function as a parameter), we don't want to index it
// as a definition (nothing is defined, just referenced). Return false
// and let the [_visitSimpleIdentifier] declare the reference
final parentParameter =
node.parent?.thisOrAncestorOfType<GenericFunctionType>();
if (parentParameter != null) return;

if (node is FieldFormalParameter) {
final fieldElement = (element as FieldFormalParameterElement).field;
_registerAsReference(
Expand Down
8 changes: 4 additions & 4 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,21 @@ packages:
name: _fe_analyzer_shared
url: "https://pub.dartlang.org"
source: hosted
version: "61.0.0"
version: "54.0.0"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dependabot pub does not effect the pubspec.yaml directly, and when it does bump versions, it doesnt care about bumping past the sdk: field declared in the pubspec.yaml

For example: analyzer 5.13.0 requires dart 2.19, but dependabot happily bumped the lockfile to an invalid version. this change is an effort to see what a different versioning strategy does to the resolution logic in dart

analyzer:
dependency: "direct main"
description:
name: analyzer
url: "https://pub.dartlang.org"
source: hosted
version: "5.13.0"
version: "5.6.0"
args:
dependency: "direct main"
description:
name: args
url: "https://pub.dartlang.org"
source: hosted
version: "2.4.2"
version: "2.4.1"
async:
dependency: transitive
description:
Expand Down Expand Up @@ -175,7 +175,7 @@ packages:
name: glob
url: "https://pub.dartlang.org"
source: hosted
version: "2.1.2"
version: "2.1.1"
graphs:
dependency: transitive
description:
Expand Down
5 changes: 5 additions & 0 deletions snapshots/input/basic-project/lib/more.dart
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,9 @@ void main() {
print('The sum of $numbers is $sum');

print(math.Rectangle(1,2,3,4));

[1,2].reduce((a, b) => a + b);
}

void test(String Function(int) p) {}
void deepTest(String Function(void Function(String test)) p) {}
23 changes: 23 additions & 0 deletions snapshots/output/basic-project/lib/more.dart
Original file line number Diff line number Diff line change
Expand Up @@ -188,5 +188,28 @@
// ^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/print.dart/print().
// ^^^^ reference scip-dart pub dart_test 1.0.0 lib/more.dart/math.
// ^^^^^^^^^ reference scip-dart pub dart:math 2.18.0 dart:math/rectangle.dart/Rectangle#

[1,2].reduce((a, b) => a + b);
// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/iterable.dart/Iterable#reduce().
// ^ definition local 8
// documentation ```dart
// ^ definition local 9
// documentation ```dart
// ^ 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.18.0 dart:core/string.dart/String#
// ^^^ reference scip-dart pub dart:core 2.18.0 dart:core/int.dart/int#
// ^ definition local 10
// 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.18.0 dart:core/string.dart/String#
// ^^^^^^ reference scip-dart pub dart:core 2.18.0 dart:core/string.dart/String#
// ^ definition local 11
// documentation ```dart