I'm looking to modify VS Code's indentation behavior so that if I press enter after typing a line like this:
variable = function(param1,
It'll indent to the level of the open parenthesis so that I can easily format code like this:
variable = function(param1,
param2)
I'd like it to work for open square brackets and curly brackets as well:
variable = function([1, 2, 3, 4
5, 6, 7, 8],
param2,
{'a': 1, 'b': 2,
'c': 3, 'd': 4},
param4)
I'd prefer it to have this behavior for pretty much every language I work with, though the curly braces behavior isn't necessary (and may even be undesirable) when working in C++ or C#.
This is very similar to Sublime Text's indent_to_bracket
setting.
Is there any way to accomplish this? If there's no setting, I'm willing to tinker with whatever is necessary. I'm also open to an extension that can do this, or even writing an extension if it's necessary and makes sense to do so.