Skip to content

Commit

Permalink
updated scip protobuf
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewnitschke-wk committed Jan 28, 2024
1 parent 55adb87 commit f1f9300
Show file tree
Hide file tree
Showing 13 changed files with 1,945 additions and 970 deletions.
781 changes: 607 additions & 174 deletions lib/src/gen/scip.pb.dart

Large diffs are not rendered by default.

590 changes: 426 additions & 164 deletions lib/src/gen/scip.pbenum.dart

Large diffs are not rendered by default.

813 changes: 543 additions & 270 deletions lib/src/gen/scip.pbjson.dart

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions lib/src/gen/scip.pbserver.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
///
//
// Generated code. Do not modify.
// source: lib/src/gen/scip.proto
//
// @dart = 2.12
// ignore_for_file: annotate_overrides,camel_case_types,constant_identifier_names,deprecated_member_use_from_same_package,directives_ordering,library_prefixes,non_constant_identifier_names,prefer_final_fields,return_of_invalid_type,unnecessary_const,unnecessary_import,unnecessary_this,unused_import,unused_shown_name

// ignore_for_file: annotate_overrides, camel_case_types, comment_references
// ignore_for_file: constant_identifier_names
// ignore_for_file: deprecated_member_use_from_same_package, library_prefixes
// ignore_for_file: non_constant_identifier_names, prefer_final_fields
// ignore_for_file: unnecessary_import, unnecessary_this, unused_import

export 'scip.pb.dart';

370 changes: 348 additions & 22 deletions lib/src/gen/scip.proto

Large diffs are not rendered by default.

18 changes: 12 additions & 6 deletions lib/src/metadata.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,16 @@ const _unusedHintCodes = {
/// Use [getSymbolMetadata] to retrieve [SymbolMetadata] for a provided
/// [Element] type.
class SymbolMetadata {
List<String> documentation;
proto.Document signatureDocumentation;

List<String>? documentation;
List<proto.Diagnostic>? diagnostics;

SymbolMetadata({required this.documentation, this.diagnostics});
SymbolMetadata({
required this.signatureDocumentation,
this.documentation,
this.diagnostics,
});
}

/// Returns a [SymbolMetadata] object for a provided [Element] type.
Expand Down Expand Up @@ -65,10 +70,11 @@ SymbolMetadata getSymbolMetadata(
.toList();

return SymbolMetadata(
documentation: [
'```dart\n$displayString\n```',
if (docComment != null) docComment
],
signatureDocumentation: proto.Document(
language: proto.Language.Dart.name,
text: displayString,
),
documentation: docComment != null ? [docComment] : null,
diagnostics: diagnostics.isNotEmpty ? diagnostics : null,
);
}
Expand Down
2 changes: 2 additions & 0 deletions lib/src/scip_visitor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ class ScipVisitor extends GeneralizingAstVisitor {
globalExternalSymbols.add(SymbolInformation(
symbol: symbol,
documentation: meta.documentation,
signatureDocumentation: meta.signatureDocumentation,
));
}
}
Expand All @@ -200,6 +201,7 @@ class ScipVisitor extends GeneralizingAstVisitor {
symbol: symbol,
documentation: meta.documentation,
relationships: relationships,
signatureDocumentation: meta.signatureDocumentation,
));

occurrences.add(Occurrence(
Expand Down
60 changes: 0 additions & 60 deletions snapshots/output/basic-project/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,11 @@
//^^^ 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
// > int n
// > ```
if (n <= 1) return 0;
// ^ reference local 0
return fib(n - 1) + fib(n - 2);
Expand All @@ -33,16 +25,8 @@

void print_fib(int a) {
// ^^^^^^^^^ 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
// > 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().
Expand All @@ -51,61 +35,33 @@

final y = 'Hello';
// ^ 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
// > String capture()
// > ```
return 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
// > 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
// > void main()
// > ```
for (var i = 0; i <= 10; i++) {}
// ^ definition local 2
// documentation
// > ```dart
// > int i
// > ```
// ^ reference local 2
// ^ reference local 2

for (var i in [1, 2, 3]) {
// ^ definition local 3
// documentation
// > ```dart
// > int i
// > ```
print(i);
// ^^^^^ 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
// > int a
// > ```
a = 1;
// ^ reference local 4
print_fib(a);
Expand All @@ -115,20 +71,12 @@

void forever() {
// ^^^^^^^ 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().
}

class SomeLocalClass {}
// ^^^^^^^^^^^^^^ definition scip-dart pub dart_test 1.0.0 lib/`main.dart`/SomeLocalClass#
// documentation
// > ```dart
// > class SomeLocalClass
// > ```

/// Reference parameter: [value]
// ^^^^^ reference local 5
Expand All @@ -140,20 +88,12 @@
void someFunction(int value) {
// ^^^^^^^^^^^^ 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
// > int value
// > ```
Foo(1);
// ^^^ reference scip-dart pub dart_test 1.0.0 lib/`other.dart`/Foo#
}
Loading

0 comments on commit f1f9300

Please sign in to comment.