50 Star 612 Fork 63

starcwang / easy_javadoc

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Apache-2.0

easy_doc 点一下star✨,是对作者最大的支持

目前免费的【有道翻译】已被官方禁用,请大家更换别的翻译方式,各大平台都免费

最新版IDEA的AI Assistant插件和本插件快捷键冲突了,请修改任一一个。不要再问为啥不生效了。

交流Q群:733688083

介绍

本项目是IntelliJ IDEA的插件,能帮助java\kotlin开发者自动生成javadoc\kdoc文档注释
支持的IDEA版本为 2019.1 及以上

示例1

支持给中文起名字,类似程序员起名神器
示例2

  • 接入多种翻译,只要你方法名起的好,翻译就越准确
  • 可自定义映射,弥补自动翻译的不足
  • 支持文档翻译,选中需要翻译的文档,使用快捷键翻译注释,再也不用在词典和IDEA之间来回切换了

安装

打开IntelliJ IDEA -> plugins,java搜索Easy Javadoc,安装重启即可

视频教程

使用

  • 一闪一闪的光标放置到想要生成注释的类、方法或者属性上,然后按下快捷键ctrl \或者command \,即可生成注释,你的方法名起的越贴切,注释越得体。
  • 一闪一闪的光标放置到想要生成注释的类上,然后按下快捷键ctrl shift \或者command shift \,即可批量生成文档注释。(Kdoc暂不支持)
  • 光标选中要翻译的中文,然后按下快捷键ctrl \或者command \,即可自动变成英文,类似程序员起名神器。
  • 光标选中要翻译的非中文,然后按下快捷键ctrl \或者command \,即弹出选中的翻译结果,再也不用在词典和IDEA之间来回切换了。
  • 方法的@return注释样例
    • code模式
      • @return {@code User}
      • @return {@code Map<String, Integer>}
    • link模式
      • @return {@link User}
      • @return {@link Map}<{@link String}, {@link Integer}>

当然,翻译不准的情况很常见,如果是因为单词翻译错误,可以在配置页面对自己的单词进行配置,自定义翻译的优先级大于其他。

各个翻译每月都有免费额度,基本够用了。需要自己申请相关秘钥等

配置

打开配置页面 配置图 可看到相关配置

默认快捷键(可通过IDEA快捷键设置修改)

win

快捷键 作用域 说明
ctrl \ 类、方法、属性(光标放上面就行,不要双击选中!) 生成当前文档注释
ctrl \ 选中的中文 生成选中的中文的英文命名
ctrl \ 选中的非中文 弹框展示翻译结果
ctrl shift \ 生成全部文档注释

mac

快捷键 作用域 说明
command \ 类、方法、属性(光标放上面就行,不要双击选中!) 生成当前文档注释
command \ 选中的中文 生成选中的中文的英文命名
command \ 选中的非中文 弹框展示翻译结果
command shift \ 生成全部文档注释

常见问题

我的字体

系统字体 Comis Sans MS

系统字体

代码字体 Monaco

代码字体

快捷键( ctrl \ )不生效

检查:

  1. 一闪一闪的光标放到类名、方法名或属性名上试试,注意不是选中,也不是鼠标!!!
  2. 检查IDEA的快捷键是否冲突了

属性单行注释不生效

这是因为IDEA的默认格式化将单行转成了多行,需要更改IDEA的格式化设置单行注释

文档标签@param、@link或者自定义的顺序不对

这是因为IDEA的默认格式化将文档标签顺序改了,如果非得要自定义的顺序的话,则需要改IDEA如下设置关闭Javadoc格式化

