Search code examples
javaintellij-idealive-templates

IntelliJ Idea live template annotated variable location


I am following an article about live templates and noticed:

annotated("annotation qname")   

Creates a symbol of type with an annotation that resides at the specified location.

How do I specify location? I would like it to find occurences within file only but it searches outside too.


Solution

  • You don't. The function always searches for annotated methods in the entire project.

    The only way to change this would be to copy the source code of the macro into your own plugin and to modify its logic as you see fit.