-
Notifications
You must be signed in to change notification settings - Fork 30k
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
Wrong auto-indentation in typescript #209802
Comments
I too have this issue |
+1 to also having this issue. Can confirm, If, Else If, For, While, and Arrow Functions affected. Functions & Switches are fine. Version: 1.88.1 (user setup) |
Seems to be a re-occurrence of #30933 from quite some time ago. |
yeah, the latest version must auto error. emmmm, how long fix the bug |
I wonder why this bug report does not have a billion upvotes. I have the same problem, and it makes it a pain to write code. I constantly have to fix it manually. I tried disabling all my extensions and clear both User settings (JSON) and Workspace settings (JSON), but to no eval. This is what I experience in JS files: Pressing ENTER after control flows such as In the example below I pressed ENTER after the Previously it placed the cursor right below the Things seems to work fine for PHP files. Tested with VSCode 1.89.0 (commit b58957e) on macOS 12.7.2. "About Visual Studio Code": |
For those that don't like the new behavior, I created the |
Hi everyone thank you for expressing your concern. This change has come in as a result of the following issue with 43 upvotes (#43244) which precisely asked for indentation to be added after a braceless if/for/while statement. I will explore the idea of adding indentation by default, and then removing it when { is typed. |
@aiday-mar, hi. Thanks for bringing in more context.
If you're going by upvotes, this issue has 5 upvotes in a month, while the other one has 43 in 6 years, which is 0.6 likes per month. I would argue that the current fix has created a much bigger problem, so maybe it can be removed until a proper solution is found. While the previous behaviour was perceived as a shortcoming, the new one is a straight up bug. |
@aiday-mar Quite frankly, there are hundreds of thousands of people using VSCode, and 43 upvotes were enough to destabilize our primary work tool? This seems like poor judgement. The change should be rolled back immediately. |
Please, for the love of all things sane, revert this terrible decision. It makes VSCode an absolute nightmare to work with. |
If you hate this change as much as I do, this works: Uninstall the current broken version and revert to v1.87 https://code.visualstudio.com/updates/v1_87 Then go to File > Preferences > Settings, search for update, and change the automatic update setting to 'none' to prevent the broken version from being downloaded again. Obviously, this is less than ideal - but I'd much rather stay on this slightly older release than deal with the pain of fixing every single time I use an |
fix it ! |
Don't hold your breath. I've a feeling I'm going to be stuck on version 1.87 for at least a year, or more, because of this insane change. An editor should never, ever, dictate a coding style, which is exactly what this change does (perhaps inadvertently while trying to be nice to a small subset of other devs, but that is the end result). The only exception is if the language demands such structure, such as Python. In all other cases, it should be entirely up to the user. |
So happy to see this fixed. How do we easily track when it enters a live release version? As I'm pinned to v1.87 and don't want to turn automatic updates on again until I know this has landed. |
The update that has been merged today will be in tomorrow's Insiders release and in next month's stable release :). Next month's stable release should come out around beginning of July |
To verify:
if(<some code>)
{}
if(<some code>)
{
....
} Here the dots represent the spaces. |
@aiday-mar That will be a TAB if VSCode is configured to use those instead, right ? |
Hi @FlowIT-JIT yes these should be tabs if you configured tabs for the file |
@aiday-mar, thank you. It works when typing, but still presents the issue when pasting. I have created a new issue for that scenario: #223308. |
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
This seems to happen on
for
andwhile
as well. In other languages auto-indentation doesn't happen after the first<enter>
in the example. While it could be good as a feature, it would be great if on typing the opening bracket, it would automatically un-indent. Also, it seems like the kind of thing that needs a toggle, because it can backfire in multiple ways.Another thing that I noticed was that the auto-indentation happens even if the
if
line is commented out.This was not a problem in the previous version.
The text was updated successfully, but these errors were encountered: