5

以前は、ヘッダー ファイルに次のスタイルで簡単なコメントを書き込んでいました。

// Returns a new string in which all occurrences of a specified string in the
// current instance are replaced with another specified string.
// - strSubject: The string to perform the replacement on.
// - strOldValue: The string to be replaced.
// - strNewValue: The string to replace all occurrences of strOldValue.
static RUNTIME_API String::type Replace
    (_In_       String::type  strSubject,
     _In_ const String::type& strOldValue,
     _In_ const String::type& strNewValue);

Visual Assist が次のコメントを正確に表示するようにします。

インテリセンス

現在、Doxygen を使用してプロジェクトのドキュメントを作成することを考えていますが、ツールチップに正しく表示され、Doxygen で解析できるドキュメント スタイルを見つけるのに苦労しています。最初に、ヘッダー コメントのみが表示されるように、*.cpp ファイルに Doxygen スタイルのコメントを含めることを考えていました。したがって、ソースファイルには次のようなコメントがあります

/*!
 * Returns a new string in which all occurrences of a specified string in the
 * current instance are replaced with another specified string.
 *
 * \param   strSubject  The string to perform the replacement on.
 * \param   strOldValue The string to be replaced.
 * \param   strNewValue The string to replace all occurrences of strOldValue.
 * 
 * \return  A string that is equivalent to the current string except that all
 *          instances of strOldValue are replaced with strNewValue. If
 *          strOldValue is not found in the current instance, the method returns
 *          the current instance unchanged.
 */
String::type String::Replace
    (_In_       String::type  strSubject,
     _In_ const String::type& strOldValue,
     _In_ const String::type& strNewValue) { /* ... */ }

驚いたことに、この機能をホバリングするとき、またはビジュアルアシスト「IntelliSense」を取得するときに、2 つの異なる出力が得られます。Replace利回りのホバリング

ホバー ツールチップ

言及されたIntelliSenseが得られる間

ここに画像の説明を入力

ただし、Doxygen スタイルのコメントをヘッダーに移動すると、奇妙な結果になります

ここに画像の説明を入力

Qt スタイルの doxygen コメントを使用して、IntelliSense に適切なツールチップ (どちらであっても) を表示させ、呼び出し方に基づいて別のツールチップを表示しないようにする方法について提案があるかどうかを知りたいです。 これを統一する方法が必要です。(代わりに、いつものように作業して、doxygen コメントのみで構成される個別のドキュメンタリー ヘッダーを作成する必要があります。この方法では、問題は発生しませんが、冗長なデータが含まれます)

4

1 に答える 1

0

私が見る唯一の単純な(しかし醜い方法)は、いくつかのプリプロセッサディレクティブを追加して、Visual Studioがそれを無視するようにすることです

#if 0
/*! your comment
*/
#endif

#endif の後に何かを追加すると、必要なものを削除せずに簡単に調査して置き換えることができるようになります。少なくとも VS2013 では、 #if 0 ブロックはかなり無視されます。これにより、それらを同じファイルに残すことができるので、苦痛が軽減されます。

于 2014-06-18T10:27:53.010 に答える