有没有办法用 vscode 自动格式化颤振? [英] Is there a way to auto-format flutter with vscode?

查看:37
本文介绍了有没有办法用 vscode 自动格式化颤振?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道是否有像 Eslint for Flutter/Dart 这样的库,它会在我保存文件时自动插入分号和尾随逗号.

I was wondering if there is a library like Eslint for Flutter/Dart that will automatically insert semicolons and trailing commas when I save the file.

FLutter 版本:1.22.3飞镖版本:2.10.3

FLutter Version: 1.22.3 Dart Version: 2.10.3

推荐答案

文档中有 Code Formatting 帮助区.有 VsCode 部分 这里.它解释了

There is a Code Formatting help area in the documentation.There is a section for VsCode Here. It explains that

要在当前源代码窗口中自动格式化代码,请在代码窗口中右键单击并选择格式化文档.您可以为此 VS Code 首选项添加键盘快捷键.

To automatically format the code in the current source code window, right-click in the code window and select Format Document. You can add a keyboard shortcut to this VS Code Preferences.

安装 Flutter 扩展后.

After installing the Flutter extension.

我还发现了另一个 Stack Overflow 帖子 此处 可以帮助您提供一些扩展建议以及一种在 VsCode 中/在 VsCode 中创建自己的绑定的方法.

I also found another Stack Overflow post Here that may be able to help you with a few extension suggestions and a way to make your own bindings for/in VsCode.

这篇关于有没有办法用 vscode 自动格式化颤振?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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