vscode/extensions/javascript/tags-language-configuration.json
Matt Bierner 9b32ee6588
Fix regular expression for auto indent
Fixes #144505

Removes a `/` that was mistakenly copied over when moving these rules to json
2022-03-07 17:01:40 -08:00

153 lines
2.1 KiB
JSON

{
"comments": {
"blockComment": [
"{/*",
"*/}"
]
},
"brackets": [
[
"{",
"}"
],
[
"[",
"]"
],
[
"(",
")"
],
[
"<",
">"
]
],
"colorizedBracketPairs": [
[
"{",
"}"
],
[
"[",
"]"
],
[
"(",
")"
]
],
"autoClosingPairs": [
{
"open": "{",
"close": "}"
},
{
"open": "[",
"close": "]"
},
{
"open": "(",
"close": ")"
},
{
"open": "'",
"close": "'",
"notIn": [
"string",
"comment"
]
},
{
"open": "\"",
"close": "\"",
"notIn": [
"string"
]
},
{
"open": "/**",
"close": " */",
"notIn": [
"string"
]
}
],
"surroundingPairs": [
[
"{",
"}"
],
[
"[",
"]"
],
[
"(",
")"
],
[
"<",
">"
],
[
"'",
"'"
],
[
"\"",
"\""
]
],
"wordPattern": {
"pattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\$\\^\\&\\*\\(\\)\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:'\"\\,\\.\\<\\>\\/\\s]+)"
},
"onEnterRules": [
{
"beforeText": {
"pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w\\-.\\d]*)([^/>]*(?!/)>)[^<]*$",
"flags": "i"
},
"afterText": {
"pattern": "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>$",
"flags": "i"
},
"action": {
"indent": "indentOutdent"
}
},
{
"beforeText": {
"pattern": "<(?!(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr))([_:\\w][_:\\w\\-.\\d]*)([^/>]*(?!/)>)[^<]*$",
"flags": "i"
},
"action": {
"indent": "indent"
}
},
{
// `beforeText` only applies to tokens of a given language. Since we are dealing with jsx-tags,
// make sure we apply to the closing `>` of a tag so that mixed language spans
// such as `<div onclick={1}>` are handled properly.
"beforeText": {
"pattern": "^>$"
},
"afterText": {
"pattern": "^<\\/([_:\\w][_:\\w-.\\d]*)\\s*>$",
"flags": "i"
},
"action": {
"indent": "indentOutdent"
}
},
{
"beforeText": {
"pattern": "^>$"
},
"action": {
"indent": "indent"
}
}
],
}