Add setting to disable opening saved query results#22062
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new mssql.results.openAfterSave setting to control whether exported query result files are automatically opened after a successful save, while preserving the current auto-open behavior by default.
Changes:
- Added
mssql.results.openAfterSavesetting (default:true) with localized description. - Updated results export flow to conditionally open the saved file only when the setting is enabled.
- Expanded unit tests to cover default behavior, disabled behavior, failure cases, and canceled save dialogs.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| localization/xliff/vscode-mssql.xlf | Adds localized string entry for the new setting description. |
| extensions/mssql/test/unit/saveResults.test.ts | Adds/updates unit tests to validate conditional auto-open behavior and related edge cases. |
| extensions/mssql/src/models/resultsSerializer.ts | Introduces shouldOpenSavedFile() and gates openSavedFile() behind the new setting. |
| extensions/mssql/src/constants/constants.ts | Adds a constant key for results.openAfterSave. |
| extensions/mssql/package.nls.json | Adds the English description string for the new setting. |
| extensions/mssql/package.json | Contributes the new boolean setting with default true and resource scope. |
Comment on lines
96
to
99
| return saveResults.onSaveResults(testFile, 0, 0, format, undefined).then(() => { | ||
| expect(vscodeWrapper.showInformationMessage).to.have.been.calledOnce; | ||
| expect(openSavedFileStub).to.have.been.calledOnceWith(fileUri.fsPath, format); | ||
| }); |
PR Changes
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22062 +/- ##
==========================================
- Coverage 74.95% 74.95% -0.01%
==========================================
Files 393 393
Lines 119869 119880 +11
Branches 7161 7163 +2
==========================================
+ Hits 89847 89854 +7
- Misses 30022 30026 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Benjin
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #22059
Validation