codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

"cleanup on save" stop working

Open sm-g opened this issue 6 years ago • 13 comments

Since VS 15.6.1 CodeMaid 10.4 Widnows 7

after update VS - saving file does not trigger CodeMaids's Cleanup action. It works when I manually hit "Cleanup active document"

sm-g avatar Apr 04 '18 08:04 sm-g

Thanks for reporting the issue, I am unable to reproduce it. A couple things to check:

  1. Have you double checked that your settings are still set so that automatic cleanup on save is enabled? In particular if you load a solution that has solution-specific settings for CodeMaid that turns it off, that will override your user settings.
  2. What version of the .NET Framework do you have installed? Some Windows 7 users have had issues related to not having .NET Framework v4.6 or higher.

codecadwallader avatar Apr 07 '18 11:04 codecadwallader

  1. I use solution specific settings: devenv_2018-04-09_15-25-19

  2. I use 4.6.1 for development and also have 4.7.1

I found that issue gone after I switch menu item: devenv_2018-04-09_15-27-30

Should it overwrite solution-specific settings?

sm-g avatar Apr 09 '18 12:04 sm-g

When you toggle the menu item, it should toggle the setting at the same level as if you opened the dialog and selected the toggle. So yes if you have solution-specific settings active it will toggle at the solution-specific level. If you close the solution it will toggle at the user level.

codecadwallader avatar Apr 14 '18 12:04 codecadwallader

I have found this bug too. I have Automatic Cleanup on Save activated and it does not work.

EDIT: After toggling the option off and on, it suddenly started working. Appears to be a bug with the UI and not with the feature itself.

eluchsinger avatar Aug 02 '18 06:08 eluchsinger

Interesting, can you consistently reproduce the issue?

codecadwallader avatar Aug 04 '18 18:08 codecadwallader

I have had it multiple times when I open an existing solution that didn't contain that CodeMaid settings file.

eluchsinger avatar Aug 05 '18 11:08 eluchsinger

If you export your user settings, can you confirm that automatic cleanup on file save is present?

codecadwallader avatar Aug 05 '18 19:08 codecadwallader

Hello. I have the same issue here. I'm running VS Pro 2019 (16.11.9). CodeMaid version is V 12. I've tried uninstalling CodeMaid, updating Visual Studio, resetting default CM settings and no luck. If I manually navigate to the format setting or use the hotkey (CTRL + M, Space), it works. It only appears to not work when saving.

Here are my export settings:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
    <configSections>
        <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
            <section name="SteveCadwallader.CodeMaid.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
        </sectionGroup>
    </configSections>
    <userSettings>
        <SteveCadwallader.CodeMaid.Properties.Settings>
            <setting name="Feature_SettingCleanupOnSave" serializeAs="String">
                <value>True</value>
            </setting>
        </SteveCadwallader.CodeMaid.Properties.Settings>
    </userSettings>
</configuration>```

jpeterson88 avatar Jan 17 '22 16:01 jpeterson88

If you turn on diagnostics mode (CodeMaid->Options->Diagnostics mode) does that provide any helpful information in the Output window?

codecadwallader avatar Feb 06 '22 18:02 codecadwallader

@codecadwallader I actually uninstalled and then pulled the extension off of the marketplace as opposed to using the extension manager in VS 2019 and it fixed my issue.

jpeterson88 avatar Feb 06 '22 19:02 jpeterson88

I still have the same problem. On several machines. Reinstalling the extension does not help and Automatic Cleanup on Save is activated.

This feature of automatic formatting is unfortunately one of the most important for me while working. I hope there will be a fix soon. I'm using the current Visual Studio 2022 version 17.7.4. But maybe it came from the VS update https://github.com/codecadwallader/codemaid/issues/1014

illusion-walk avatar Sep 14 '23 07:09 illusion-walk

If you turn on diagnostics mode (CodeMaid->Options->Diagnostics mode) does that provide any helpful information in the Output window?

I have no output when saving a file if I enable the diagnostics mode. Even when I manually click Cleanup Active Document (which by the way works normally).

illusion-walk avatar Sep 14 '23 08:09 illusion-walk

@codecadwallader I had the same issue, but not anymore. I described what I did in detail in my reply to #1014, here

Diagnostics mode didn't issue any meaningful output to the very end, when saving the current document. It did, though, output all debug info on manual call to Cleanup Active Document, in constrast with the above comment.

paro77 avatar Sep 14 '23 18:09 paro77