format: Re-implement support for formatting with code actions that contain commands (#28392)

Closes #27692
Closes #27935

Release Notes:

- Fixed a regression where code-actions used when formatting on save
were rejected if they contained commands
This commit is contained in:
Ben Kunkle 2025-04-08 21:53:54 -04:00 committed by GitHub
parent 301fc7cd7b
commit e66a24edcf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 421 additions and 201 deletions

View file

@ -2015,11 +2015,16 @@ impl Buffer {
}
/// Manually remove a transaction from the buffer's undo history
pub fn forget_transaction(&mut self, transaction_id: TransactionId) {
self.text.forget_transaction(transaction_id);
pub fn forget_transaction(&mut self, transaction_id: TransactionId) -> Option<Transaction> {
self.text.forget_transaction(transaction_id)
}
/// Manually merge two adjacent transactions in the buffer's undo history.
/// Retrieve a transaction from the buffer's undo history
pub fn get_transaction(&self, transaction_id: TransactionId) -> Option<&Transaction> {
self.text.get_transaction(transaction_id)
}
/// Manually merge two transactions in the buffer's undo history.
pub fn merge_transactions(&mut self, transaction: TransactionId, destination: TransactionId) {
self.text.merge_transactions(transaction, destination);
}