codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

miss option multi-line-comments in “Insert blank line before“ config

Open a44281071 opened this issue 3 years ago • 3 comments

Environment

  • Visual Studio version: 2022
  • CodeMaid version: 12.0
  • Code language: C#

Description

Is an option missing in “Insert blank line before“ config? option name: multi-line-comments

Steps to recreate

  1. use ctrl+M,/ open setting window.
  2. change to "Clean - Insert" tab.
  3. Insert blank line before
  4. missing option: multi-line-comments

Current behavior

        public bool HasItems { get; }
        /// <summary>
        /// multiline comments
        /// </summary>
        internal async Task<DateTime?> GetCurrentPlayTimeAsync()
        {
        }
        /// <summary>
        /// multiline comments
        /// </summary>
        internal async Task<DateTime?> GetCurrentPlayTimeAsync()
        {

Expected behavior

        public bool HasItems { get; }

        /// <summary>
        /// multiline comments
        /// </summary>
        internal async Task<DateTime?> GetCurrentPlayTimeAsync()
        {
        }

        /// <summary>
        /// multiline comments
        /// </summary>
        internal async Task<DateTime?> GetCurrentPlayTimeAsync()
        {

a44281071 avatar Mar 02 '22 03:03 a44281071

Thanks for opening the issue. In that example the multi-line comments are attached to the method, and if the option to insert blank line padding before methods is enabled it should(tm) follow the expected behavior. It would also kick in if the option to insert blank line padding after properties is enabled. Does that help?

codecadwallader avatar Mar 11 '22 13:03 codecadwallader

Do not append new line:

public int Id {get; set;}
public string Name {get; set;}

Append new line:

public int Id {get; set;}

/// <summary>
/// multiline comments
/// </summary>
public string Name {get; set;}

a44281071 avatar Mar 14 '22 03:03 a44281071

/// <summary>
/// multiline comments
/// </summary>
public string Name {get; set;}

Is considered a multi-line property and will be affected by the option "Insert blank line padding before multi-line properties".

The original example was a method.

codecadwallader avatar Apr 12 '22 12:04 codecadwallader