Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: auto-save files affected by will_rename_files #218

Merged
merged 6 commits into from
Dec 23, 2023

Conversation

jtubbenhauer
Copy link
Contributor

When moving or renaming files, my expectation was for all files referencing the changed file to be updated and written in the background. The current implementation seems to open all affected files in buffers, though each buffer needs to be manually written for the job to feel 'complete'.

This proposed change writes all affected buffers after apply_workspace_edit has executed. It then deletes all buffers that didn't exist prior to the move/rename action.

Copy link
Owner

@stevearc stevearc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally prefer being able to visually confirm the updated files before saving, but this would be a great optional addition! What do you think of adding a config option:

-- Set to true to autosave buffers that are updated with LSP willRenameFiles
-- Set to "unmodified" to only save unmodified buffers
lsp_rename_autosave = false

@jtubbenhauer
Copy link
Contributor Author

I personally prefer being able to visually confirm the updated files before saving, but this would be a great optional addition! What do you think of adding a config option:

-- Set to true to autosave buffers that are updated with LSP willRenameFiles
-- Set to "unmodified" to only save unmodified buffers
lsp_rename_autosave = false

That sounds like a good solution. Have been flat out recently but will fix this up ASAP.

@stevearc stevearc merged commit 48d8ea8 into stevearc:master Dec 23, 2023
7 checks passed
@stevearc
Copy link
Owner

Thanks for the PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants