Skip to content

Fixing the missing option from vscode "create project from database" #26317

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 3, 2025

Conversation

ssreerama
Copy link
Contributor

@ssreerama ssreerama commented May 26, 2025

Pull Request Template – Azure Data Studio

This pull request includes a small change to the extensions/sql-database-projects/package.json file. The change simplifies the when condition for the sqlDatabaseProjects.createProjectFromDatabase command by updating specific viewItem constraints.

Description

'Create project from database' option is not visible to the users in vscode with one of the recent releases. This PR fixes the issue by updating the viewItem constraint from the when condition for the sqlDatabaseProjects.createProjectFromDatabase command in the package.json file that is stopping the option being visible, as viewItem current syntax is not supported.

Issue: #26309

Code Changes Checklist

  • New or updated unit tests added
  • All existing tests pass (npm run test)
  • Code follows contributing guidelines
  • No UI regressions introduced
  • Logging/telemetry updated if applicable
  • Cross-platform support checked (Windows, macOS, Linux if relevant)

Reviewers: Please read our reviewer guidelines

Before: VsCode
image
image

After: VsCode
image
image

@ssreerama ssreerama added this to the June 2025 Release milestone May 26, 2025
@ssreerama ssreerama self-assigned this May 26, 2025
@ssreerama ssreerama requested review from Benjin and kisantia as code owners May 26, 2025 22:06
@ssreerama ssreerama requested a review from chlafreniere May 26, 2025 22:06
@zijchen
Copy link
Member

zijchen commented May 27, 2025

Is there a way to add a test for this launch point?

@ssreerama
Copy link
Contributor Author

Is there a way to add a test for this launch point?

Yeah, having a test that checks the option would be helpful to catch any such regression in future, will add a test for that!

@ssreerama ssreerama requested a review from Copilot May 30, 2025 18:10
Copy link
Contributor

@Copilot 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 addresses the issue where the 'create project from database' option was not visible in VS Code by updating the "when" condition for the command in package.json.

  • Updated the regex in the "when" condition to match the new viewItem syntax.
  • Simplified the viewItem constraint to support the correct visibility.
Comments suppressed due to low confidence (1)

extensions/sql-database-projects/package.json:480

  • Consider adding an inline comment explaining the rationale behind the updated regex pattern for clarity and future maintenance.
          "when": "!azdataAvailable && view == objectExplorer && viewItem =~ /\btype=(disconnectedServer|Server|Database)\b/",

@ssreerama ssreerama merged commit 39e075b into main Jun 3, 2025
11 of 12 checks passed
@ssreerama ssreerama deleted the sai/importOptionMissingFix branch June 3, 2025 18:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants