mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-24 20:26:08 +00:00
@@ -1,31 +1,103 @@
|
||||
{
|
||||
// Note that this file should stay in sync with 'typescript-language-basics/language-configuration.json'
|
||||
"comments": {
|
||||
"lineComment": "//",
|
||||
"blockComment": [ "/*", "*/" ]
|
||||
"blockComment": [
|
||||
"/*",
|
||||
"*/"
|
||||
]
|
||||
},
|
||||
"brackets": [
|
||||
["${", "}"],
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
[
|
||||
"${",
|
||||
"}"
|
||||
],
|
||||
[
|
||||
"{",
|
||||
"}"
|
||||
],
|
||||
[
|
||||
"[",
|
||||
"]"
|
||||
],
|
||||
[
|
||||
"(",
|
||||
")"
|
||||
]
|
||||
],
|
||||
"autoClosingPairs": [
|
||||
{ "open": "{", "close": "}" },
|
||||
{ "open": "[", "close": "]" },
|
||||
{ "open": "(", "close": ")" },
|
||||
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
|
||||
{ "open": "\"", "close": "\"", "notIn": ["string"] },
|
||||
{ "open": "`", "close": "`", "notIn": ["string", "comment"] },
|
||||
{ "open": "/**", "close": " */", "notIn": ["string"] }
|
||||
{
|
||||
"open": "{",
|
||||
"close": "}"
|
||||
},
|
||||
{
|
||||
"open": "[",
|
||||
"close": "]"
|
||||
},
|
||||
{
|
||||
"open": "(",
|
||||
"close": ")"
|
||||
},
|
||||
{
|
||||
"open": "'",
|
||||
"close": "'",
|
||||
"notIn": [
|
||||
"string",
|
||||
"comment"
|
||||
]
|
||||
},
|
||||
{
|
||||
"open": "\"",
|
||||
"close": "\"",
|
||||
"notIn": [
|
||||
"string"
|
||||
]
|
||||
},
|
||||
{
|
||||
"open": "`",
|
||||
"close": "`",
|
||||
"notIn": [
|
||||
"string",
|
||||
"comment"
|
||||
]
|
||||
},
|
||||
{
|
||||
"open": "/**",
|
||||
"close": " */",
|
||||
"notIn": [
|
||||
"string"
|
||||
]
|
||||
}
|
||||
],
|
||||
"surroundingPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["'", "'"],
|
||||
["\"", "\""],
|
||||
["`", "`"],
|
||||
["<", ">"]
|
||||
[
|
||||
"{",
|
||||
"}"
|
||||
],
|
||||
[
|
||||
"[",
|
||||
"]"
|
||||
],
|
||||
[
|
||||
"(",
|
||||
")"
|
||||
],
|
||||
[
|
||||
"'",
|
||||
"'"
|
||||
],
|
||||
[
|
||||
"\"",
|
||||
"\""
|
||||
],
|
||||
[
|
||||
"`",
|
||||
"`"
|
||||
],
|
||||
[
|
||||
"<",
|
||||
">"
|
||||
]
|
||||
],
|
||||
"autoCloseBefore": ";:.,=}])>` \n\t",
|
||||
"folding": {
|
||||
@@ -33,5 +105,89 @@
|
||||
"start": "^\\s*//\\s*#?region\\b",
|
||||
"end": "^\\s*//\\s*#?endregion\\b"
|
||||
}
|
||||
}
|
||||
},
|
||||
"wordPattern": {
|
||||
"pattern": "(-?\\d*\\.\\d\\w*)|([^\\`\\~\\!\\@\\%\\^\\&\\*\\(\\)\\-\\=\\+\\[\\{\\]\\}\\\\\\|\\;\\:\\'\\\"\\,\\.\\<\\>/\\?\\s]+)",
|
||||
},
|
||||
"indentationRules": {
|
||||
"decreaseIndentPattern": {
|
||||
"pattern": "^((?!.*?/\\*).*\\*\/)?\\s*[\\}\\]].*$"
|
||||
},
|
||||
"increaseIndentPattern": {
|
||||
"pattern": "^((?!//).)*(\\{([^}\"'`/]*|(\\t|[ ])*//.*)|\\([^)\"'`/]*|\\[[^\\]\"'`/]*)$"
|
||||
},
|
||||
// e.g. * ...| or */| or *-----*/|
|
||||
"unIndentedLinePattern": {
|
||||
"pattern": "^(\\t|[ ])*[ ]\\*[^/]*\\*/\\s*$|^(\\t|[ ])*[ ]\\*/\\s*$|^(\\t|[ ])*[ ]\\*([ ]([^\\*]|\\*(?!/))*)?$"
|
||||
}
|
||||
},
|
||||
"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"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,32 +1,152 @@
|
||||
{
|
||||
"comments": {
|
||||
"blockComment": [ "{/*", "*/}" ]
|
||||
"blockComment": [
|
||||
"{/*",
|
||||
"*/}"
|
||||
]
|
||||
},
|
||||
"brackets": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"],
|
||||
["<", ">"]
|
||||
[
|
||||
"{",
|
||||
"}"
|
||||
],
|
||||
[
|
||||
"[",
|
||||
"]"
|
||||
],
|
||||
[
|
||||
"(",
|
||||
")"
|
||||
],
|
||||
[
|
||||
"<",
|
||||
">"
|
||||
]
|
||||
],
|
||||
"colorizedBracketPairs": [
|
||||
["{", "}"],
|
||||
["[", "]"],
|
||||
["(", ")"]
|
||||
[
|
||||
"{",
|
||||
"}"
|
||||
],
|
||||
[
|
||||
"[",
|
||||
"]"
|
||||
],
|
||||
[
|
||||
"(",
|
||||
")"
|
||||
]
|
||||
],
|
||||
"autoClosingPairs": [
|
||||
{ "open": "{", "close": "}" },
|
||||
{ "open": "[", "close": "]" },
|
||||
{ "open": "(", "close": ")" },
|
||||
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
|
||||
{ "open": "\"", "close": "\"", "notIn": ["string"] },
|
||||
{ "open": "/**", "close": " */", "notIn": ["string"] }
|
||||
{
|
||||
"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"
|
||||
}
|
||||
}
|
||||
],
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user