C# VS Intellisense:悬停在上方显示缩进多行代码示例

C# VS Intellisense:悬停在上方显示缩进多行代码示例,c#,visual-studio,intellisense,xml-documentation,C#,Visual Studio,Intellisense,Xml Documentation,这可能吗?如果不清楚我在说什么,这里有一个详细的例子: 以我几周前编写的这个快速实用程序类为例(细节省略),以及我想分享的示例: public abstract class CommonOdinAttributesForOwnedType<TProperty, TParent> : OdinAttributeProcessor<TProperty> { //snip } //EXAMPLE IMPLEMENTATION (Recommended to be ne

这可能吗?如果不清楚我在说什么,这里有一个详细的例子:

以我几周前编写的这个快速实用程序类为例(细节省略),以及我想分享的示例:

public abstract class CommonOdinAttributesForOwnedType<TProperty, TParent> : OdinAttributeProcessor<TProperty>
{
    //snip
}

//EXAMPLE IMPLEMENTATION (Recommended to be nested inside MyBaseType):
protected class BoolAttributesInsideMyBaseType : CommonOdinAttributesForOwnedType<bool, MyBaseType>
{
    protected override List<Attribute> GetAdditionalAttributes()
    {
        return new List<Attribute>()
        {
            new ToggleLeftAttribute(), //add more desired attributes here
        };
    }
}
现在,我可以发誓,当我最初创建类时,工具提示看起来像我想要的。。。但也许我有幻觉。无论如何,在本周的重构期间(在此期间,文件被移动/重命名并通过ReSharper的清理提供),我注意到Intellisense工具提示现在看起来像热垃圾:

在每行末尾添加

只会有一点帮助:

…我还没有找到手动指定缩进的方法,

指定新行的方法。我还尝试了多种组合,包括
,以及各种嵌套块的方法,但都没有效果

那么:有没有办法(理想情况下)让Visual Studio 2019实际解析XML文档
块中的空白,或者(除非)使用其他块手动添加缩进,就像我用

手动添加新行一样?我看了又看,都找不到办法

VS Intellisense:悬停在上方显示缩进多行代码示例

恐怕你得不到你想要的。

实际上,vs xml文档不具备保持代码样式格式的能力

在下,它不能保留代码格式。您必须手动更改格式。使用一些代码更改显示的样式

有没有办法(理想情况下)让VisualStudio2019实际解析 XML文档块中的空白

换行符可以使用

但是无法缩进第一行。Html格式化方法、间距、空格等不起作用

事实上,这是一个缺陷——vs的xml文档不能缩进行并保持代码样式

到目前为止,我们只能做您所做的。


<强>除了>,如果你仍然想要这个特性,你可以<代码>建议一个特性on,团队会仔细考虑你的问题,希望他们能给你一个满意的答复。我已经按照你的建议做了。

/// <summary>
/// Gives ALL objects of type TProperty drawn within classes derived from TParent a requested list of 
/// Odin GUI attributes
/// <code>
/// //EXAMPLE IMPLEMENTATION (Recommended to be nested inside MyBaseType):
/// protected class BoolAttributesInsideMyBaseType : CommonOdinAttributesForOwnedType&lt;bool, MyBaseType&gt;
/// {
///     protected override List&lt;Attribute&gt; GetAdditionalAttributes()
///     {
///         return new List&lt;Attribute&gt;()
///         {
///             new ToggleLeftAttribute(), //add more desired attributes here
///         };
///     }
/// }
/// </code>
/// </summary>