Handle SQL formatter parse failures#22540
Open
caohai wants to merge 2 commits into
Open
Conversation
caohai
requested review from
Benjin,
aasimkhan30,
allancascante,
kburtram,
laurenastrid1,
lewis-sanchez and
ssreerama
as code owners
July 24, 2026 23:50
Contributor
There was a problem hiding this comment.
Pull request overview
Adds client-side handling for SQL Tools Service “formatting failed” notifications so users get an actionable parse-error warning (with feedback + suppression), while also clarifying formatter setting descriptions and bumping the bundled SQL Tools Service version.
Changes:
- Listen for
textDocument/formattingFailedand show a parse-error warning with “Send Feedback” and “Don’t Show Again” actions, gated by a new setting. - Add telemetry actions for parse-error notification interactions and a shared feedback URL constant.
- Improve formatter setting descriptions (Preview vs existing) and add/extend unit tests to validate the new behavior and configuration metadata.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| localization/xliff/vscode-mssql.xlf | Adds/updates localized strings for formatter UX and setting descriptions. |
| extensions/mssql/test/unit/serviceClient.test.ts | Adds unit tests covering parse-error notification actions, suppression, and concurrency behavior. |
| extensions/mssql/test/unit/formatterConfiguration.test.ts | Adds tests validating the new setting and that formatter options are labeled for Preview vs existing formatter usage. |
| extensions/mssql/src/sharedInterfaces/telemetry.ts | Introduces new telemetry action IDs for parse-error notification actions. |
| extensions/mssql/src/models/contracts/languageService.ts | Adds the FormattingFailedNotification contract and payload types. |
| extensions/mssql/src/languageservice/serviceclient.ts | Hooks the new notification into the language client and implements the warning/suppression flow. |
| extensions/mssql/src/constants/locConstants.ts | Adds formatter-specific localized strings used by the new warning UI. |
| extensions/mssql/src/constants/constants.ts | Adds a shared feedback URL constant used by the warning action. |
| extensions/mssql/src/configurations/config.ts | Updates SQL Tools Service version to 6.0.20260724.3. |
| extensions/mssql/package.nls.json | Updates setting descriptions (including Preview vs existing formatter labeling) and adds the new parse-error notification setting text. |
| extensions/mssql/package.json | Adds the new configuration setting and switches formatter option descriptions to markdownDescription where needed. |
| extensions/mssql/l10n/bundle.l10n.json | Adds/updates localized strings for the new formatter notification UI. |
Comment on lines
+30
to
+38
| export type FormattingFailureReason = "ParseError"; | ||
| export type FormattingRequestType = "Document" | "Range"; | ||
|
|
||
| export interface FormattingFailedParams { | ||
| ownerUri: string; | ||
| formatType: FormattingRequestType; | ||
| reason: FormattingFailureReason; | ||
| parseErrorCount: number; | ||
| } |
PR Changes
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #22540 +/- ##
===========================================
+ Coverage 75.78% 87.28% +11.49%
===========================================
Files 407 320 -87
Lines 130542 115121 -15421
Branches 8382 520 -7862
===========================================
+ Hits 98933 100484 +1551
+ Misses 31609 14637 -16972
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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.
Description
Handles STS formatting-failure notifications by showing an optional parse-error warning with feedback and suppression actions. Also improves formatter setting descriptions and updates STS to 6.0.20260724.3.

STS diff: microsoft/sqltoolsservice@6.0.20260722.6...6.0.20260724.3

Code Changes Checklist
npm run test)Reviewers: Please read our reviewer guidelines