[英]Need to import Eclipse Java Formatter profile in Visual Studio Code
I am looking for solution for importing Eclipse Java Formatter Profile in Visual Studio Code.我正在寻找在 Visual Studio Code 中导入 Eclipse Java Formatter Profile 的解决方案。 In order to go with coding complaince.
为了配合编码抱怨。 For example in IntelliJ and Eclipse for Java we do this way:
例如在 IntelliJ 和 Eclipse for Java 中,我们这样做:
IntelliJ智能
Now, every time Intellij uses its auto-formatting features, it will conform to the standards in the config file.现在,每次 Intellij 使用其自动格式化功能时,它都会符合配置文件中的标准。 This can be done quickly with the shortcut Ctrl + Alt + L .
这可以通过快捷键Ctrl + Alt + L快速完成。
Eclipse日食
Now, every time Eclipse uses its auto-formatting features, it will conform to the standards in the config file.现在,每次 Eclipse 使用其自动格式化功能时,它都会符合配置文件中的标准。 This can be done quickly with the shortcut Ctrl + Shift + F .
这可以通过快捷键Ctrl + Shift + F快速完成。
Note: This profile might not work while formatting xml files.注意:此配置文件在格式化 xml 文件时可能不起作用。 So go to Preferences -> XML -> Editor
所以去 Preferences -> XML -> Editor
I need to know the same alternative for Visual Studio Code .我需要知道Visual Studio Code的相同替代方案。 Please share any pointers !
请分享任何指针!
Visual Studio Code视觉工作室代码
You can use Eclipse Java Formatter Profile in VS Code like this:您可以像这样在 VS Code 中使用 Eclipse Java Formatter Profile:
java.format.settings.url
: Set URL (or local file path) pointing to Eclipse Formatter Profile file.java.format.settings.url
:设置指向 Eclipse 格式化程序配置文件的 URL(或本地文件路径)。 See this wiki page for more information.有关更多信息,请参阅此wiki 页面。
PS Also take a look to at EditorConfig which has native or plugin support for multiple IDEs / editors. PS 另请查看EditorConfig ,它为多个 IDE/编辑器提供本机或插件支持。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.