Invalidate Markdown code block editor providers - #329636
Draft
Henning Dieterichs (hediet) wants to merge 1 commit into
Draft
Invalidate Markdown code block editor providers#329636Henning Dieterichs (hediet) wants to merge 1 commit into
Henning Dieterichs (hediet) wants to merge 1 commit into
Conversation
Cache dynamic editor descriptors by provider, document, and complete fence info string, and let providers invalidate resolutions through onDidChange. Add an extension authoring guide covering the manifest API and @vscode/web-editors guest integration. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 52d9b18a-7144-4b00-9fe2-d2672f2a5e12
Copilot started reviewing on behalf of
Henning Dieterichs (hediet)
August 7, 2026 16:46
View session
Henning Dieterichs (hediet)
marked this pull request as ready for review
August 7, 2026 16:47
Henning Dieterichs (hediet)
marked this pull request as draft
August 7, 2026 16:48
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Markdown embedded code editor caching and invalidation, alongside extension author documentation.
Changes:
- Caches descriptors by provider, document URI, and complete info string.
- Adds provider-driven invalidation through
onDidChange. - Documents static and dynamic editor contributions.
Show a summary per file
| File | Description |
|---|---|
markdownEditorProvider.ts |
Implements caching, invalidation, and updated provider API. |
package.schema.json |
Clarifies selector language semantics. |
editor.ts |
Passes info strings in resolver messages. |
markdown-code-block-editor-extensions.md |
Adds extension authoring guidance. |
CONTRIBUTING.md |
Links the new guide. |
Review details
- Files reviewed: 5/5 changed files
- Comments generated: 4
- Review effort level: Balanced
| provider.source.kind === 'static' && resourceKeys.includes(provider.source.resource.toString())); | ||
| if (dynamicResourceChanged || staticResourceChanged) { | ||
| void refreshCodeBlockEditorProviders(false, dynamicResourceChanged); | ||
| this.#clearResolvedCodeBlockEditorCaches(); |
| function isMarkdownCodeBlockEditorProviderApi(value: unknown): value is MarkdownCodeBlockEditorProviderApi { | ||
| return typeof value === 'object' | ||
| && value !== null | ||
| && typeof (value as Record<string, unknown>).onDidChange === 'function' |
| </style> | ||
| </head> | ||
| <body> | ||
| <textarea id="value"></textarea> |
| resolve: definition.source.kind === 'static' | ||
| ? async () => definition.source.kind === 'static' ? definition.source.descriptor : undefined | ||
| : language => this.#resolveCodeBlockEditor(definition.id, language), | ||
| : infoString => this.#resolveCodeBlockEditor(definition.id, infoString), |
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.
Summary
onDidChangeevent so dynamic providers can invalidate resolved descriptors when settings or resources changelanguagetoinfoString@vscode/web-editorsDependency
Depends on microsoft/vscode-packages#231, which preserves the complete fenced info string separately from the language token and passes it to embedded editor providers. The Markdown editor dependency must be updated after that package change is published.
Testing
Not run per request.
git diff --checkpasses in both repositories.