如何使用IntelliJ格式化包装代码? [英] How to have the formatter wrap code with IntelliJ?

查看:180
本文介绍了如何使用IntelliJ格式化包装代码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在IntelliJ中格式化我的代码。

I'm not able to format my code in IntelliJ.

我可以看到保证金线(默认为120列),但似乎从菜单激活:

I can see the margin line (by default at 120 columns) but it seems that the activation from the menu:


代码 - >重新格式代码

Code -> Reformat Code

只是忽略了这个边际。

推荐答案

你的意思是格式化程序不会破坏长行吗?检查设置/项目设置/代码样式/环绕。

Do you mean that the formatter does not break long lines? Check Settings / Project Settings / Code Style / Wrapping.

更新:在更高版本的IntelliJ中,该选项位于设置/编辑器/代码样式下。并选择输入时输入到右边距

Update: in later versions of IntelliJ, the option is under Settings / Editor / Code Style. And select Wrap when typing reaches right margin.

这篇关于如何使用IntelliJ格式化包装代码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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