Reputation: 757
I am looking for solution for importing Eclipse Java Formatter Profile in Visual Studio Code. In order to go with coding complaince. For example in IntelliJ and Eclipse for Java we do this way:
IntelliJ
Now, every time Intellij uses its auto-formatting features, it will conform to the standards in the config file. This can be done quickly with the shortcut Ctrl+Alt+L.
Eclipse
Now, every time Eclipse uses its auto-formatting features, it will conform to the standards in the config file. This can be done quickly with the shortcut Ctrl+Shift+F.
Note: This profile might not work while formatting xml files. So go to Preferences -> XML -> Editor
I need to know the same alternative for Visual Studio Code. Please share any pointers !
Upvotes: 16
Views: 16163
Reputation: 2687
Visual Studio Code
You can use Eclipse Java Formatter Profile in VS Code like this:
java.format.settings.url
: Set URL (or local file path) pointing to Eclipse Formatter Profile file.See this wiki page for more information.
P.S. Also take a look at EditorConfig which has native or plugin support for multiple IDEs / editors.
Upvotes: 13