fix(generators): escape .WithName label in ProfilerMarkers output#143
Merged
VPDPersonal merged 1 commit intoJul 7, 2026
Merged
Conversation
- Emit marker literal fragments through a ToLiteral escape helper so a
.WithName("...") label with quotes or backslashes no longer breaks the
generated string literal.
- Build the generic (arity > 0) label by concatenating escaped literals with
typeof(T).Name instead of one interpolated string, so braces in the label are
not treated as interpolation holes.
- Add regression tests for special characters and braces on a generic type.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BiBGPPKYdunqf8wb1xe5Xi
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
.WithName("...")label into generated C# without escaping, so a label containing quotes, backslashes or braces produced source that failed to compile. Every marker literal fragment now goes through aToLiteralescape helper.typeof(T).Nameinstead of emitting one interpolated string, so braces in the label are no longer treated as interpolation holes.AssertNoErrors. Generators suite: 38/38.Notes for review
typeof(T).Nameis preserved.Aspid.FastTools.Generators.dllis the rebuilt deployment artifact for this fix.🇷🇺 Описание на русском
Сводка
.WithName("...")в генерируемый C# без экранирования, поэтому метка с кавычками, обратными слешами или фигурными скобками давала несобираемый код. Теперь все фрагменты литерала маркера проходят через хелперToLiteral.typeof(T).Nameвместо интерполированной строки, так что фигурные скобки в метке больше не считаются дырами интерполяции.AssertNoErrors. Набор генераторов: 38/38.Заметки для ревью
typeof(T).Nameна инстанс сохранена.Aspid.FastTools.Generators.dll— пересобранный артефакт деплоя для этого фикса.