Skip to content

WTG3007 code fix adds extra new lines when overridden member is adjacent to a #region or #endregion #200

@andrewhongnsw

Description

@andrewhongnsw

The code fix to remove pointlessly overridden methods works as expected, except for cases where the overridden method comes immediately after, or comes immediately before a #region or #endregion directive.

In such cases, extra new lines are left in the returned document.

For example a code fix on the following snippet:

#region Form Setup
		protected override void OnShown(EventArgs e)
		{
			base.OnShown(e);
		}

		void SetControlModuleIDs()

Will lead to:

#region Form Setup



		void SetControlModuleIDs()

This leads to SA1507 errors on the lines between the #region directive and the following method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions