codemaid
codemaid copied to clipboard
Running "Cleanup Open Code" does not update File Header
Environment
- Visual Studio version: 2022 Professional
- CodeMaid version: 12.0.300
- Code language: C#
Description
I have a File Header defined in the "Update" section. It looks like this // (C) COPYRIGHT LEVI, RAY & SHOUP, INC. // ALL RIGHTS RESERVED. // CONFIDENTIAL INFORMATION.
It is being inserted when I press Ctr+M, Space but not if I select "Cleanup Open Code" or "Cleanup All Code"
Steps to recreate
- Add the File Header as describes
- Run "Cleanup Open Code"
Current behavior
It does not add the file header text.
Expected behavior
It should add the file header
Thanks for reporting the issue. I have been able to reproduce it. It looks like a threading issue, where the cleanup open/all commands are running as background tasks compared to running cleanup active document which is invoked on the UI thread.
System.Runtime.InteropServices.COMException (0x8001010E): InsertFileHeaderDocumentStart must be called on the UI thread.