-
Notifications
You must be signed in to change notification settings - Fork 30.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto-indent on closing brace #67678
Comments
(Experimental duplicate detection) |
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. |
visual studio for mac has this... Why it still not happening in vscode? |
I don't understand why this is still an outstanding issue. |
Adding my support to this, would love to see it implemented |
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? |
@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 |
Hi I see thank you. As a temporary workaround, you may enable format on type or format on save from the settings:
OR
|
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! |
Enabling
does note trigger a reformat of the code block (or the line containing the closing brace). It only seems to adjust the indentation. |
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.
The text was updated successfully, but these errors were encountered: