Skip to content

Commit

Permalink
VSCode: Add several handy onEnterRules
Browse files Browse the repository at this point in the history
commit-id:5ffc097f
  • Loading branch information
mkaput committed Feb 12, 2024
1 parent 1e63307 commit b070fd3
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions vscode-cairo/language-configuration.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,27 @@
"end": "^\\s*// endregion\\b",
},
},
"onEnterRules": [
{
// Carry indentation from the previous line if it's only whitespace.
"beforeText": "^\\s+$",
"action": { "indent": "none" },
},
{
// After the end of a function/field chain, with the semicolon on the same line.
"beforeText": "^\\s+\\..*;",
"action": { "indent": "outdent" },
},
{
// After the end of a function/field chain, with semicolon detached from the rest.
"beforeText": "^\\s+;",
"previousLineText": "^\\s+\\..*",
"action": { "indent": "outdent" },
},
{
// Doc single-line comment e.g. ///|
"beforeText": "^\\s*\\/{3}.*$",
"action": { "indent": "none", "appendText": "/// " },
},
],
}

0 comments on commit b070fd3

Please sign in to comment.