IntelliJ IDEA似乎忽略了代码格式 [英] IntelliJ IDEA seems to be ignoring code formatting

查看:143
本文介绍了IntelliJ IDEA似乎忽略了代码格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图让我的Intellij IDEA确认类似谷歌的Java标准 - 但是导入和手动设置似乎都被忽略了。

I've been attempting to get my Intellij IDEA to confirm to a google-like Java standard - however both imports and manual settings seem to be ignored.

这里是我的缩进当前是如何设置的:

Here's how my indentations are currently set:

但是我的代码仍然在4个空格格式化,当我重新格式化时,它也会转到4个空格。

However my code still formats at 4 spaces, and when I reformat it goes to 4 spaces as well.

提前致谢!

推荐答案

这是 GoogleStyle 方案的设置。但是你的项目很可能不会使用它。仅仅在组合框中选择它是不够的。您需要将此方案导入到项目中。

This is the setting for your GoogleStyle scheme. But your project most likely doesn't use it. It's not enough to just select it in the combobox. You need to import this scheme into your project.

单击管理... 复制到项目,它应该按预期工作。

Click Manage... and Copy to Project, and it should work as expected.

此外,请确保您设置语言设置,所以改为代码样式选择代码样式> Java

Also, make sure you're setting language-spefic settings, so instead Code Style select Code Style > Java.

这篇关于IntelliJ IDEA似乎忽略了代码格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