codecadwallader / codemaid

CodeMaid is an open source Visual Studio extension to cleanup and simplify our C#, C++, F#, VB, PHP, PowerShell, JSON, XAML, XML, ASP, HTML, CSS, LESS, SCSS, JavaScript and TypeScript coding.
http://www.codemaid.net
GNU Lesser General Public License v3.0
1.88k stars 353 forks source link

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

Open Moorepheus opened 1 year ago

Moorepheus commented 1 year ago

Environment

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.

codecadwallader commented 1 year ago

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?

Moorepheus commented 11 months ago

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

https://app.screencast.com/QrfrVDfAmHbqr

Moorepheus commented 11 months ago

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

codecadwallader commented 9 months ago

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?

Moorepheus commented 9 months ago

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.