You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VSCode Version: Code 1.30.2
OS Version: Windows_NT x64 10.0.17763
Extensions: Extensions are enabled
on typing the closing brace. Meaning VSCode should take the current tab indentation size in account and auto-indent the code-block when typing the closing brace.
Reacted by Jey Saravana, Marino Simic, Viktor Chernikov, billw2012, kimkun07, Kira Pilot, iletunic, Kira NT, Serhii Miniailo, Octo and 32 more
Yes, I would very much like to see this feature added as well. Oftentimes I will type in some code, then need to surround it in a loop, if statement, or other block contained by braces. When doing this, I expect that adding the closing brace after the initial brace will indent all code within the braces. I would expect the same behavior when surrounding code with other characters, such as brackets '[]', parentheses '()', or angled brackets '<>'.
This is a standard feature that is present in other versions of Visual Studio such as Visual Studio Enterprise and even Visual Studio Community. When starting out using Visual Studio Code, I expected this same functionality and was disappointed to learn it was not present. This feature is a must-have and I sincerely hope that it will be added.
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
Hi in order for us to better understand the issue, could you please include a screen recording of the issue you are seeing, as well as include a code sample where this is happening?
I've been aggravated by this problem for a long time, but then I found a VSCode extension named "Universal Format on Type" by Crend King that seems to fix the problem perfectly. Woo-Hoo!
Wow. Such a simple and longstanding feature of other MSFT IDEs and, five years after the request, it's still unimplemented. To summarize:
We want block contents to indent automatically when closing an enclosing set of braces added later
None of the Auto Indent settings do the right thing
Format on Type doesn't do the right thing
A third party extension seems to be a viable solution for some
I've never developed an IDE before, so I don't know how hard it is to make this feature, but five years seems like enough time? Just how deep is the backlog?
Activity
vscodebot commentedon Jan 31, 2019
(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
Kenobi-the-2nd commentedon Mar 6, 2020
Yes, I would very much like to see this feature added as well. Oftentimes I will type in some code, then need to surround it in a loop, if statement, or other block contained by braces. When doing this, I expect that adding the closing brace after the initial brace will indent all code within the braces. I would expect the same behavior when surrounding code with other characters, such as brackets '[]', parentheses '()', or angled brackets '<>'.
This is a standard feature that is present in other versions of Visual Studio such as Visual Studio Enterprise and even Visual Studio Community. When starting out using Visual Studio Code, I expected this same functionality and was disappointed to learn it was not present. This feature is a must-have and I sincerely hope that it will be added.
Thank-you very much for your time.
rudamaia commentedon Apr 23, 2020
visual studio for mac has this... Why it still not happening in vscode?
vscode-triage-bot commentedon Nov 3, 2020
This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
vscode-triage-bot commentedon Nov 21, 2020
🙂 This feature request received a sufficient number of community upvotes and we moved it to our backlog. To learn more about how we handle feature requests, please see our documentation.
Happy Coding!
GearTheWorld commentedon Oct 22, 2021
1.61.2 having Auto Indent to full and it doesn't work. Am I missing something?
gbirchmeier commentedon Jan 5, 2023
I don't understand why this is still an outstanding issue.
dev-joss commentedon Jan 12, 2023
Adding my support to this, would love to see it implemented
aiday-mar commentedon Mar 18, 2024
Hi in order for us to better understand the issue, could you please include a screen recording of the issue you are seeing, as well as include a code sample where this is happening?
gbirchmeier commentedon Mar 18, 2024
Aiday Marlen Kyzy (@aiday-mar) Here you go. It doesn't take much to replicate-- just create a new typescript file and write some code in it.
My VSCode is 1.87.2, with plugin "JavaScript and TypeScript Nightly" v5.5.20240314.
Screen.Recording.2024-03-18.at.11.57.39.AM.mov
aiday-mar commentedon Mar 28, 2024
Hi I see thank you. As a temporary workaround, you may enable format on type or format on save from the settings:
"editor.formatOnSave": trueOR
"editor.formatOnType": truebflora2 commentedon Aug 1, 2024
I've been aggravated by this problem for a long time, but then I found a VSCode extension named "Universal Format on Type" by Crend King that seems to fix the problem perfectly. Woo-Hoo!
chrisjaquet commentedon Oct 12, 2024
Enabling
does note trigger a reformat of the code block (or the line containing the closing brace). It only seems to adjust the indentation.
lhmouse commentedon Sep 3, 2025
Is there really no workaround for this? It is rather annoying to remember to fix whitespace like in here:
(https://stackoverflow.com/questions/63199416/how-to-stop-vscode-from-removing-indent-when-closing-curly-braces)

Brian-at-Baebies commentedon Jan 13, 2026
Wow. Such a simple and longstanding feature of other MSFT IDEs and, five years after the request, it's still unimplemented. To summarize:
I've never developed an IDE before, so I don't know how hard it is to make this feature, but five years seems like enough time? Just how deep is the backlog?