Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Groovy formatter/beautifier in Visual Studio Code [closed]

Tags:

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?

like image 570
Saikat Avatar asked Jul 14 '18 04:07

Saikat


People also ask

How do I add code formatter in Visual Studio code?

The code formatting is available in Visual Studio Code through the following shortcuts: On Windows Shift + Alt + F. On Mac Shift + Option + F.

How do I turn on beautify VS Code?

To do this, go to File->Preferences->Settings: Under Text Editor, select Format On Save. Now when saving a file, it will be beautified. THANKS FOR READING.

What is prettier code formatter in VS Code?

Prettier is an opinionated code formatter which ensures one unified code format. It can be used in VS Code by installing it from the VS Code Marketplace. Once you have integrated it in VS Code, you can configure Prettier to format your files when saving them or committing them to a version control system (e.g. Git).


1 Answers

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.

like image 104
Jesse S Avatar answered Sep 21 '22 09:09

Jesse S