Auto Format inappropriately deletes sketch content when "Auto save" is off #543
Labels
conclusion: resolved
Issue was resolved
topic: code
Related to content of the project itself
topic: language server
Related to the Arduino Language Server
type: imperfection
Perceived defect in any part of project
Describe the bug
🐛 Tools > Auto Format sometimes deletes arbitrary content of the sketch when the "Auto save" preference is turned off.
To Reproduce
Steps to reproduce the behavior:
setup
function:🐛 Some of the sketch may have been deleted. leaving it looking like this:
Expected behavior
Auto format only makes the changes dictated by the ClangFormat configuration.
Desktop
Date: 2021-10-07T07:55:54.325Z
CLI Version: 0.19.1 alpha [718bbbf2]
Additional context
If you make any significant number of attempts to reproduce the issue, you will likely also encounter the intermittent problem of the formatter ceasing to work altogether (perhaps #396). Once you open a new window the formatter should start working again.
I have never been able to reproduce the issue with the "Auto save" preference enabled.
This may be a duplicate of #45 but I have not managed to reproduce that specific deletion and it doesn't mention a dependency on the "Auto save" configuration.
Originally reported by @UKHeliBob at https://forum.arduino.cc/t/auto-format-settings/698381/14
The text was updated successfully, but these errors were encountered: