소스 검색

Merge pull request #9707 from richardkchapman/javadoc-640

HPCC-16603 Extract Java Doc comments from attributes.

Reviewed-by: Gavin Halliday <ghalliday@hpccsystems.com>
Gavin Halliday 8 년 전
부모
커밋
45755627b6
4개의 변경된 파일13개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      ecl/eclcc/eclcc.cpp
  2. 3 0
      ecl/hql/hqldesc.cpp
  3. 8 0
      ecl/hql/hqlexpr.cpp
  4. 1 0
      ecl/hql/hqlexpr.hpp

+ 1 - 1
ecl/eclcc/eclcc.cpp

@@ -1137,7 +1137,7 @@ void EclCC::processSingleQuery(EclCompileInstance & instance,
             options.includePrivateDefinitions = instance.wu->getDebugValueBool("metaIncludePrivate", true);
             options.onlyGatherRoot = instance.wu->getDebugValueBool("metaIncludeMainOnly", false);
             options.includeImports = instance.wu->getDebugValueBool("metaIncludeImports", true);
-            options.includeExternalUses = instance.wu->getDebugValueBool("metaIncludeExternalUse", true);
+            options.includeInternalUses = instance.wu->getDebugValueBool("metaIncludeInternalUse", true);
             options.includeExternalUses = instance.wu->getDebugValueBool("metaIncludeExternalUse", true);
             options.includeLocations = instance.wu->getDebugValueBool("metaIncludeLocations", true);
             options.includeJavadoc = instance.wu->getDebugValueBool("metaIncludeJavadoc", true);

+ 3 - 0
ecl/hql/hqldesc.cpp

@@ -130,6 +130,9 @@ void expandSymbolMeta(IPropertyTree * metaTree, IHqlExpression * expr)
 
     if (def)
     {
+        Owned<IPropertyTree> javadoc = getJavadocAnnotation(expr);
+        if (javadoc)
+            def->addPropTree("Documentation", javadoc.getClear());
         IHqlNamedAnnotation * symbol = queryNameAnnotation(expr);
         def->setProp("@name", str(expr->queryName()));
         def->setPropInt("@line", expr->getStartLine());

+ 8 - 0
ecl/hql/hqlexpr.cpp

@@ -7534,6 +7534,14 @@ IHqlNamedAnnotation * queryNameAnnotation(IHqlExpression * expr)
     return static_cast<IHqlNamedAnnotation *>(symbol->queryAnnotation());
 }
 
+IPropertyTree * getJavadocAnnotation(IHqlExpression * expr)
+{
+    IHqlExpression * symbol = queryAnnotation(expr, annotate_javadoc);
+    if (!symbol)
+        return NULL;
+    return symbol->getDocumentation();
+}
+
 //---------------------------------------------------------------------------------------------------------------------
 
 

+ 1 - 0
ecl/hql/hqlexpr.hpp

@@ -1459,6 +1459,7 @@ extern HQL_API IHqlExpression * queryAttributeInList(IAtom * search, IHqlExpress
 extern HQL_API IHqlExpression * queryAttribute(IAtom * search, const HqlExprArray & exprs);
 extern HQL_API IHqlExpression * queryAnnotation(IHqlExpression * expr, annotate_kind search);       // return first match
 extern HQL_API IHqlNamedAnnotation * queryNameAnnotation(IHqlExpression * expr);
+extern HQL_API IPropertyTree *getJavadocAnnotation(IHqlExpression * expr);
 extern HQL_API void gatherAttributes(HqlExprArray & matches, IAtom * search, IHqlExpression * expr);
 
 inline bool hasAnnotation(IHqlExpression * expr, annotate_kind search){ return queryAnnotation(expr, search) != NULL; }