05-LanguagesAndFrameworks/Xaml/1-XmlEditing.xml (29 lines of code) (raw):

<?xml version="1.0" encoding="utf-8" ?> <root> <!-- 1. Synchronous tag editing Replace "foo" in one opening element with "bar" Closing element is updated automatically --> <foo></foo> <!-- 2. Tag manipulation <shortcut id="Show context actions">Alt+Enter</shortcut> on tag name, select "Collapse empty tag" <shortcut id="Show context actions">Alt+Enter</shortcut> on tag name, select "Expand empty tag" <shortcut id="Show context actions">Alt+Enter</shortcut> on tag name, select "Replace tag" <shortcut id="Show context actions">Alt+Enter</shortcut> on tag name, select "Remove tag" --> <bar></bar> <!-- 3. Promote child tag <shortcut id="Show context actions">Alt+Enter</shortcut> on foo tag, select "Remove tag and promote child" --> <foo> <bar></bar> </foo> <!-- 4. Convert tag and content to attribute <shortcut id="Show context actions">Alt+Enter</shortcut> on bar tag, select "To attribute" --> <foo> <bar>Value</bar> </foo> <!-- 5. Convert attribute to nested element <shortcut id="Show context actions">Alt+Enter</shortcut> on attribute, select "To nested element" --> <foo var="value" /> <!-- 6. Convert text value to CDATA <shortcut id="Show context actions">Alt+Enter</shortcut> on Value, select "Text to CDATA" --> <foo>Value</foo> <!-- 7. Replace all attributes <shortcut id="Show context actions">Alt+Enter</shortcut> on attribute, select "Replace all attributes" Enter new name for all baz attributes in foo elements --> <foo baz="value" /> <foo baz="value" /> <foo baz="value" /> <!-- 8. Expand/shrink selection Place caret in various places, repeatedly expand and shrink selection Selects attribute values, attribute, element, parent elements <shortcut id="Extend Selection">Ctrl+Alt+Right</shortcut> and <shortcut id="Shrink Selection">Ctrl+Alt+Left (VS)</shortcut> Select block - <shortcut id="Select Containing Declaration">Ctrl+Shift+[</shortcut> --> <foo bar="value"> <baz quux="doh" /> <baz quux="doh" /> <baz quux="doh" /> </foo> <!-- 9. Rearrange attributes and elements Place caret on attribute to reorder attributes Place caret on element to reorder element Reordering element left/right moves element in/out parent <shortcut id="Move Element Left">Left - Ctrl+Shift+Alt+Left</shortcut> <shortcut id="Move Element Right">Right - Ctrl+Shift+Alt+Right</shortcut> <shortcut id="Move Statement Up">Up - Ctrl+Shift+Alt+Up</shortcut> <shortcut id="Move Statement Down">Down - Ctrl+Shift+Alt+Down</shortcut> --> <foo bar="value" bar1="value1" bar2="value2"> <baz quux="doh" quux2="doh2" quux3="doh3" /> <baz quux="doh" quux2="doh2" quux3="doh3" /> <baz quux="doh" quux2="doh2" quux3="doh3" /> </foo> <!-- 10. Toggle current line comment <shortcut id="Comment/uncomment with Line Comment">Ctrl+Alt+/</shortcut> (VS) --> <foo></foo> <!-- 11. Insert block comment Inserts block comment at text caret, or around selection <shortcut id="Comment/uncomment with Line Comment">Ctrl+Alt+/</shortcut> (VS + IntelliJ) --> <foo></foo> <!-- 12. Surround with Select element, invoke surround with, surround with tag <shortcut id="Surround With">Ctrl+E, U (VS)</shortcut> <shortcut id="Show context actions">Alt+Enter</shortcut> --> <foo></foo> </root>