vscode/extensions/python/language-configuration.json
Sye van der Veen f5143a99e0 Support auto-closing quotes in Python raw string literals, etc
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.
2017-10-05 14:43:46 -04:00

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
}
}