Skip to content

Markup message support push - #1861

Open
Marvin Brouwer (Marvin-Brouwer) wants to merge 11 commits into
microsoft:mainfrom
Marvin-Brouwer:markup-message-support-push
Open

Marvin Brouwer (Marvin-Brouwer) wants to merge 11 commits into
microsoft:mainfrom
Marvin-Brouwer:markup-message-support-push

Conversation

@Marvin-Brouwer

@Marvin-Brouwer Marvin Brouwer (Marvin-Brouwer) commented Sep 21, 2026 •

Copy link
Copy Markdown

Fix for #1860.

3.18 added MarkupContent diagnostic messages, guarded by textDocument.diagnostic.markupMessageSupport.
The guarded message field is on Diagnostic, which both the push and pull models use, but the capability only exists on DiagnosticClientCapabilities.
So a push-only server has no way to negotiate it.

In #1860 Dirk Bäumer (@dbaeumer)'s preference was to mirror the property rather than reword the existing one:

"I would actually mirror it. Makes it easier to explain and evolve."

Notes

  • An earlier revision also marked the pull capability @proposed, to match pullDiagnostics.md in the specification.
    Reverted per Dirk Bäumer (@dbaeumer)'s review: 3.18.0 has shipped, so the property can't be marked proposed
    retroactively. The new push capability keeps @proposed, since 3.19 is still under development.
  • The client.ts line is not a behaviour change
    The property is optional, so omitting it already means unsupported. It's there so that both capabilities carry the same comment and turn up together when the flag is eventually enabled; otherwise it's easy to flip the pull one and leave push behind.
  • contributing.md calls a vscode-languageclient reference implementation desirable.
    There isn't one here because VS Code can't render markdown diagnostic messages yet (Allow diagnostics messages to have markdown (or formatted text) content vscode#54272, feature: Allow diagnostics messages to have markdown content vscode#214051), which is why markupMessageSupport is hardcoded false on both paths.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@Marvin-Brouwer

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

* in pull diagnostic messages.
*
* @since 3.18.0
* @proposed

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

3.18.0 shipped. We can't mark anything as propsed for 3.18

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

That is absolutely fair, I figured since https://github.com/microsoft/language-server-protocol does have a proposed marking someone might have missed it.
But if we can't do it after the fact I will revert it.
Are you sure though? Since it does really say @proposed here:
https://github.com/microsoft/language-server-protocol/blob/gh-pages/_specifications/lsp/3.19/language/pullDiagnostics.md?plain=1#L61

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

I see you answered in that PR, I will remove the proposed tag

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed it

Comment thread protocol/metaModel.json
},
"documentation": "The diagnostic's message. It usually appears in the user interface.\n\n@since 3.18.0 - support for MarkupContent. This is guarded by the client\ncapability `textDocument.diagnostic.markupMessageSupport`.",
"since": "3.18.0 - support for MarkupContent. This is guarded by the client\ncapability `textDocument.diagnostic.markupMessageSupport`."
"documentation": "The diagnostic's message. It usually appears in the user interface.\n\n@since 3.18.0 - support for MarkupContent in pull diagnostics.\nThis is guarded by the client capability\n`textDocument.diagnostic.markupMessageSupport`.\n\n@since 3.19.0 - support for MarkupContent in push diagnostics.\nThis is guarded by the client capability\n`textDocument.publishDiagnostics.markupMessageSupport`.",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I assume you generate the file using npm run generate:metaModel. Right?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Yes, I did

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

The pull capability remains incorrectly unmarked as proposed, and the new negotiation path lacks integration-test coverage.

Get a fresh assessment by requesting another Copilot review.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)
What changed in this PR

Adds push-diagnostic negotiation for MarkupContent messages alongside existing pull support.

Changes:

  • Adds the proposed push capability and generated metadata.
  • Clarifies push versus pull diagnostic documentation.
  • Explicitly advertises unsupported markup messages in the client.
File Description
types/​src/​main.ts Documents push and pull capability guards.
protocol/​src/​common/​protocol.ts Adds the push capability.
protocol/​src/​common/​protocol.diagnostic.ts Clarifies the pull capability.
protocol/​metaModel.json Updates generated protocol metadata.
client/​src/​common/​client.ts Advertises push support as disabled.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread client/src/common/client.ts
Comment thread protocol/metaModel.json
Comment thread protocol/src/common/protocol.diagnostic.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The implementation consistently mirrors the capability and matches the updated specification proposal.

Review effort: Balanced
Findings: 3 Medium severity

Open (3)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The capability, generated metadata, client advertisement, documentation, and integration assertions are consistent and complete.

Review effort: Balanced
Findings: None

Resolved since last review (3)

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