如何让Intellisense在.cpp文件中显示.h文件的注释?

时间:2017-09-15 12:02:38

标签: c++ visual-studio-2015 intellisense

为简单起见,这里是代码

foo.h中:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<table>
  <tr>
    <td><input class="checkbox-parent" type="checkbox"></td>
    <td><input class="checkbox-child disable" disabled="" type="checkbox"></td>
  </tr>
  <tr>
    <td><input class="checkbox-parent" type="checkbox"></td>
    <td><input class="checkbox-child disable" disabled="" type="checkbox"></td>
  </tr>
</table>

Foo.cpp中:

class Foo
{
    // bar 1 described
    void bar1();
    void bar2();
}

所以,当我将鼠标悬停在文件foo.cpp中bar2()内的bar1()上时,我没有从foo.h获得带有bar1描述的工具提示。如果我在任何其他文件中这样做(比如,其他一些类调用foo&#39; s吧1)那么我就明白了,但是如果我从foo.cpp文件中执行它,我就不会这样做。

当我将鼠标悬停在foo.cpp上时,工具提示说bar1()来自foo.cpp并且没有显示工具提示,而如果我将鼠标悬停在任何其他文件上,则表示bar1()来自foo.h并且显示工具提示。

除了将.h文件中的函数描述复制到.cpp文件中之外,还有一个修复方法,并且每当它被更改时总是将其复制回来(就像我在.cpp中更改它一样,我必须手动复制它到.h)

0 个答案:

没有答案