codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

Code Maid Visual 2022 - Making Tabs larger than stated in application settings

Open Moorepheus opened this issue 2 years ago • 6 comments

Environment

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

Description

When CodeMaid is calling the Code Cleanup, all my tabs are getting switch from 3 to 4 characters. I have my environment set up to TAB w/ 3 spaces an insert spaces vs tabs, but no matter what I do, I am continuing to get 4 characters after CodeMaid does it clean up.

Moorepheus avatar Jan 16 '23 18:01 Moorepheus

Thanks for reporting the issue. To perform indentation, CodeMaid invokes Visual Studio's native document formatting. If you invoke Edit->Advanced->Format Document do you see the same behavior?

codecadwallader avatar Feb 12 '23 19:02 codecadwallader

Thanks for reporting the issue. To perform indentation, CodeMaid invokes Visual Studio's native document formatting. If you invoke Edit->Advanced->Format Document do you see the same behavior?

Sorry took so long to get back to you. I stopped using VS 2022 to work on another project, but I am back to using it now. I did as you asked, an no, it does not have the same behavior.

This is how I see the difference

  • go to Tools - Opotions
  • In the tree view, go to Text Editor - C# - Tabs
  • Set the tab size to 3 for both Tab and Indent size
  • set to Insert Spaces
  • create a class and then create some code
  • Cltr-S, notice how the tabs are increased to the DEFAULT of 4, but still inserts spaces. Here is a quick video of it as well

https://app.screencast.com/QrfrVDfAmHbqr

Moorepheus avatar Aug 02 '23 19:08 Moorepheus

I was wondering if you were able to reproduce this. I have a fresh build of VS and clean installed of CODEMAID for 2022. This still happens.

I the mean time, I have been playing around with all the VS editor settings to see if I can find the solution here. We have 11 developers that are moving to VS 2022, but it looks like we will have to stop using CodeMaid unless this is fixed.

Thanks

Moorepheus avatar Aug 10 '23 12:08 Moorepheus

Thanks for the video. There isn't logic inside CodeMaid that performs the indentation, so I'm not sure where that behavior is originating. If you invoke CodeMaid's cleanup directly without saving the file, does it still occur?

codecadwallader avatar Oct 28 '23 14:10 codecadwallader

Well, something is not working right in VS 2022. While CodeMaid for VS2019 works as expected, in VS2019, it does not. I can actually repoduce the issue. If you would like, I would love to set up a session where you can witness what is going on. Like I said above, code made is making a call to VS to do the clean up, but for what ever reason, it is using VS default tab size. Maybe this is a VS2022 issue, I don't know.

Moorepheus avatar Oct 30 '23 15:10 Moorepheus