Skip to content

Commit

Permalink
Add auto completion for JSDoc comment block (/** */) (#155)
Browse files Browse the repository at this point in the history
* Add auto completion for /* */ pair

* Add onEnterRules
  • Loading branch information
PranayAgarwal authored Feb 29, 2024
1 parent 3840b4c commit be11ca5
Showing 1 changed file with 71 additions and 2 deletions.
73 changes: 71 additions & 2 deletions hack.configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,12 @@
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"]
["'", "'"],
{
"open": "/**",
"close": " */",
"notIn": ["string"]
}
],
"surroundingPairs": [
["{", "}"],
Expand All @@ -27,5 +32,69 @@
"start": "^\\s*//\\s*#?region\\b",
"end": "^\\s*//\\s*#?endregion\\b"
}
}
},
"onEnterRules": [
{
"beforeText": {
"pattern": "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$"
},
"afterText": {
"pattern": "^\\s*\\*/$"
},
"action": {
"indent": "indentOutdent",
"appendText": " * "
}
},
{
"beforeText": {
"pattern": "^\\s*/\\*\\*(?!/)([^\\*]|\\*(?!/))*$"
},
"action": {
"indent": "none",
"appendText": " * "
}
},
{
"beforeText": {
"pattern": "^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$"
},
"previousLineText": {
"pattern": "(?=^(\\s*(/\\*\\*|\\*)).*)(?=(?!(\\s*\\*/)))"
},
"action": {
"indent": "none",
"appendText": "* "
}
},
{
"beforeText": {
"pattern": "^(\\t|[ ])*[ ]\\*/\\s*$"
},
"action": {
"indent": "none",
"removeText": 1
}
},
{
"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"
}
}
]
}

0 comments on commit be11ca5

Please sign in to comment.