Ensure we dispose ITextEdits in case we fail to apply them - #85884
Open
jasonmalinowski wants to merge 1 commit into
Open
jasonmalinowski wants to merge 1 commit into
jasonmalinowski wants to merge 1 commit into
Conversation
|
Azure Pipelines: Successfully started running 2 pipeline(s). There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused lifecycle cleanup follows established patterns without changing behavior or APIs.
Review effort: Balanced
Findings: None
What changed in this PR
Adds deterministic disposal for ITextEdit instances, ensuring failed edits release resources while preserving existing behavior.
Changes:
- Wraps product-code text edits in
using. - Applies the same lifecycle pattern to affected tests.
| File | Description |
|---|---|
DefaultLSPDocumentTest.cs |
Disposes test edits. |
DefaultLSPDocumentSynchronizerTest.cs |
Disposes notification edit. |
SymbolCompletionProviderTests_NoInteractive.cs |
Disposes test edit. |
StringCopyPasteCommandHandler.cs |
Disposes paste edits. |
KnownSourcePasteProcessor.cs |
Disposes cloned-buffer edit. |
RawStringLiteralCommandHandler_TypeChar.cs |
Disposes quote edit. |
RawStringLiteralCommandHandler_Return.cs |
Disposes return-key edit. |
ConvertNamespaceCommandHandler.cs |
Disposes namespace edit. |
CompleteStatementCommandHandler.cs |
Disposes completion edit. |
RoslynSpellCheckFixerProvider.cs |
Disposes spell-check edit. |
davidwengier
approved these changes
Oct 2, 2026
This branch has not been deployed
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.
This is just a general cleanup I noticed. The codepaths are unlikely to result in exceptions, but this is good practice nonetheless.