简体   繁体   English

镖。 主意。 如何防止格式合并为单行

[英]Dart. Idea. How to prevent formatting from merging into single line

I'm trying to set new formatting for me.我正在尝试为我设置新的格式。 Because of this problem.因为这个问题。

Before auto format.在自动格式化之前。

在此处输入图片说明

After auto format.自动格式化后。 在此处输入图片说明

I checked Idea Settings.我检查了想法设置。 But seems there are not too many settings for Dart.但似乎 Dart 没有太多设置。 I have removed all the setting with line merging.我已经通过行合并删除了所有设置。 But above issue still exist.但上述问题仍然存在。 For example.例如。 This setting, which should work, but it doesn't.这个设置应该可以工作,但它没有。

在此处输入图片说明

Any suggestion?有什么建议吗?

I have this problem too我也有这个问题

My solution is "Select the range I want to auto format and click Ctrl+Alt+L"...我的解决方案是“选择我想要自动格式化的范围并单击 Ctrl+Alt+L”...

I have given up auto format all...我已经完全放弃了自动格式化...

End each line you don't want to be affected by formatting with "//":以“//”结束您不希望受格式影响的每一行:

[1, 2, 3]
      .map((a) => 0) //
      .map((a) => 1); //
var x = [ 
  0, 1, 2, //
  3, 4, 5 //
]; 

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

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