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 352 forks source link

Code Maid Visual 2022 - Making Tabs larger/Smaller than stated in Visual Studios native document formatting setting #1021

Closed Moorepheus closed 7 months ago

Moorepheus commented 9 months ago

Environment

Description

When CodeMaid is calling the Code Cleanup, all the tabs/indents are not following the Visual Studio's native document formatting settings. I have tried this on clean install of both VS and CodeMaid.

Current behavior

CodeMaid is usin the Visula Studio's default document formatting settings vs using what the user changed those settings to.

Expected behavior

CodeMaid should use the upated settings instead of the default Visual Studio settings.

Moorepheus commented 9 months ago

I re-opened this, but I was able to see that this might be an issue with regard of this tool and re-sharper. I am going to close this ticket.

Moorepheus commented 9 months ago

Okay, I thought Resharper was causing this issue, but it is not, I have uninstalled resharper, so I only have CodeMaid extension installed and I can repo this issue.

Attached is a video showing how to repo it.

https://app.screencast.com/CzCS04QmN0tcI

codecadwallader commented 7 months ago

Thanks for reporting the issue and sharing a video. I have not been able to reproduce it yet. CodeMaid does not directly change the indentation of the file, but instead invokes Visual Studio's native formatting.

https://github.com/codecadwallader/codemaid/blob/dev/CodeMaidShared/Logic/Cleaning/CodeCleanupManager.cs#L552

This is the same command that you were demonstrating in the video, but clearly there was something different happening between the two commands.

Can you please provide an export of your CodeMaid settings and that minimal solution that was exhibiting the issue?

Moorepheus commented 7 months ago

Steve Thanks for getting back to me. I have just got a new computer, clean build, I will build a sample solution, send you our settings file for CodeMaid and show you screenshots of VS 2022 settings for tabs/etc. I will get to that some time today.

Thanks again,

Moorepheus commented 7 months ago

Steve Thanks for getting back to me. I have just got a new computer, clean build, I will build a sample solution, send you our settings file for CodeMaid and show you screenshots of VS 2022 settings for tabs/etc. I will get to that some time today.

Thanks again,

So, brand new clean build, this is not happening, the issue above is not happening. Very weird. We have many machines here, that this is happening on. I have reset the VS environment to default and still the same issue on these machines. I will try to narrow down the difference between the machines that are having this issue and this new clean build machine.

Moorepheus commented 7 months ago

It seems it was a VISUAL STUDIO version issue or an environment issue. After Upgrading my VS 2022 to the latest update, the problem is gone. really weird, anyway, thanks for looking into this,

Moorepheus commented 7 months ago

Closing ticket, as I believe this was an VS 2022 issue, either with the version number we were using or the environment, as after upgrading to the latest release, the problem went away.