Eclipse 中的注释模板变量

发布于 2024-08-13 14:27:46 字数 549 浏览 1 评论 0原文

我在 Eclipse (CDT) 中有一个用于函数调用的注释模板,如下所示:

//****************************************************************************
//
// Function: ${enclosing_method}
//
// Purpose:  
//
// Parameters:
//
//****************************************************************************

我的问题是 ${enleading_method} 模板变量在大多数情况下不起作用,但在其他时候却不起作用确实如此,但我还没有弄清楚为什么。我尝试过在函数内部和函数定义外部(顶部)使用注释模板,即使在同一头文件中也是如此。我更喜欢它在顶部,并且已经看到它在那个位置上工作,但我再次不知道为什么。

为了使 enclusion_method 变量自动将名称放置在注释中,需要满足哪些先决条件?

预先感谢您提供的任何见解。

I have a comment template in Eclipse (CDT) that I use for function calls which looks like:

//****************************************************************************
//
// Function: ${enclosing_method}
//
// Purpose:  
//
// Parameters:
//
//****************************************************************************

My problem is that the ${enclosing_method} template variable doesn't work MOST of the time, but other times it does and I have yet to figure out why. I've tried using the comment template inside of the function and outside (on top of) the function definition even within the same header file. I prefer it to be on top and have seen it work in that position but again I don't know why.

What prerequisites need to be met in order for the enclosing_method variable to place the name within the comment automagically?

Thanks in advance for any insight you can provide.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

心碎的声音 2024-08-20 14:27:46

不是唯一遇到此问题的人模板。
即使在 JDT (Java) 中也存在问题,从 2004 年开始!请参阅错误 76661

然而,它并不完全可重现。

对此进行了调查,试图找到一个可重现的案例。如果我向类添加一个新方法,然后在保存之前执行该方法内部的模板,我就可以一致地实现这种情况

。到目前为止,还没有看到补丁。

You are not the only one experiencing issues with this template.
Even in JDT (Java) there is a problem, since 2004! See bug 76661.

It is however not entirely reproducible.

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

So far, no patch in sight.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文