Visual Studio Code中的Groovy格式化程序/美化程序 [英] Groovy formatter/beautifier in Visual Studio Code
问题描述
对于VSCode中受支持的文件,我们可以选择(当您右键单击文件编辑器时)格式化文档(ALT + SHIFT + F)
。
For supported files in VSCode we get an option (when you right click on the file editor) to Format Document (ALT+SHIFT+F)
.
但不幸的是,对于Groovy而言,此选项不可用。并且根据VSCode社区,没有计划实现此功能。
But unfortunately for Groovy this option is not available. And according to the VSCode community, there are no plans to implement this feature.
是否有替代解决方案,专门用于VSCode? p>
Is there an alternative solution available, specifically for VSCode?
推荐答案
我不知道除了缩进以外,还不知道这种格式的效果如何,但我只是将文件扩展名从.groovy更改为.js,右键单击文件,然后选择设置文档格式。它为我解决了缩进问题。
I don't know how well this works for formatting other than indentation, but I simply changed the file extension from .groovy to .js, right clicked in the file, and selected "Format Document". It fixed the indentation for me.
这篇关于Visual Studio Code中的Groovy格式化程序/美化程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!