-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed as not planned
Labels
area-pkgUsed for miscellaneous pkg/ packages not associated with specific area- teams.Used for miscellaneous pkg/ packages not associated with specific area- teams.feature-macrosImplementation of the macros featureImplementation of the macros featurepkg-macrosThe experimental package:_macros libraryThe experimental package:_macros librarytype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Description
Allow comment introspection
I propose adding a property for comments to the Declaration class. I imagine it looking somethings like this:
/// This is the doc comment
final String someVar = 'some value';
void main() {
// field = the declaration for someVar
final FieldDeclaration field;
print(field.comments.toString());
}dart run
This is the doc comment
Exited.Usecase
The usecase I have is creating a macro to generate a vscode json-schema file for a config service but I believe access to comments would be very useful in any kind of automatic file generation.
Resources
Implementation of similar functionality in code generation package dartgenerate: https://pub.dev/documentation/dartgenerate/latest/dartgenerate/FieldDeclaration-class.html.
Metadata
Metadata
Assignees
Labels
area-pkgUsed for miscellaneous pkg/ packages not associated with specific area- teams.Used for miscellaneous pkg/ packages not associated with specific area- teams.feature-macrosImplementation of the macros featureImplementation of the macros featurepkg-macrosThe experimental package:_macros libraryThe experimental package:_macros librarytype-enhancementA request for a change that isn't a bugA request for a change that isn't a bug
Type
Projects
Status
Done