我在 Eclipse (CDT) 中有一个注释模板,用于函数调用,如下所示:
//****************************************************************************
//
// Function: ${enclosing_method}
//
// Purpose:
//
// Parameters:
//
//****************************************************************************
我的问题是 ${enleading_method}
模板变量大多数时候不起作用,但其他时候却起作用,但我还没有弄清楚原因。我尝试过在函数内部和函数定义外部(顶部)使用注释模板,即使在同一头文件中也是如此。我更喜欢它在顶部,并且已经看到它在那个位置上工作,但我再次不知道为什么。
为了使 enclusion_method 变量自动将名称放置在注释中,需要满足哪些先决条件?
预先感谢您提供的任何见解。
最佳答案
您是not the only one使用此模板时遇到问题。
即使在 JDT (Java) 中也存在问题,从 2004 年开始!请参阅bug 76661 .
但是它并不完全可重现。
Looked into this to try and find a reproducible case. I can get it happen consistently if I add a new method to a class and then execute the template inside of the method before saving
到目前为止,还没有看到补丁。
关于eclipse - Eclipse 中的注释模板变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1874801/