Have you considered implementing a macro annotation instead of compiler plugin? Synthesizing members like def hello()
is quite tricky, see this comment for a more detailed explanation.
I’m not sure if it’s helpful but you might get inspiration from the sources of scalamacros/paradise if macro annotations don’t support your use-case https://github.com/scalamacros/paradise/tree/2.12.8/plugin/src/main/scala/org/scalamacros/paradise/typechecker