When rust-analyzer is disabled I can select a word in a Rust file, type < and the word will be wrapped with < >. When rust-analyzer is turned on this doesn't work anymore. I don't think this is a duplicate of #6451 but they might be related.
For VS Code specifically, I think RA could just ship its own language-configuration.json. I'm not certain how this would interact with language configurations provided by other extensions鈥攑resumably they would be overridden. The docs are here. This solution leaves the other editors unaddressed, but maybe it could be used temporarily, until the language server can be extended to handle these cases.
autoClosingPairs key, and #6682 is addressed with the surroundingPairs key, so they are related, but not identical. If we were going to ship a VS Code language config, my first attempt would be:// language-configuration.json
{
"comments": {
"lineComment": "//",
"blockComment": [ "/*", "*/" ]
},
"brackets": [
["{", "}"],
["[", "]"],
["(", ")"],
["<", ">"]
],
"autoClosingPairs": [
{ "open": "{", "close": "}" },
{ "open": "[", "close": "]" },
{ "open": "(", "close": ")" },
{ "open": "<", "close": ">" },
{ "open": "\"", "close": "\"", "notIn": ["string"] },
{ "open": "/*", "close": " */" }
],
"autoCloseBefore": ";:.,=}])> \n\t",
"surroundingPairs": [
["{", "}"],
["[", "]"],
["(", ")"],
["\"", "\""],
["'", "'"],
["<", ">"]
],
"indentationRules": {
"increaseIndentPattern": "^.*\\{[^}\"']*$|^.*\\([^\\)\"']*$",
"decreaseIndentPattern": "^\\s*(\\s*\\/[*].*[*]\\/\\s*)*[})]"
},
"folding": {
"markers": {
"start": "^\\s*//\\s*#?region\\b",
"end": "^\\s*//\\s*#?endregion\\b"
}
}
}
Happy to submit this鈥攋ust waiting on some consensus as to whether it's helpful to solve this only in the VS Code space.
I think this was implemented in #6840, please reopen if still now working.
Most helpful comment
Happy to submit this鈥攋ust waiting on some consensus as to whether it's helpful to solve this only in the VS Code space.