From 2007694ff221553289d7f72a67829bbca9f1a35a Mon Sep 17 00:00:00 2001 From: Dan Korostelev Date: Sun, 21 Mar 2021 12:17:40 +0100 Subject: [PATCH] make generated fromHxx position the same as class position so goto-definition takes to the class instead of macro code --- src/coconut/react/View.macro.hx | 4 +++- src/coconut/react/macros/Setup.hx | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/coconut/react/View.macro.hx b/src/coconut/react/View.macro.hx index 525c95c..4b2233e 100644 --- a/src/coconut/react/View.macro.hx +++ b/src/coconut/react/View.macro.hx @@ -166,7 +166,9 @@ class View { } }); - parametrize(added[added.length - 1], cls); + var fromHxx = added[added.length - 1]; + fromHxx.pos = cls.pos; + parametrize(fromHxx, cls); } static function autoBuild() diff --git a/src/coconut/react/macros/Setup.hx b/src/coconut/react/macros/Setup.hx index 5924fca..d104520 100644 --- a/src/coconut/react/macros/Setup.hx +++ b/src/coconut/react/macros/Setup.hx @@ -77,6 +77,7 @@ class Setup { } ).fields; + add[0].pos = cls.pos; parametrize(add[0], cls); fields.concat(add);