mirror of
https://github.com/Microsoft/vscode
synced 2024-10-04 02:14:06 +00:00
f5143a99e0
Python uses a ["string prefix"](https://docs.python.org/3/reference/lexical_analysis.html#string-and-bytes-literals) to denote bytes literals (`b''`), raw strings (`r''`), and formatted string literals (`f''`). This change makes it so that when one types `r'` in VS Code, the string will be auto-closed as `r''` (as an example). Python also supports multiple string prefixes for a single literal. I've tested that typing `fr'` will auto-close to `fr''`, and so forth.
45 lines
1.6 KiB
JSON
45 lines
1.6 KiB
JSON
{
|
|
"comments": {
|
|
"lineComment": "#",
|
|
"blockComment": [ "'''", "'''" ]
|
|
},
|
|
"brackets": [
|
|
["{", "}"],
|
|
["[", "]"],
|
|
["(", ")"]
|
|
],
|
|
"autoClosingPairs": [
|
|
{ "open": "{", "close": "}" },
|
|
{ "open": "[", "close": "]" },
|
|
{ "open": "(", "close": ")" },
|
|
{ "open": "\"", "close": "\"", "notIn": ["string"] },
|
|
{ "open": "r\"", "close": "\"", "notIn": ["string", "comment"] },
|
|
{ "open": "R\"", "close": "\"", "notIn": ["string", "comment"] },
|
|
{ "open": "u\"", "close": "\"", "notIn": ["string", "comment"] },
|
|
{ "open": "U\"", "close": "\"", "notIn": ["string", "comment"] },
|
|
{ "open": "f\"", "close": "\"", "notIn": ["string", "comment"] },
|
|
{ "open": "F\"", "close": "\"", "notIn": ["string", "comment"] },
|
|
{ "open": "b\"", "close": "\"", "notIn": ["string", "comment"] },
|
|
{ "open": "B\"", "close": "\"", "notIn": ["string", "comment"] },
|
|
{ "open": "'", "close": "'", "notIn": ["string", "comment"] },
|
|
{ "open": "r'", "close": "'", "notIn": ["string", "comment"] },
|
|
{ "open": "R'", "close": "'", "notIn": ["string", "comment"] },
|
|
{ "open": "u'", "close": "'", "notIn": ["string", "comment"] },
|
|
{ "open": "U'", "close": "'", "notIn": ["string", "comment"] },
|
|
{ "open": "f'", "close": "'", "notIn": ["string", "comment"] },
|
|
{ "open": "F'", "close": "'", "notIn": ["string", "comment"] },
|
|
{ "open": "b'", "close": "'", "notIn": ["string", "comment"] },
|
|
{ "open": "B'", "close": "'", "notIn": ["string", "comment"] }
|
|
],
|
|
"surroundingPairs": [
|
|
["{", "}"],
|
|
["[", "]"],
|
|
["(", ")"],
|
|
["\"", "\""],
|
|
["'", "'"]
|
|
],
|
|
"folding": {
|
|
"offSide": true
|
|
}
|
|
}
|