Groovy formatter/beautifier in Visual Studio Code

非 Y 不嫁゛ 提交于 2020-02-26 09:02:06

问题


For supported files in VSCode we get an option (when you right click on the file editor) to Format Document (ALT+SHIFT+F).

But unfortunately for Groovy this option is not available. And according to the VSCode community, there are no plans to implement this feature.

Is there an alternative solution available, specifically for VSCode?


回答1:


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.




回答2:


It would only be available via an extension, which you can search for in the marketplace.

Unfortunately it doesn't look like there are many extensions for Groovy at all. And if that can be considered an indication of the language's popularity, it's highly unlikely that broad support would ever be added to VS Code out of the box.



来源:https://stackoverflow.com/questions/51335369/groovy-formatter-beautifier-in-visual-studio-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!