0

There's a previous related question about this here:

Is there any way to include the name of the interface when implementing the method

But I'm asking if there's a way so IntelliJ Idea does it itself when it generates these method automatically. It'd be great if the @Override annotation had some syntax like @Override(from_class), so you can have things like:

@Override("Comparable") Integer compareTo(Object o) { ... }

But that's not the case.

I've played a bit with the templates but thereis no ${OVERRIDDEN_FROM} or similar variable available with the name of the interface/class the method is overridden from, so that seems like a dead end too.

So, does anyone know a way to do this? Aside for requesting it to IntelliJ...

Fran Marzoa
  • 4,293
  • 1
  • 37
  • 53
  • I don't know about a way to generate syntax like what you mentioned but if you're just looking for a way to see the override's origin and can do without in-code references, you can try using a hotkey. Pressing Ctrl+Q in Windows (^+J in macOS) should bring up the method's documentation which says the original method and class. – Christian Ramos Mar 17 '18 at 01:10
  • Thanks Christian. I'm aware of that, but I would like to have it in the code itself so I can see it in a glance, without having to request that information with additional mouse clicks or key strokes. Cheers! – Fran Marzoa Mar 17 '18 at 01:12

0 Answers0