简体   繁体   English

如何在Intellij Idea上的“ if”,“ try”等…块之后获取换行的正确缩进?

[英]How to get correct indentation for new line after “if”,“try”, etc… blocks on Intellij Idea?

I started to use Idea after using Eclipse for years. 在使用Eclipse多年之后,我开始使用Idea。 Now I found some features of Idea very basically absent. 现在,我发现Idea的某些功能基本上不存在。 One of them is this; 其中之一是这个。 I write an if or try and a curly bracket { then I push Enter , new line comes with the same indentation of if : 我写了一个iftry和一个大括号{然后我按Enter ,新行带有与if相同的缩进:

// some code...
if (someBoolean) {
// <- cursor comes here
    // <- not here
}

How can I make this correct, and write new line without starting to write an extra tab ? 我如何才能做到这一点正确,并在不开始编写额外tab情况下写新行?

Edit: This happens on JavaScript files. 编辑:这发生在JavaScript文件上。 No problem when using Java. 使用Java时没问题。 I checked that there is no plugin available for "JavaScript Support" as it is mentioned in comments. 我检查了注释中提到的“ JavaScript支持”是否没有可用的插件。

As of today, there is no JavaScript Support plugin. 到目前为止,还没有JavaScript支持插件。 I can't find it by browsing it. 我无法通过浏览找到它。

This matrix explains the situation: http://jetbrains.com/idea/features/editions_comparison_matrix.html 该矩阵说明了这种情况: http : //jetbrains.com/idea/features/editions_comparison_matrix.html

There is no JavaScript support for Community Edition. 社区版不支持JavaScript。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Javascript 中分号后的新行上更正 Cursor 缩进 - Correct Cursor indentation on the new line after the semicolon in Javascript 如何获得第二行(第三行等)的缩进,以使用CSS使用自定义编号匹配列表中的第一行? - How can I get second (third, etc.) line indentation to match first line in a list with custom numbering using CSS? 如何在Codemirror中删除新行上的缩进 - How to remove indentation on new line in Codemirror 如何在IDEA Intellij中配置新文件的创建 - How to configure creation of new files in IDEA Intellij 如何让 IntelliJ IDEA 显示目录? - How do I get IntelliJ IDEA to display directories? 如何根据格式不同的另一文本(缩进等)获取子字符串? - How to get a substring according to one text inside another text which varies in format (indentation, etc)? Intellij 的想法无法识别 mochajs 关键字,如“描述”、“之前”、“它”等 - Intellij idea not recognizing mochajs keywords like 'describe', beforeAll, it, etc 车把小胡子,在没有新线的情况下进行缩进? - Handlebars Mustache, Make Indentation Without New Line? 如何在 KonvaJS 中转换后获得新的线点 - How to get new points of line after transformation in KonvaJS 如何使WebStorm自动添加新行并粘贴左缩进括号 - How to make WebStorm automatically add new line and paste left indentation for braces
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM