codemaid icon indicating copy to clipboard operation
codemaid copied to clipboard

Running "Cleanup Open Code" does not update File Header

Open FerdinandStapenhorst opened this issue 1 year ago • 1 comments

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

  1. Add the File Header as describes
  2. Run "Cleanup Open Code"

Current behavior

It does not add the file header text.

Expected behavior

It should add the file header

FerdinandStapenhorst avatar Nov 22 '23 13:11 FerdinandStapenhorst

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.

codecadwallader avatar Nov 24 '23 18:11 codecadwallader