Skip to content

Commit 661eb1d

Browse files
committed
Added onEnterRules for the following cases:
```xaml <Button>|</Button> => <Button> | </Button> ``` and ```xaml <Button Width="100" | => <Button Width="100" | ``` Everything else will get the previous indent as before.
1 parent 51f768e commit 661eb1d

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

src/xaml/language-configuration.json

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,20 @@
5555
},
5656
"wordPattern": {
5757
"pattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\#\\$\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)"
58-
}
58+
},
59+
"onEnterRules": [
60+
{
61+
"beforeText": "^\\s*(<([A-Za-z0-9_.-]+)([^/>]*(?!/)>)[^<]*)(?!.*<\\/\\2>)$",
62+
"afterText": "^\\s*<\\/([A-Za-z0-9_.-]+)[^>]*>$",
63+
"action": {
64+
"indent": "indentOutdent"
65+
}
66+
},
67+
{
68+
"beforeText": "^\\s*(<([A-Za-z0-9_.-]+)[^</]*)$",
69+
"action": {
70+
"indent": "indent"
71+
}
72+
},
73+
]
5974
}

0 commit comments

Comments
 (0)