Skip to content

Conversation

@adamhartford
Copy link

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
Author

@microsoft-github-policy-service agree

);
resultWebviewState.messages.push(message);
this.scheduleThrottledUpdate(queryRunner.uri);
let showBatchMessages: boolean = extConfig.get(Constants.configShowBatchMessages) ?? true;
Copy link
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) {
Copy link
Contributor

@Benjin Benjin Dec 11, 2025

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
Contributor

Benjin commented Dec 11, 2025

@croblesm @kburtram Thoughts on taking this?

@Benjin
Copy link
Contributor

Benjin commented Dec 11, 2025

@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
Author

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

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