IntelliJ Idea 实时模板注释变量位置

IntelliJ Idea live template annotated variable location

我正在关注 an article 实时模板并注意到:

annotated("annotation qname")   

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

如何指定位置?我希望它只在文件内查找,但它也在外部搜索。

你不知道。该函数始终在整个项目中搜索带注释的方法。

改变这一点的唯一方法是将 the source code of the macro 复制到您自己的插件中并根据需要修改其逻辑。