mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-25 20:57:12 +00:00
Revert "onEnter Indentation Rules: Ignoring double slashes inside of strings …"
This reverts commit 21c52a4a3a.
172 lines
2.8 KiB
JSON
172 lines
2.8 KiB
JSON
{
|
|
"comments": {
|
|
"lineComment": "//", // "#"
|
|
"blockComment": [
|
|
"/*",
|
|
"*/"
|
|
]
|
|
},
|
|
"brackets": [
|
|
[
|
|
"{",
|
|
"}"
|
|
],
|
|
[
|
|
"[",
|
|
"]"
|
|
],
|
|
[
|
|
"(",
|
|
")"
|
|
]
|
|
],
|
|
"autoClosingPairs": [
|
|
{
|
|
"open": "{",
|
|
"close": "}",
|
|
"notIn": [
|
|
"string"
|
|
]
|
|
},
|
|
{
|
|
"open": "[",
|
|
"close": "]",
|
|
"notIn": [
|
|
"string"
|
|
]
|
|
},
|
|
{
|
|
"open": "(",
|
|
"close": ")",
|
|
"notIn": [
|
|
"string"
|
|
]
|
|
},
|
|
{
|
|
"open": "'",
|
|
"close": "'",
|
|
"notIn": [
|
|
"string",
|
|
"comment"
|
|
]
|
|
},
|
|
{
|
|
"open": "\"",
|
|
"close": "\"",
|
|
"notIn": [
|
|
"string",
|
|
"comment"
|
|
]
|
|
},
|
|
{
|
|
"open": "/**",
|
|
"close": " */",
|
|
"notIn": [
|
|
"string"
|
|
]
|
|
}
|
|
],
|
|
"surroundingPairs": [
|
|
[
|
|
"{",
|
|
"}"
|
|
],
|
|
[
|
|
"[",
|
|
"]"
|
|
],
|
|
[
|
|
"(",
|
|
")"
|
|
],
|
|
[
|
|
"'",
|
|
"'"
|
|
],
|
|
[
|
|
"\"",
|
|
"\""
|
|
],
|
|
[
|
|
"`",
|
|
"`"
|
|
]
|
|
],
|
|
"indentationRules": {
|
|
"increaseIndentPattern": "({(?!.*}).*|\\(|\\[|((else(\\s)?)?if|else|for(each)?|while|switch|case).*:)\\s*((/[/*].*|)?$|\\?>)",
|
|
"decreaseIndentPattern": "^(.*\\*\\/)?\\s*((\\})|(\\)+[;,])|(\\]\\)*[;,])|\\b(else:)|\\b((end(if|for(each)?|while|switch));))"
|
|
},
|
|
"folding": {
|
|
"markers": {
|
|
"start": "^\\s*(#|\/\/)region\\b",
|
|
"end": "^\\s*(#|\/\/)endregion\\b"
|
|
}
|
|
},
|
|
"wordPattern": "(-?\\d*\\.\\d\\w*)|([^\\-\\`\\~\\!\\@\\#\\%\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>\\/\\?\\s]+)",
|
|
"onEnterRules": [
|
|
{
|
|
// e.g. /** | */
|
|
"beforeText": "^\\s*\\/\\*\\*(?!\\/)([^\\*]|\\*(?!\\/))*$",
|
|
"afterText": "^\\s*\\*\\/$",
|
|
"action": {
|
|
"indent": "indentOutdent",
|
|
"appendText": " * "
|
|
}
|
|
},
|
|
{
|
|
// e.g. /** ...|
|
|
"beforeText": "^\\s*\\/\\*\\*(?!\\/)([^\\*]|\\*(?!\\/))*$",
|
|
"action": {
|
|
"indent": "none",
|
|
"appendText": " * "
|
|
}
|
|
},
|
|
{
|
|
// e.g. * ...|
|
|
"beforeText": "^(\\t|(\\ \\ ))*\\ \\*(\\ ([^\\*]|\\*(?!\\/))*)?$",
|
|
"action": {
|
|
"indent": "none",
|
|
"appendText": "* ",
|
|
},
|
|
},
|
|
{
|
|
// e.g. */|
|
|
"beforeText": "^(\\t|(\\ \\ ))*\\ \\*\\/\\s*$",
|
|
"action": {
|
|
"indent": "none",
|
|
"removeText": 1
|
|
},
|
|
},
|
|
{
|
|
// e.g. *-----*/|
|
|
"beforeText": "^(\\t|(\\ \\ ))*\\ \\*[^/]*\\*\\/\\s*$",
|
|
"action": {
|
|
"indent": "none",
|
|
"removeText": 1
|
|
}
|
|
},
|
|
{
|
|
// Decrease indentation after single line if/else if/else, for, foreach, or while
|
|
"previousLineText": "^\\s*(((else ?)?if|for(each)?|while)\\s*\\(.*\\)\\s*|else\\s*)$",
|
|
// But make sure line doesn't have braces or is not another if statement
|
|
"beforeText": "^\\s+([^{i\\s]|i(?!f\\b))",
|
|
"action": {
|
|
"indent": "outdent"
|
|
}
|
|
},
|
|
// Add // when pressing enter from inside line comment
|
|
{
|
|
"beforeText": {
|
|
"pattern": "\/\/.*"
|
|
},
|
|
"afterText": {
|
|
"pattern": "^(?!\\s*$).+"
|
|
},
|
|
"action": {
|
|
"indent": "none",
|
|
"appendText": "// "
|
|
}
|
|
},
|
|
]
|
|
}
|