为什么我的VS Code在括号内按回车时没有显示缩进?

huangapple go评论63阅读模式
英文:

Why my vscode is not showing indent while I press enter in brackets

问题

I don't know the reason but my vscode is not working properly because whenever I press enter in bracket it automatically adds indent and this beautifies the code, but I don't know why it's stopped now.

Expected:

if(--------) {
    Statement 1
}

Actual:

if(------) {
Statement 1}

Editor: Indent-auto detailed screenshot

Editor: Intent-auto screenshot

英文:

I don't know the reason but my vscode is not working properly

because whenever i press enter in bracket it automatically add indent and this beautifies the code but i don't know why it's stopped now

Expected

if(--------) {
    Statement 1
}

Actual

if(------) {
Statement 1}

Editor:Indent-auto detailed screenshot

Editor:Intent-auto screenshot

答案1

得分: -1

你一定搞乱了设置
有两件事你应该尝试做

尝试检查缩进设置

通过按下 Ctrl + , 打开你的 VSCode 设置
搜索 "Auto Indent"。
确保选项 <Editor:Auto Indent> 已启用。

如果你是初学者,尝试将 VS Code 设置为默认首选项

通过按下 Ctrl + Shift + P 打开命令面板
进入 "首选项"
单击三个点,然后选择 "重置为默认值"。

英文:

You must have messed up the settings
There are two things you shud try doing

Try checking the indentation settings

> Open your VSCode settings by pressing Ctrl + ,
> Search for "Auto Indent".
> Make sure the option for <Editor:Auto Indent> is enabled.

If you are beginner try setting the vs code settings to default preferences

> Open the Command Palette by pressing Ctrl + Shift + P
> Go to "Preferences
> Click the three dots and choose "Reset to Defaults"

huangapple
  • 本文由 发表于 2023年2月18日 15:54:03
  • 转载请务必保留本文链接:https://go.coder-hub.com/75491948.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定