Skip to content

Codemaid Cleanup causing indentation changes #958

Closed

Description

@Axemagus

Environment

  • Visual Studio version: 2022 Community (17.4.1)
  • CodeMaid version: 12.0
  • Code language: C#

Description

Codemaid Cleanup seems to cause indentation changes

Steps to recreate

  1. Configure VS to use 2 spaces, no tabs, and disable adaptive formatting
  2. Configure Codemaid using attached config
  3. Create some sort of C# based project and open a .cs file
  4. Trigger VS's native Format Document (indention should be 2 spaces)
  5. Trigger Codemaid's Cleanup Active Document (indentation is now 4 spaces)

Current behavior

I have VS set to use a tab size of 2 spaces, with Adaptive Formatting disabled. If I run Visual Studio's native Format Document, the spacing is maintained. However if I use Codemaid's Cleanup Active Document, the indentation is changed to 4 spaces. This happens regardless of whether I use the menu entries or shortcut keys.

This occurs whether the Cleaning -> Visual Studio -> Run format document is enabled or disabled

This seems limited to .cs files, at least for me. I tried .cshtml, .html, .xml and .js files which work as expected.

Expected behavior

Codemaid's cleanup process should respect Visual studio's configured spacing
CodeMaid.config.txt

Activity

  1. Axemagus commented on Nov 30, 2022

    @Axemagus
    Author

    It appears this was an issue with Visual Studio instead of Codemaid. Updating to 17.4.2 resolved it. I suspect it might be related to dotnet/roslyn#65382 and dotnet/roslyn#65360 which were resolved in this release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions