首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >在Intellij Idea中禁用java文档自动格式化。2019

在Intellij Idea中禁用java文档自动格式化。2019
EN

Stack Overflow用户
提问于 2020-02-16 05:09:07
回答 1查看 166关注 0票数 0

我希望我的javadoc看起来像这样:

代码语言:javascript
复制
/**
* Date 10/01/2019
*
* Given a directed graph, find all strongly connected components in this graph.
* We are going to use Kosaraju's algorithm to find strongly connected       component.
*
* Algorithm
* Create a order of vertices by finish time in decreasing order.
* Reverse the graph
* Do a DFS on reverse graph by finish time of vertex and created strongly connected
* components.
*
* Runtime complexity - O(V + E)
* Space complexity - O(V)
*
* References
* https://en.wikipedia.org/wiki/Strongly_connected_component
* http://www.geeksforgeeks.org/strongly-connected-components/
*/

但不幸的是,我的javadoc被自动格式化为:

代码语言:javascript
复制
/**
* Given a directed acyclic graph, find all connected components in the graph.       We will be using
* Kosaraju’s algorithm for finding all connected components
*
* <p>Algorithm :
*
* <p>Do DFS on the graph, mark the adjacent vertices as visited and order the visited vertex
*
* <p>Reverse the graph - transpose<>
*
* <p>Do DFS on the reversed graph, by pop- ing elements from the stack and marking them as visited
*
* <p>Complexity:
*
* <p>Runtime - O(V+E) for DFS
*
* <p>Space = O(V) for the stack and visited vertices
*
* <p>Date : 15/02/20
*
*
* <p>Referances : https://www.youtube.com/watch?v=RpgcYiky7uw
* https://www.geeksforgeeks.org/strongly-connected-components/
*/

如果我手动添加换行符并开始在下一行上写入,则在代码格式化过程中,两行将合并为一行。我可以在下一行写的唯一方法是添加两个换行符,因此在代码格式化过程中ide会添加

添加到新行

假设我想分开

在图形上执行DFS,将相邻顶点标记为已访问,并对已访问的顶点进行排序

分成两行,但是一旦我重新格式化代码,这两行就合并成一行。

我使用google-java-format进行代码格式化。

我试着修改代码风格的-> Java -> JavaDoc选项,但不知何故发生了变化。似乎不起作用

EN

回答 1

Stack Overflow用户

发布于 2020-02-17 17:51:23

要避免在JavaDoc中合并行,您可以打开(首选项|编辑器|代码样式| Java | JavaDoc)并取消选中“在右边距换行”复选框。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60243165

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档