Skip to content

Add configuration option to show batch start/completion messages (default enabled) - #20751

Draft
Adam Hartford (adamhartford) wants to merge 3 commits into
microsoft:mainfrom
adamhartford:main
Draft

Add configuration option to show batch start/completion messages (default enabled)#20751
Adam Hartford (adamhartford) wants to merge 3 commits into
microsoft:mainfrom
adamhartford:main

Conversation

@adamhartford

Copy link
Copy Markdown

This PR adds a new configuration option mssql.showBatchMessages that allows users to control the display of batch start and completion messages in the SQL output panel.

Problem: When executing large SQL files (thousands of lines), the output panel becomes cluttered with "Started executing query at..." and "Commands completed successfully" messages, making it difficult to spot actual error messages. This differs from SQL Server Management Studio behavior, which doesn't show these verbose batch messages by default.

Solution: Added a configurable option that:

  • Defaults to true (preserves current behavior for backward compatibility)
  • When set to false, suppresses batch start/completion messages while preserving all error messages
  • Allows users to achieve SSMS-like output behavior for cleaner error visibility

@adamhartford

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

);
resultWebviewState.messages.push(message);
this.scheduleThrottledUpdate(queryRunner.uri);
let showBatchMessages: boolean = extConfig.get(Constants.configShowBatchMessages) ?? true;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default value in the config definition should handle the ?? true case already

this.scheduleThrottledUpdate(queryRunner.uri);
let showBatchMessages: boolean = extConfig.get(Constants.configShowBatchMessages) ?? true;

if (showBatchMessages) {

@Benjin Benjin Dubishar (Benjin) Dec 11, 2025

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since checking this flag would be an early bail-out, it'd be a bit cleaner to do

if (showBatchMesssages === false) {
  return;
}

and leave the rest untouched

@Benjin

Copy link
Copy Markdown
Contributor

Carlos Robles (@croblesm) Karl Burtram (@kburtram) Thoughts on taking this?

@Benjin

Copy link
Copy Markdown
Contributor

Adam Hartford (@adamhartford) looks like the test build is failing due to linter errors; can you clean those up? Should be able to just run the vscode formatter.

@adamhartford

Copy link
Copy Markdown
Author

Benjin Dubishar (@Benjin) Thanks for the feedback. I've made the changes you suggested and fixed the linter errors.

@Benjin

Copy link
Copy Markdown
Contributor

Hey Adam Hartford (@adamhartford), this fell through the cracks on our end; sorry about that. We're happy to take it, but will need to rebase a lot of code at this point. If you're still interested in contributing this, can you resubmit a new PR? Otherwise, I'll pull it in (and credit you, of course!)

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.

3 participants