flutter / flutter/flutter-intellij

Show/expand Dart templates in source editor

Open
#6,257 5 comments 64 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
2k
Forks
356
Avg merge
1d 11h
Merged PRs (30d)
27

Description

Dart supports documentation templates, for example:

```dart
/// This is the dart doc for some property.
///
/// {@template some_template}
/// This explanation is needed many places in our docs, so we wrap it with a
/// template.
/// {@endtemplate}

/// This is another doc for some other property, which replicates our templated
/// doc.
///
/// {@macro some_template}
```

This templating behavior is critical to keep related documentation in sync. However, these templates are a significant nuisance for developers who are working in source code.

I routinely jump into Flutter source to read docs, only to find a `@macro` where I was expecting documentation. I have the same problem in my own source code where macros are used.

I'd like to see one or both of the following in the IDE:

- Source linking for template macro's so that I can `CMD+B` to the definition of the template.
- Automatic IDE expansion of a macro template so that I can read a template inline, as if it were written in the source code docs that I'm reading.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.