Skip to content

Fix operator precedence in Object Explorer context menu when conditions#21505

Closed
Copilot wants to merge 2 commits into
dev/benjin/contextMenufrom
copilot/sub-pr-21502-again
Closed

Fix operator precedence in Object Explorer context menu when conditions#21505
Copilot wants to merge 2 commits into
dev/benjin/contextMenufrom
copilot/sub-pr-21502-again

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 6, 2026

Description

Three OE context menu when conditions had a &&/|| precedence bug causing view == objectExplorer to only guard the type regex, not the subType regex — so commands appeared outside the Object Explorer whenever subType matched.

Before (broken):

"when": "view == objectExplorer && viewItem =~ /\\btype=(Database)\\b/ || viewItem =~ /\\bsubType=(Database|DockerContainerDatabase)\\b/"

Parsed as (view == objectExplorer && type check) || (subType check) — subType branch has no view guard.

After (fixed):

"when": "view == objectExplorer && (viewItem =~ /\\btype=(Database)\\b/ || viewItem =~ /\\bsubType=(Database|DockerContainerDatabase)\\b/)"

Affected commands:

  • mssql.searchDatabase
  • mssql.restoreDatabase
  • mssql.flatFileImport

Code Changes Checklist

  • New or updated unit tests added
  • All existing tests pass (npm run test)
  • Code follows contributing guidelines
  • Telemetry/logging updated if relevant
  • No regressions or UX breakage

Reviewers: Please read our reviewer guidelines


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Co-authored-by: Benjin <1609827+Benjin@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback on OE context menu organization Fix operator precedence in Object Explorer context menu when conditions Mar 6, 2026
@Benjin Benjin closed this Mar 6, 2026
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.

2 participants