簡體   English   中英

我為什么看不到我的 <example> s和<code>s from Intellisense? using C# and Visual Studio 2017-2019</code> <code>s from Intellisense? using C# and Visual Studio 2017-2019</code>

[英]Why can't I see my <example>s and <code>s from Intellisense? using C# and Visual Studio 2017-2019

我目前正在使用Visual Studio 2019編寫WPF / C#應用程序。 編寫新方法后,我決定添加一些示例以更好地使用。 但是我的示例不會在Intellisense彈出窗口中顯示。

我嘗試了以下代碼:

        /// <summary>...</summary>
        /// <param name="path">...</param>
        /// <param name="action">...</param>
        /// <example>
        /// Use this method like this:
        /// <code>
        /// MyMethod("C:\\someFile.txt", s => File.Copy(s, "C:\\someFile (copy).txt"));
        /// </code>
        /// </example>
        public static void MyMethod(string path, Action<string> action)
        {
            // some code ...
        }

我希望我的示例出現在從另一個文件調用時彈出的Intellisense彈出窗口中。 發生的只是沒有我的示例的摘要顯示。

這很簡單-因為它可以正常工作。 從來沒有按您預期的那樣工作。

您的XML注釋很好,但是Visual Studio僅顯示<summary>部分(類\\方法或屬性的簡短描述),以快速熟悉您將要使用的類\\方法或屬性。

XML注釋可能非常大,幾乎沒有任何限制。 想象一下,應該以多大尺寸顯示給您一些大意見?

因此,如果您或其他開發人員在<summary>中使用Visual Studio和工具提示不能為您提供足夠的信息-只需簡單地轉到F12並讀取完整注釋,或者您可以使用ALT + F12在當前部分中正確顯示聲明

不知道,但我認為可以根據需要顯示一些工具提示

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM