close
Skip to content

Fix TextmateSnippet clone method to correctly assign _children#295555

Merged
jrieken merged 3 commits into
microsoft:mainfrom
AndreasArvidsson:patch-1
Apr 8, 2026
Merged

Fix TextmateSnippet clone method to correctly assign _children#295555
jrieken merged 3 commits into
microsoft:mainfrom
AndreasArvidsson:patch-1

Conversation

@AndreasArvidsson
Copy link
Copy Markdown
Contributor

Clone method incorrectly mutated the source object instead of assigning the cloned children to the returning object.

Clone function incorrectly mutated the source object instead of assigning the clone children to the returning object.
Copilot AI review requested due to automatic review settings February 16, 2026 10:29
@vs-code-engineering
Copy link
Copy Markdown
Contributor

📬 CODENOTIFY

The following users are being notified based on files changed in this PR:

@jrieken

Matched files:

  • src/vs/editor/contrib/snippet/browser/snippetParser.ts

@AndreasArvidsson AndreasArvidsson changed the title Fix clone method to correctly assign _children Fix TextmateSnippet clone method to correctly assign _children Feb 16, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a critical bug in the TextmateSnippet.clone() method where the cloned children were incorrectly being assigned to the source object (this._children) instead of the newly created instance (ret._children). This bug would cause the original snippet to be mutated during cloning, leading to incorrect behavior.

Changes:

  • Fixed TextmateSnippet.clone() to correctly assign cloned children to the new instance instead of mutating the source object

@jrieken jrieken added this to the 1.116.0 milestone Apr 7, 2026
@jrieken jrieken enabled auto-merge April 7, 2026 10:12
@jrieken jrieken merged commit 1fee4e6 into microsoft:main Apr 8, 2026
22 of 23 checks passed
@vs-code-engineering vs-code-engineering Bot locked and limited conversation to collaborators May 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants