Repository navigation
MarkdownRenderer structure step 2e: share the TextMateSharp adapter through an engine package - #113
Merged
Xueyang-Song merged 5 commits intoOct 31, 2026
Conversation
The sample app and the performance harness were the last projects that read renderer internals through ProjectStructureException grants. Sample: public API only. - MarkdownTheme.ForcedContrastColors (MarkdownContrastColors) replaces the process-wide ThemeResolver.SystemThemeProviderOverride. Setting it raises the theme's Changed notification, so views restyle as for a Windows contrast switch. - MarkdownRendererControl.RenderedContentSize and RenderedThemeVariant report what the view last displayed, which the sample's UI-test status and touch layout capture use as checks. - The touch capture reads scroll position through the UI Automation scroll pattern. - CodeBlockThemeVariant becomes MarkdownThemeVariant in Theming, shared by RenderedThemeVariant and CodeBlockHighlightRequest.ThemeVariant. Performance harness: a white-box performance test. - MRS0002 now allows grants only to the renderer's own projects at tests\<name>\<name>.csproj or perf\<name>\<name>.csproj, which never ship, instead of to any name ending in .Tests or .Benchmarks. - PerformanceEventListener moves into PerformanceHarness.Core, which GitHub.Tests references instead of linking the harness's source file. - The harness's measured code is unchanged, so results stay comparable with the existing baselines. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ad rules, hide Mermaid and Math processors Turn RS0026/RS0027 back into errors and fix what they find: one constructor each for MarkdownVectorTextStyle, MarkdownStyleContext and MarkdownStyleSelector with the role/ancestor qualifier as a trailing optional parameter, and explicit MarkdownVectorScene overloads. The feature extension classes suppress the rules at class level, and a new PublicApi test checks the property they rely on for each receiver. Mermaid and Math now expose only host configuration. The headless processors, their results, diagnostics, scene formats and decoders become internal; Math grants internal access to its tests and the benchmarks. The Mermaid and Math NativeAOT smokes now render through UseMermaid/UseMathematics. EmbedVisibility becomes internal. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hrough an engine package Move the TextMateSharp-backed grammar provider that Grammars.Common and Grammars.All compiled from one linked source file into a new shipping package, MarkdownRenderer.SyntaxHighlighting.TextMate.Engine, as the public TextMateSharpGrammarProvider. Both packs reference it, and no file link or ProjectStructureException remains. The engine is the one package whose public API names TextMateSharp types; the forbidden-contract test allows that for this assembly only and fails if the exception stops being needed. Wire the ninth package into both solutions, CI restore and pack lists, the release package set, the managed-architecture map, the TextMate release evidence (dependency rules and the Common selected-RID payload), the compliance self-tests, the app security gate test, lock files and the packaging docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Xueyang-Song
changed the base branch from
codex/markdown-renderer-api-surface
to
codex/markdown-renderer-1-0
October 31, 2026 01:50
…te-engine Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
zhuowcui
approved these changes
Oct 31, 2026
Xueyang-Song
merged commit Oct 31, 2026
6043559
into
codex/markdown-renderer-1-0
10 of 12 checks passed
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.
Step 2, part 5 of the MarkdownRenderer structure cleanup. It is stacked on #112 and targets that branch; it retargets as the branches below it merge.
The TextMate grammar packs shared their TextMateSharp adapter by compiling one source file into both assemblies, the last file link in the renderer. That adapter now lives in a new shipping package,
MarkdownRenderer.SyntaxHighlighting.TextMate.Engine, and both packs reference it. No file links remain, and noProjectStructureExceptionremains anywhere.The engine package
You chose a shared engine package whose API takes TextMateSharp's registry options.
TextMateSharpGrammarProvideris the former internalBundledTextMateGrammarProvider, moved with history. It is unchanged apart from its constructor. The required inputs (revision, registry-options factory, scope resolver) come first, then optionalallowedLanguageIdsandoptions; null options now mean the defaults. The test-only checkpoint hook stays on an internal constructor, and the engine grants internal access to its TextMate test project.The one public TextMateSharp dependency
The PublicApi tests forbid third-party types in any shipping public signature. The engine is now the single exception:
ForbiddenContractTypeTestsallowsTextMateSharp.for that assembly only. A new test,ThirdPartyExceptions_NameShippingAssembliesThatActuallyUseThem, fails if the exception stops being needed. The lean integration and both grammar packs still expose no TextMateSharp type. As a result, the engine package's version has to follow TextMateSharp's breaking changes.public-api.mdsays so, and the package description tells hosts to install a grammar pack instead.Wiring the ninth package
ShippingAssemblies, and the app's security-gate test, which lists the shipping projects inside the app's locked graph.packaging-and-distribution.md, andpublic-api.md. The packaging table's Mermaid row no longer calls the MMIR scene contracts public, which follows from MarkdownRenderer structure step 2d: overload rules on, Mermaid and Math expose configuration only #112.Decisions for review
...TextMate.Engine, as proposed. The lean pack keeps its name. The release-evidence script used to call the lean pack$enginePackage, so that variable is now$integrationPackage, to avoid two different "engines".CuratedRegistryOptionsimplements TextMateSharp's registry contract itself.Verification
MarkdownRenderer.slnxRelease x64Test-ProjectStructure.ps1ProjectStructureExceptionin any projectJitHub.WinUIRelease x64 with the security gateReleaseSecuritytests, including the engine in the app's locked graph. One warning: MSB3774, this machine has no VCLibs SDKInvoke-TextMateReleaseEvidence.ps1MarkdownRendererpackage consumed by NativeAOT and trimmed single-file--locked-moderestoreJitHub.WebandJitHub.Web.Tests, whose locks don't match this machine's SDK (10.0.14 vs 10.0.11); unchanged hereNot run: Sandbox UI cases, PixelTests and the external performance-gate subset. This change moves code between assemblies without changing rendering.
🤖 Generated with Claude Code