Sublime Forum

Run Save All on LSP: Rename

#1

I’m still discovering what is possible with Sublime. Is it possible to set it up to trigger Save All after running LSP commands?

1 Like

#2

LSP commands are async. So chain command won’t work. Thus, I think it can only be done in LSP. Plus, by “Save All”, I think you mean only those files affected by previous LSP command rather than “literally all opened files”. (adding a new keybinding to save_all is easy but yes, it takes you another key to press)

0 Likes

#3

Thanks, I actually do mean literal “Save All”, since I have save_on_focus_lost enabled, I want all files that are updated and then lose focus to immediately save.

The problem with LSP: Rename (and similar actions) is that they open and edit multiple files, but it never counts as any of those files losing focus, so only the last file opened is auto-saved when switching focus to another app.

I would very much like refactor/rename actions that touch multiple files to automatically save the edit, so that they can be immediately tested by file watch rebuilds instead of having to go and manually save them one by one, or binding a save all hotkey.

This is me trying to migrate from a JetBrains-world, where manually saving has not been a thing for years :slight_smile:

1 Like