Update C# onEnterRules to account for documentation comments

This commit is contained in:
David Barbet
2025-02-26 14:20:22 -08:00
parent 10434e3f45
commit a7f76c3689

View File

@@ -84,9 +84,10 @@
},
"onEnterRules": [
// Add // when pressing enter from inside line comment
// We do not want to match /// (a documentation comment)
{
"beforeText": {
"pattern": "\/\/.*"
"pattern": "[^\/]\/\/[^\/].*"
},
"afterText": {
"pattern": "^(?!\\s*$).+"
@@ -96,5 +97,16 @@
"appendText": "// "
}
},
// Add /// when pressing enter from anywhere inside a documentation comment.
// Documentation comments are not valid after non-whitespace.
{
"beforeText": {
"pattern": "^\\s*\/\/\/"
},
"action": {
"indent": "none",
"appendText": "/// "
}
},
]
}