Preventing Eclipse Formatting for Specific Code Sections
When working with code that is formatted semantically across multiple lines, the Eclipse formatter can inadvertently alter the desired formatting.对于SQL语句之类的代码,这可能是尤其有问题的,在IDE格式化时,这些代码很难读取和维护。
在3.6及以后的consyntax and Contrant and Contrants in Contrants Intermuss中,可以解决此问题。 @formatter:关闭 ... // @formatter:on在这些注释块中,将禁用Eclipse Formatter。要在这些块中启用格式化器,请使用// @formatter:on。。
单击→
nable off/nabs// @formatter:off ... // @formatter:on
的成员都意识到off/on tag上的of/on tag上的格式,并相应地配置他们的格式化。在Javadoc注释中,由于这可能会引起Javadoc生成的问题。
通过在标签上使用这些问题,开发人员可以有效防止Eclipse自动格式化Java代码的特定段,从而维护所需的垂直格式,以易于阅读和维护。
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3