Closed pruizFocusrite closed 1 month ago
@pruizFocusrite the extension doesn’t actually do anything to refresh editors. Reason for this, is "run on save" is not necessarily focused on formatting and doesn't really have a way to know if / when a file should be refreshed. The fact that it refreshes in some cases would suggest some other formatter may be running that does refresh the editor in certain cases.
e.g. These vscode docs seem to indicate that clang-format
on save is supported by the C/C++ vscode extension.
https://code.visualstudio.com/docs/cpp/cpp-ide#_code-formatting .
I would expect extensions like this would refresh the editor as part of format on save functionality. You may want to make sure you don't have more than 1 extension attempting to format the file.
I use VSCode v1.89.1 and RunOnSave v0.2.0, with this minimal
.vscode/settings.json
:I have the following file tree in VSCode:
Saving the top-level
foo.cpp
formats the file and, crucially, refreshes the open editor in thte GUI (as expected).Saving any of the
.cpp
files in the sub-directories also formats the file but does not refresh the display. (Trying to save again brings up the dirty file conflict resolution popup). Bringing another file forefront in the GUI, and then the problematic file back again does refresh it from disk.As a workaround, I also tried
"cmd": "clang-format -i ${file}; code -r ${file}"
but that made no difference.