简体   繁体   中英

How to stop vscode from removing indent when closing curly braces

hope you guys can help me out, vscode is removing the indentation when I close curly braces and this is annyoing me, here is a gif of what's happenning

vscode removing indent

Change Auto Indent in your settings (Text editor) to keep from full . (see screenshot below)

自动缩进设置

Note: It can affect something another, but it fixes the problem.

The reason is your VS code doesn't know about JSX in your JS files. Try to change your user settings or workspace settings as below:

// Place your settings in this file to overwrite the default settings
{
    "files.associations": {
        "*.js": "javascriptreact"
    }
}

Note: You might need to restart VSCode.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM