简体   繁体   English

如何防止 Visual Studio Code Flutter/Dart Editor 格式化新行/换行代码?

[英]How to prevent Visual Studio Code Flutter/Dart Editor from formatting new line/wrapping code?

I recently started working on Flutter/Dart, I like the flutter autoformatting on-save, but one thing might or might not be related is the code wrapping for long code even if code is still fitting my 4k editor window.我最近开始研究 Flutter/Dart,我喜欢 flutter 在保存时自动格式化,但有一件事可能或可能不相关是长代码的代码包装,即使代码仍然适合我的 4k 编辑器 window。

Is there a way to prevent new line but keep the comma auto format?有没有办法防止换行但保持逗号自动格式?

Thanks谢谢

自动格式化为新行的代码示例

.vscode/settings.sjon

Follow the instructions below:请按照以下说明进行操作:

  1. Open Settings .打开Settings
  2. Expand Extensions and click Dart & Flutter on the left.展开Extensions并单击左侧的Dart & Flutter
  3. Find Dart: Line Length .查找Dart: Line Length
  4. Change it to the value you want.将其更改为您想要的值。

在此处输入图像描述

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

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