简体   繁体   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

I am currently using Visual Studio 2019 to write a WPF/C# application. 我目前正在使用Visual Studio 2019编写WPF / C#应用程序。 After writing a new method I decided to add some examples for better usage. 编写新方法后,我决定添加一些示例以更好地使用。 But my example won't show up in the Intellisense popup. 但是我的示例不会在Intellisense弹出窗口中显示。

I've tried the following code: 我尝试了以下代码:

        /// <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 ...
        }

I expected my example to show up on the Intellisense popup that pops up when calling from another file. 我希望我的示例出现在从另一个文件调用时弹出的Intellisense弹出窗口中。 What happens is just the summary shows up without my examples.. 发生的只是没有我的示例的摘要显示。

It is simple - because it works so. 这很简单-因为它可以正常工作。 And never worked as you expected. 从来没有按您预期的那样工作。

Your XML comments is fine but Visual Studio shows only <summary> section (Short discription of class \\ method or property) for quick familiarize with class \\ method or property you are going to use. 您的XML注释很好,但是Visual Studio仅显示<summary>部分(类\\方法或属性的简短描述),以快速熟悉您将要使用的类\\方法或属性。

XML comments can be very big, litterally nothing limits it size. XML注释可能非常大,几乎没有任何限制。 Imagine what size shoud be tooltip to show you big comments? 想象一下,应该以多大尺寸显示给您一些大意见?

So if you or other developer use Visual Studio and tooltip with <summary> does not give you enough information - just simply go to decloration with F12 and read full comment OR you can show declaration right in current section with ALT + F12 因此,如果您或其他开发人员在<summary>中使用Visual Studio和工具提示不能为您提供足够的信息-只需简单地转到F12并读取完整注释,或者您可以使用ALT + F12在当前部分中正确显示声明

Not shure but i think it can be some extensions for showing tooltip as you want 不知道,但我认为可以根据需要显示一些工具提示

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

相关问题 使用 Visual Studio Code 在 C# 中使用/导入可用的 Intellisense - Intellisense for available 'using/import's in C# with Visual Studio Code Visual Studio 2017的“实现接口”命令可以生成C#5代码吗? - Can Visual Studio 2017's “Implement Interface” command generate C# 5 code? 我能知道为什么 Visual Studio 2017 存档与 Visual Studio 2019 不同吗 - Can i know why Visual Studio 2017 archive is different from Visual Studio 2019 我无法使用 Visual Studio 2019 在 C# 中转换为 double - I can't convert to double in C# using visual studio 2019 我在代码中看不到 WinForms (C# Visual Studio WinForms) - I can't see WinForms in code (C# Visual Studio WinForms) 为什么Visual Studio的intellisense不能用于派生类? - Why doesn't Visual Studio's intellisense work for derived classes? 可以先给Visual Studio的C#intellisense提示显示某个方法过载吗? - Can Visual Studio's C# intellisense be given a hint to display a certain method overload first? MS Visual Studio C#-有人可以向我解释为什么我的代码不起作用以及如何使它起作用吗? - MS Visual Studio C# - Can someone explain to me why my code isn't working and how I can get it to work? Visual Studio Code C# Intellisense 不工作 - Visual Studio Code C# Intellisense Not Working Visual Studio Intellisense,c#,没有背后的代码 - Visual Studio Intellisense, c#, no code behind
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM