简体   繁体   English

Eclipse:如何在代码中区分公共注释和私有注释?

[英]Eclipse: how to distinguish between public comments and private comments in my code?

I'm looking for a systematic way how to have in my eclipse projects' code, private comments (which I do not want other team members to see when they check out my code), as well as public comments (which I do want to share with others); 我正在寻找一种系统的方式来如何在eclipse项目的代码中包含私人注释(我不希望其他团队成员在签出我的代码时看到它们)以及公共注释(我确实希望这样做)与他人分享); a way that will allow me to only commit to svn the code with comments I want to make public? 一种方法,使我只能承诺使用要公开的注释对代码进行svn?

I use eclipse subversive. 我用Eclipse颠覆。

Create files with the same base name, but the extension .notes. 使用相同的基本名称创建文件,但扩展名为.notes。 Thus the class named Plover would be declared in Plover.hpp, defined in Plover.cpp and your private notes would be in Plover.notes. 因此,名为Plover的类将在Plover.cpp中定义的Plover.hpp中声明,而您的私人注释将在Plover.notes中声明。

You can then tell SVN not to check in your notes file using a command like: 然后,您可以使用以下命令告诉SVN不要检入Notes文件:

svn propset svn:ignore "*.notes" 

There is nothing called private comments and public comments. 没有什么叫做私人评论和公众评论。 Any thing you commit will be seen by everyone who has access to your project in svn. svn中有权访问您的项目的所有人都会看到您提交的任何内容。 The best way to have private comments will be in your notepad. 进行私人评论的最佳方法是在记事本中。

If you really want to take notes in eclipse while you are coding look at this plugin or you can search for similar other plugins. 如果您真的想在编写代码时在Eclipse中做笔记,请查看此插件,或者可以搜索类似的其他插件。

Notepad for eclipse 蚀的记事本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM