RFC: model XAML in the XML LST (type attestation + value layer) - #8663
Draft
macsux wants to merge 1 commit into
Draft
RFC: model XAML in the XML LST (type attestation + value layer)#8663macsux wants to merge 1 commit into
macsux wants to merge 1 commit into
Conversation
Design proposal for discussion, not ready to merge. Adds a XAML layer to the XML LST in parallel on the Java and C# sides: - JavaType attestation slots on Xml.Tag, Xml.Ident and the new Literal, so names carry semantic identity without proliferating node types. - A polymorphic attribute-value slot: Xml.Attribute.AttributeValue, implemented by the existing Value (plain XML, unchanged) and a new ExpressionValue that carries a parsed expression tree. - A value/binding expression layer: Literal, MarkupExtension + Argument, PropertyPath with Property/Indexer/Paren/Cast/FunctionCall/Element/Relative/ Stream segments, Negation, TypeName and ParenGroup — covering WPF, WinUI (incl. x:Bind), MAUI/Xamarin.Forms, Avalonia and Silverlight. Known to not compile: org.openrewrite.java.tree.JavaType lives in rewrite-java and rewrite-xml only depends on rewrite-core. Resolving where the type model should live is the main thing this RFC is asking the team to decide.
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.
Draft / RFC — for discussion only, not ready to merge. CI is expected to be red; see the blocker below.
Adds a XAML layer to the XML LST, kept in structural sync between
rewrite-xml/.../tree/Xml.javaandrewrite-csharp/csharp/OpenRewrite/Xml/Xml.cs:JavaTypeattestation slots onTag,Identand the newLiteral(semantic identity without node-type proliferation), a polymorphic attribute-value slot (Attribute.AttributeValue, implemented by the unchangedValuefor plain XML plus a newExpressionValuecarrying a parsed expression tree), and a value/binding expression layer —MarkupExtension/Argument,PropertyPathwithProperty/Indexer/Paren/Cast/FunctionCall/Element/Relative/Streamsegments,Negation,TypeName,ParenGroup— covering WPF, WinUI (incl.x:Bind), MAUI/Xamarin.Forms, Avalonia and Silverlight. Plain XML documents never contain the new nodes and their values stayValueinstances, so existing serialized LSTs deserialize unchanged.Known blocker, and the main question for reviewers:
org.openrewrite.java.tree.JavaTypelives inrewrite-java, butrewrite-xmlonly depends onrewrite-core, sorewrite-xml:compileJavafails. Where should the type model live for a non-Java language module that needs attestation? That decision is what this RFC is asking the team to settle before any parser/printer/visitor work starts.