在 Visual Studio 2015 中为 Java 启用自动格式设置
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/30902811/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Enable automatic formatting for Java in Visual Studio 2015
提问by dimitris93
I downloaded the Java templatefor Visual Studio 2015, but it doesn't seem to have intelli-sense or format the code like it does with C, C++ and C#. It doesn't even mark error lines with red. It is basically just like notepad, but it compiles just fine.
我下载了Visual Studio 2015的Java 模板,但它似乎没有智能感知或像使用 C、C++ 和 C# 那样格式化代码。它甚至没有用红色标记错误行。它基本上就像记事本一样,但它编译得很好。
Is there a way to enable that, or it is impossible?
有没有办法启用它,或者不可能?
回答by Mathieu K.
I cannot with authority say that it's impossible, but I've never heard of anyone using VS to do Java development.
我不能权威地说这是不可能的,但我从未听说过有人使用 VS 进行 Java 开发。
回答by tirz
As proposed in Beautify(Format) Java code in Visual Studio Codeyou may take a look at Language support for Java ? for Visual Studio Code.
正如在 Visual Studio Code中的Beautify(Format) Java code 中提出的, 您可以查看Language support for Java ? 用于 Visual Studio 代码。
It will look like that:
它看起来像这样: