Fix: creating SQL project inside already open workspace results in tasks definition in wrong spot#20985
Fix: creating SQL project inside already open workspace results in tasks definition in wrong spot#20985
Conversation
PR Changes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #20985 +/- ##
=======================================
Coverage 68.27% 68.27%
=======================================
Files 242 242
Lines 23554 23554
Branches 3116 3116
=======================================
Hits 16082 16082
Misses 7343 7343
Partials 129 129 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the SQL project build task generation from a template-based approach to a programmatic approach. The main purpose is to fix an issue where tasks.json was being created inside the project folder instead of at the workspace level when creating a SQL project in an already open workspace.
Changes:
- Replaced template-based task generation with programmatic task creation using new helper functions
- Removed the
tasksTemplate.jsontemplate file and associated loading code - Extracted build-related constants to improve maintainability and reduce hardcoded values
- Added localization support for task labels and error messages
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| localization/xliff/sql-database-projects.xlf | Added localization entries for new task detail message and error messages |
| extensions/sql-database-projects/l10n/bundle.l10n.json | Added localized strings for task details and error handling |
| extensions/sql-database-projects/test/templates.test.ts | Updated expected template count from 17 to 16 after removing tasks template |
| extensions/sql-database-projects/src/tools/buildHelper.ts | Refactored to use extracted constants instead of hardcoded build argument strings |
| extensions/sql-database-projects/src/templates/templates.ts | Removed loading of tasks template as it's no longer needed |
| extensions/sql-database-projects/src/controllers/projectController.ts | Refactored task creation logic to programmatically generate tasks with proper workspace detection |
| extensions/sql-database-projects/src/common/utils.ts | Added helper functions for creating build tasks and tasks.json structure |
| extensions/sql-database-projects/src/common/constants.ts | Added new constants for build arguments, task configuration, and localized messages |
| extensions/sql-database-projects/resources/templates/tasksTemplate.json | Deleted template file as part of refactoring to programmatic approach |
| extensions/sql-database-projects/CHANGELOG.md | Added release notes for version 1.5.7 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
extensions/sql-database-projects/src/controllers/projectController.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
extensions/sql-database-projects/src/controllers/projectController.ts
Outdated
Show resolved
Hide resolved
extensions/sql-database-projects/src/controllers/projectController.ts
Outdated
Show resolved
Hide resolved
extensions/sql-database-projects/src/controllers/projectController.ts
Outdated
Show resolved
Hide resolved
|
Updated the gif and image with after addressing the proposed changes. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 13 out of 13 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
extensions/sql-database-projects/test/projectController.test.ts
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


Pull Request Template – vscode-mssql
Issue: #20821
Description
This pull request refactors how SQL project build tasks are created and managed.
tasks.jsonfiles for SQL projects.Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines