代码之家  ›  专栏  ›  技术社区  ›  Arvo Bowen

VS 2017功能注释-创建新行而非段落[副本]

  •  3
  • Arvo Bowen  · 技术社区  · 6 年前

    这应该更容易。。。

    我想在代码中的XML文档中添加一个“编码”换行符

    /// <summary>
    /// Get a human-readable variant of the SQL WHERE statement of the search element. &lt;br/&gt;
    /// Rather than return SQL, this method returns a string with icon-tokens, which 
    /// could be used to represent the search in a condensed pictogram format.
    /// </summary>
    

    有趣的是,好的“ol<br/>换行符不会在Intellisense弹出窗口中创建换行符。

    我觉得这很烦人。。。

    有什么建议吗?

    0 回复  |  直到 7 年前
        1
  •  309
  •   pstrjds    6 年前

    你可以用 <para /> <para></para> 标签是将文本分组并在其之后添加空行的方法,但没有等效的方法。 <br /> 或者类似的事情。(根据 this Documenting your code

    示例(基于原始OP示例):

    /// <summary>
    /// <para>Get a human-readable variant of the SQL WHERE statement of the search element.</para>
    /// Rather than return SQL, this method returns a string with icon-tokens, which 
    /// could be used to represent the search in a condensed pictogram format.
    /// </summary>
    
        2
  •  71
  •   Sнаđошƒаӽ    7 年前

    <br/> ,它的工作:)

    /// <summary>
    /// Value: 0/1/2
    /// <para/>0 foo,
    /// <para/>1 bar,
    /// <para/>2 other
    /// </summary>
    
        3
  •  27
  •   Joel user3568717    12 年前

    添加 <para> 带有特殊字符的标记,255字符,或 invisible char .

    /// <summary>
    /// Some text
    /// <para>   </para>
    /// More text
    /// </summary>
    /// <param name="str">Some string</param>
    public void SomeMethod(string str) { }
    

    enter image description here

        4
  •  27
  •   Trenton McKinney ivirshup    5 年前

    自Visual Studio 2019起,使用 <br/> 支持用新行创建注释。

    例如:

     /// <summary>
     /// This is a comment.<br/>
     /// This is another comment <br/>
     /// This is a long comment so i want it to continue <br/> on another line.
     /// </summary>
    

    enter image description here

    注意,当我们使用 <br/> 与使用时相反的标记 <para> 标签。

        5
  •  3
  •   Travis J    10 年前

    <br></br> <br /> <para> 句子分离的程度和有一个空白行的愿望一样多。我在这里提到这一点,是因为这个问题似乎是这个性质的许多封闭问题的根源。

    我唯一能做的就是

    <para>&#160;</para>
    

    例如

    /// <summary>
    ///     <para>
    ///         "This sentence shows up when the type is hovered"
    ///     </para>
    ///     <para>&#160;</para>
    ///     <para>int PrimaryKey</para>
    ///     <para>&#160;</para>
    ///     <para>virtual Relation Relation</para>
    /// </summary>
    

    "This sentence shows up when the type is hovered"
    
    int PrimaryKey
    
    virtual Relation Relation