更新履历

  • v3.7.1 2024-03-11
    • 支持自定义模式下,和已有doc合并
  • v3.7.0 2024-02-06
    • 当已经有注释的时候,不会生成新注释覆盖掉老的
    • 修复中译英在有停用词的情况下,首字母大写的问题
    • 支持系统HTTP代理
  • v3.6.0 2023-09-14
    • 支持微软免费翻译
  • v3.5.3 2023-09-13
    • 修复阿里云不兼容社区版问题
  • v3.5.2 2023-09-08
    • 修复阿里云中译英失败问题
  • v3.5.1 2023-09-06
    • 打印异常日志
    • 禁用掉免费有道接口
  • v3.5.0 2023-09-02
    • 异常支持读取已有类注释
    • 返回值支持读取已有类注释
    • 修复jdk问题导致的日期格式化结果不一致问题
  • v3.4.3 2023-08-09
    • 修复默认模板出现空行的问题
  • v3.4.2 2023-08-06
    • javadoc自定义模式支持结尾添加换行
    • 优化选中后的英译中切词翻译
  • v3.4.1 2023-07-31
    • 规范化displayName命名
  • v3.4.0 2023-06-24
    • 支持单词分割模式
    • 升级IDEA最小支持版本为2019
    • 修复package-info.java空指针问题
    • 修复多项目时当前分支名变量获取不到的问题
  • v3.3.1 2023-05-09
    • 修复类全路径问题
    • 自定义变量添加当前分支名变量
    • 控制弹窗频次,现在为新打开时弹窗
  • v3.3.0 2023-04-08
    • 支持微软翻译
    • 支持谷歌翻译
  • v3.2.0 2023-01-17
    • 支持有道智云翻译
  • v3.1.0 2022-12-24
    • 支持项目级单词映射
  • v3.0.1 2022-12-17
    • 修复kdoc空行问题
  • v3.0.0 2022-12-11
    • 支持kotlin语言,Kdoc生成
  • v2.0.1 2022-11-30
    • 修复一些问题
  • v2.0.0 2022-11-19
    • 重构
    • 支持kotlin
  • v1.29 2022-11-06
    • 优化一些问题
  • v1.28 2022-10-15
    • 优化导入导出文件(夹)选择界面
    • 优化一些问题
  • v1.27 2022-09-10
    • 支持阿里云翻译
    • 支持在方法上自定义see标签
    • 修复导入导出功能bug
    • 优化一些问题
  • v1.26 2022-07-13
    • 支持 package-info.java
  • v1.25 2022-03-18
    • 修复自定义方法返回值无法切换@code模式
  • v1.24 2022-03-16
    • 优化提醒弹出频率
  • v1.23 2022-03-13
    • 添加logo
    • 添加应用启动监听器
  • v1.22 2021-12-21
    • 记录上次选择的生成所有javadoc的选项
  • v1.21 2021-08-07
    • 方法的@return支持code和link两种模式
      • code模式
        • @return {@code User}
        • @return {@code Map<String, Integer>}
      • link模式
        • @return {@link User}
        • @return {@link Map}<{@link String}, {@link Integer}>
    • 优化了访问网络失败的提示
  • v1.20 2021-07-11
    • 修复了自定义模式下$PARAM$字段*丢失问题
  • v1.19 2021-07-03
    • 修复了自定义模式下@return问题
  • v1.18 2021-05-31
    • 支持整句的自定义映射
  • v1.17 2021-05-16
    • 支持自定义模式下,注释和方法不覆盖已有值
  • v1.16 2020-12-28
    • 修复了@throws标签不换行的问题
  • v1.15 2020-12-13
    • 修复了自定义模板,类、方法、属性不能单独配置的问题
  • v1.13 2020-08-29
    • 支持百度翻译和腾讯翻译,用户自定义秘钥
    • 为翻译添加缓存
    • 增加重置和清理缓存按钮
  • v1.12 2020-06-20
    • 修复了光标位置不对生成文档报空指针的问题
  • v1.11 2020-04-09
    • 修复了某些情况下自定义翻译失效的问题
  • v1.10 2020-02-12
    • 添加选中翻译功能
    • 修复bug
  • v1.9 2019-12-30
    • 修复了在windows下的异常
  • v1.8 2019-12-14
    • 支持配置导入和导出
    • 支持更多的IDEA版本
  • v1.7 2019-12-11
    • return使用短路径
    • 修复bug
  • v1.6 2019-12-08
    • 支持自定义格式文档
    • 支持中译英(命名神器)
    • 修复bug
  • v1.5 2019-11-30
    • 兼容问题处理
    • 支持更多IDEA版本
    • 修复了一些bug
  • v1.4 2019-11-25
    • 兼容自己的注释
    • 支持整句翻译
    • 方法支持@throws标签
    • 修复bug
  • v1.3 2019-11-13
    • 支持批量生成文档注释
    • 修复bug
  • v1.2 2019-10-24
    • 修复bug
  • v1.1 2019-10-23
    • 支持@link和@return标签
    • 修复bug
  • v1.0 2019-09-05
    • 第一版发布

贡献者

支持作者

如果觉得插件很赞,为你节约了不少时间,那么就请作者喝杯咖啡吧~☕☕☕

微信 支付宝
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

简介

本项目是IntelliJ IDEA的插件,能帮助java开发者自动生成javadoc文档注释 展开 收起
Java 等 2 种语言
Apache-2.0
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Java
1
https://gitee.com/starcwang/easy_javadoc.git
git@gitee.com:starcwang/easy_javadoc.git
starcwang
easy_javadoc
easy_javadoc
master

搜索帮助