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: 0 additions & 7 deletions lib/src/scip_visitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ class ScipVisitor extends GeneralizingAstVisitor {

@override
void visitNode(AstNode node) {
// print(':: $node ${node.runtimeType}');
if (node is Comment) {
// For now, don't parse anything within comments (this was broken for
// local references). Later update to support this
return;
}

// [visitDeclaration] on the [GeneralizingAstVisitor] does not match parameters
// even though the parameter node extends [Declaration]. This is a workaround
// to correctly parse all [Declaration] ast nodes.
Expand Down
4 changes: 4 additions & 0 deletions pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,7 @@ dev_dependencies:
dependency_validator: ^3.2.2
dart_dev: '>=3.9.2 <5.0.0'
glob: ^2.1.1

dependency_validator:
exclude:
- snapshots/**
12 changes: 12 additions & 0 deletions snapshots/input/basic-project/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import 'package:dart_test/other.dart';

/// This is a fib function
///
/// Takes a number
Expand Down Expand Up @@ -33,3 +35,13 @@ void main() {
void forever() {
return forever();
}

class SomeLocalClass {}

/// Reference parameter: [value]
/// Reference class: [SomeLocalClass]
/// Reference external class: [Foo]
/// Missing Reference: [IDontExist]
void someFunction(int value) {
Foo(1);
}
25 changes: 24 additions & 1 deletion snapshots/output/basic-project/lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/// This is a fib function
import 'package:dart_test/other.dart';
// definition scip-dart pub dart_test 1.0.0 lib/main.dart/

/// This is a fib function
///
/// Takes a number
/// Returns a number
Expand Down Expand Up @@ -82,3 +84,24 @@
// ^^^^^^^ 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

/// Reference parameter: [value]
// ^^^^^ reference local 5
/// Reference class: [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#
/// 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.18.0 dart:core/int.dart/int#
// ^^^^^ definition local 5
// documentation ```dart
Foo(1);
// ^^^ reference scip-dart pub dart_test 1.0.0 lib/other.dart/Foo#
}