mirror of
https://github.com/Microsoft/vscode
synced 2024-10-01 08:50:48 +00:00
onEnterRules add prefix on newline inside Javadoc (#176800)
Add some onEnterRules to Java language configuration to add the usual prefix (` * `) when inserting a new line in Javadoc. Those were actually copied from typescript language configuration which shares the same syntax for comments.
This commit is contained in:
parent
469cbed4dc
commit
4566ce493a
|
@ -29,5 +29,74 @@
|
|||
"start": "^\\s*//\\s*(?:(?:#?region\\b)|(?:<editor-fold\\b))",
|
||||
"end": "^\\s*//\\s*(?:(?:#?endregion\\b)|(?:</editor-fold>))"
|
||||
}
|
||||
}
|
||||
},
|
||||
"onEnterRules": [
|
||||
{
|
||||
// e.g. /** | */
|
||||
"beforeText": {
|
||||
"pattern": "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$"
|
||||
},
|
||||
"afterText": {
|
||||
"pattern": "^\\s*\\*/$"
|
||||
},
|
||||
"action": {
|
||||
"indent": "indentOutdent",
|
||||
"appendText": " * "
|
||||
}
|
||||
},
|
||||
{
|
||||
// e.g. /** ...|
|
||||
"beforeText": {
|
||||
"pattern": "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$"
|
||||
},
|
||||
"action": {
|
||||
"indent": "none",
|
||||
"appendText": " * "
|
||||
}
|
||||
},
|
||||
{
|
||||
// e.g. * ...|
|
||||
"beforeText": {
|
||||
"pattern": "^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$"
|
||||
},
|
||||
"previousLineText": {
|
||||
"pattern": "(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))"
|
||||
},
|
||||
"action": {
|
||||
"indent": "none",
|
||||
"appendText": "* "
|
||||
}
|
||||
},
|
||||
{
|
||||
// e.g. */|
|
||||
"beforeText": {
|
||||
"pattern": "^(\\t|[ ])*[ ]\\*/\\s*$"
|
||||
},
|
||||
"action": {
|
||||
"indent": "none",
|
||||
"removeText": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
// e.g. *-----*/|
|
||||
"beforeText": {
|
||||
"pattern": "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$"
|
||||
},
|
||||
"action": {
|
||||
"indent": "none",
|
||||
"removeText": 1
|
||||
}
|
||||
},
|
||||
{
|
||||
"beforeText": {
|
||||
"pattern": "^\\s*(\\bcase\\s.+:|\\bdefault:)$"
|
||||
},
|
||||
"afterText": {
|
||||
"pattern": "^(?!\\s*(\\bcase\\b|\\bdefault\\b))"
|
||||
},
|
||||
"action": {
|
||||
"indent": "indent"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue