Skip to content

Editor - fix paste preference filter matching all providers#304044

Merged
rzhao271 merged 1 commit intomicrosoft:mainfrom
xingsy97:wt/fix-paste-preference-filter
Mar 23, 2026
Merged

Editor - fix paste preference filter matching all providers#304044
rzhao271 merged 1 commit intomicrosoft:mainfrom
xingsy97:wt/fix-paste-preference-filter

Conversation

@xingsy97
Copy link
Copy Markdown
Member

Fix paste preference provider filter that always matches every provider.

Problem

In providerMatchesPreference(), the 'preferences' branch iterates preference.preferences in both its outer and inner .some() loops. Since HierarchicalKind.contains() is reflexive, this always returns true when preferences is non-empty -- every provider passes the filter regardless of what kinds it provides.

The 'only' branch correctly iterates provider.providedPasteEditKinds in the outer loop.

Fix

Change the outer .some() to iterate provider.providedPasteEditKinds, matching the 'only' branch pattern.

Copilot AI review requested due to automatic review settings March 23, 2026 11:14
@vs-code-engineering vs-code-engineering bot added this to the 1.114.0 milestone Mar 23, 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

Fixes paste preference filtering in the editor’s drop/paste controller so that the 'preferences' filter actually matches against a provider’s declared paste kinds instead of always matching all providers.

Changes:

  • Corrected providerMatchesPreference() for 'preferences' to iterate provider.providedPasteEditKinds in the outer loop (mirrors the 'only' branch behavior).

@xingsy97 xingsy97 marked this pull request as ready for review March 23, 2026 11:17
@rzhao271 rzhao271 enabled auto-merge (squash) March 23, 2026 18:29
@rzhao271 rzhao271 merged commit 87134ba into microsoft:main Mar 23, 2026
21 of 22 checks passed
@xingsy97 xingsy97 deleted the wt/fix-paste-preference-filter branch March 31, 2026 06:19
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.

4 participants