Skip to content

Include full diagnostic chains in LSP diagnostics #1105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 9, 2025

Conversation

ahejlsberg
Copy link
Member

No description provided.

@ahejlsberg ahejlsberg requested review from Copilot, jakebailey and andrewbranch and removed request for Copilot June 9, 2025 14:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances LSP diagnostics by including full diagnostic message chains rather than only the primary message.

  • Switches Message in toLSPDiagnostic to use a new messageChainToString helper.
  • Adds messageChainToString to flatten multi-part diagnostic messages.
  • Imports strings and the diagnosticwriter package to support the new helper.
Comments suppressed due to low confidence (1)

internal/ls/diagnostics.go:100

  • Add unit tests covering the new messageChainToString logic to ensure diagnostic chains are flattened correctly in LSP output.
func messageChainToString(diagnostic *ast.Diagnostic) string {

@ahejlsberg ahejlsberg added this pull request to the merge queue Jun 9, 2025
Merged via the queue into main with commit cf0c2c5 Jun 9, 2025
23 checks passed
@ahejlsberg ahejlsberg deleted the diagnostic-chains branch June 9, 2025 20:59
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