groovy-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Sun <>
Subject About a new annotation Groovydoc
Date Fri, 24 Feb 2017 02:46:53 GMT
Hi all,

      I am going to add a new annotation Groovydoc(Retention: RUNTIME),
which is configurable(e.g. -Dgroovy.attach.annotation.groovydoc=true) and
can be attached to target element at compilation time automatically. 

      Groovydoc can be got easily even if Groovy source code is compiled
into class files, it is a bit like Python's Documentation Strings and will
be useful for IDE and developers who set a high value on documentations.
BTW, currently groovydoc is attached as metadata of AST node, which is only
avaliable at compilation time and is a bit hard to get(we have to use
CompilationUnit, which is not familiar and friendly to most of Groovy

# demo for Python's Documentation Strings
def my_function():
    """Do nothing, but document it.
         No, really, it doesn't do anything.
print(my_function.__doc__)  # print the Documentation Strings of the

      Any thoughts?


View this message in context:
Sent from the Groovy Dev mailing list archive at

View raw message