Browse Source

add @:message.follow

Simon Krajewski 1 year ago
parent
commit
b73b1132b3
2 changed files with 8 additions and 0 deletions
  1. 6 0
      src-json/meta.json
  2. 2 0
      src/core/tPrinting.ml

+ 6 - 0
src-json/meta.json

@@ -726,6 +726,12 @@
 		"doc": "Merge the annotated block into the current scope.",
 		"targets": ["TExpr"]
 	},
+	{
+		"name": "MessageFollow",
+		"metadata": ":message.follow",
+		"doc": "Follows a typedef when printing it.",
+		"targets": ["TTypedef"]
+	},
 	{
 		"name": "MultiReturn",
 		"metadata": ":multiReturn",

+ 2 - 0
src/core/tPrinting.ml

@@ -68,6 +68,8 @@ let rec s_type ctx t =
 		| _ -> s_type_path c.cl_path ^ s_type_params ctx tl)
 	| TType ({ t_type = TAnon { a_status = { contents = ClassStatics { cl_kind = KAbstractImpl a }}}}, _) ->
 		"Abstract<" ^ (s_type_path a.a_path) ^ ">"
+	| TType (td,tl) when (Meta.has Meta.MessageFollow td.t_meta) ->
+		s_type ctx (apply_typedef td tl)
 	| TType (t,tl) ->
 		s_type_path t.t_path ^ s_type_params ctx tl
 	| TAbstract (a,tl) ->