'Vscode randomly remove code when using format on save

I am using format on save feature in vscode for a while. And sometimes when i save, which invoking format on save, vscode randomly remove function and other sentence. I dont have any formatting extension. Here is the image. I can just undo but im really afraid its not restore all the code.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source