Skip to content

Commit

Permalink
Add packageName to index.json entries (#2271)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkoren authored Jul 20, 2020
1 parent b8c058f commit 0d55bbb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/src/generator/generator_utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import 'package:collection/collection.dart';
import 'package:dartdoc/src/model/categorization.dart';
import 'package:dartdoc/src/model/enclosed_element.dart';
import 'package:dartdoc/src/model/indexable.dart';
import 'package:dartdoc/src/model/model_element.dart';

/// Convenience function to generate category JSON since different generators
/// will likely want the same content for this.
Expand Down Expand Up @@ -54,6 +55,9 @@ String generateSearchIndexJson(
'type': e.kind,
'overriddenDepth': e.overriddenDepth,
};
if (e is ModelElement) {
data['packageName'] = e.package.name;
}
if (e is EnclosedElement) {
var ee = e as EnclosedElement;
data['enclosedBy'] = {
Expand Down

0 comments on commit 0d55bbb

Please sign in to comment.