瀏覽代碼

Allow @:noDoc on fields too (#9893)

Rudy Ges 4 年之前
父節點
當前提交
3dc01cd9eb
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src-json/meta.json
  2. 1 1
      src/codegen/genxml.ml

+ 1 - 1
src-json/meta.json

@@ -798,7 +798,7 @@
 	{
 		"name": "NoDoc",
 		"metadata": ":noDoc",
-		"doc": "Prevents a type from being included in documentation generation."
+		"doc": "Prevents a type or field from being included in documentation generation."
 	},
 	{
 		"name": "NoExpr",

+ 1 - 1
src/codegen/genxml.ml

@@ -219,7 +219,7 @@ let rec gen_type_decl com pos t =
 		) c.cl_ordered_statics in
 		let stats = List.map (gen_field ["static","1"]) stats in
 		let fields = List.filter (fun cf ->
-			not (Meta.has Meta.GenericInstance cf.cf_meta)
+			not (Meta.has Meta.GenericInstance cf.cf_meta) && not (Meta.has Meta.NoDoc cf.cf_meta)
 		) c.cl_ordered_fields in
 		let fields = (match c.cl_super with
 			| None -> List.map (fun f -> f,[]) fields