Repository navigation
Preview cljr-inline-symbol too - #596
Merged
Merged
Conversation
Route cljr-inline-symbol through cljr--run-previewable-refactoring, like rename and change-signature: gather the edits, show a diff, and write only on confirm. Its two save-buffer calls (after the occurrence loop and in cljr--delete-definition) become cljr--save-buffer so they defer during a preview session, and the success message is guarded on the edits actually being applied. Validated live against a real refactor-nrepl connection: inlining a def (both usages replaced, definition removed) previewed and applied on confirm, left untouched on decline.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Small follow-up to the refactoring preview:
cljr-inline-symbolnow goes through the same preview/confirm/undo path ascljr-rename-symbolandcljr-change-function-signature. Its edits are gathered and shown as a diff first, and nothing is written until you confirm.Mechanically it's the established pattern - wrap the body in
cljr--run-previewable-refactoringand turn its twosave-buffercalls intocljr--save-bufferso they defer during a session. No new apply/abort logic (that all lives in the shared driver from the previous PR).Validated live against a real refactor-nrepl connection: inlining a def previewed correctly, applied both usages + removed the definition on confirm, and left the file untouched on decline.