tuncb / delphi-uses-formatter

VS code extension to format uses sections of Pascal/Delphi code
Apache License 2.0
1 stars 2 forks source link

Only reformat on save #41

Open erikvalkering opened 12 months ago

erikvalkering commented 12 months ago

Often, when I add a unit to the uses section, I don't immediately know the full name of the unit. Therefore, the auto-save timeout kicks in and saves the file. Additionally, it will reformat the uses section. However, because I was still in the middle of adding the unit, the uses section has become invalid. As a result, the reformatting will often break because of that.

Instead of automatically reformatting the uses section on auto-save, I propose to trigger this action on a more explicit user action, like for example reformat, which is usually triggered by an explicit save using ctrl+s.

tuncb commented 11 months ago

Maybe the extension can be registered as a formatter for the "objectpascal" language. That might handle ctrl+s naturally.