Open
Description
- Use Extract to function or Create Declaration/Definition on a source file that has no header file.
- Notice the created header has a
#pragma once
added. - Do an undo to undo the edits. Note: Undo of the file creation seems to not work (I get
Unable to create file 'test.h' that already exists when overwrite flag is not set
, see Undo of header file creation from Extract to function or Create Declaration / Definition gives an error #11462). - Use another Extract to function or Create Declaration/Definition command.
Bug: The 2nd command doesn't add the #pragma once
that the 1st command had added. It seems like the empty file and non-existent file cases should behave the same. Ideally, it would check if the existing file already has a #pragma once
or an include guard at the top, and if not, add the #pragma once
. This also repros with VS.