改进 IntelliJ 注释(git 责备) [英] Improve IntelliJ annotate (git blame)

查看:30
本文介绍了改进 IntelliJ 注释(git 责备)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想改进注释选项"(右键单击代码行号冒号 -> 注释),它类似于 git blame (但集成到 IntelliJ).

I'd like to improve the "annotate option" (right click on code line number colon -> annotate), which is similar to git blame (but integrated to IntelliJ).

1/有可能吗?(通过插件或对 IntelliJ 文件的原始修改?其他什么?)
2/我使用的是 Android Studio(基于 IntelliJ),会不会有问题?
3/如果 1/&2/是真的,关于如何开始的任何提示?

1/ Is it possible ? (via plugin or raw modification of IntelliJ files ? something else ?)
2/ I'm on Android Studio (based on IntelliJ), will it be an issue ?
3/ If 1/ & 2/ are true, any tips on how to start ?

PS:我的目标不是在 annonate 中显示一些提交(如重新格式化"),因为它们不提供有关代码历史的关键信息.

PS : My goal is not to display some commits (like "Reformat") in the annonate because they do not provide crucial informations about code history.

推荐答案

IntelliJ 没有实现自己的处理注释的逻辑.相反,它会调用 git 的原生blame 命令.

IntelliJ doesn't implement its own logic for handling annotations. Instead it calls out to the git's native blame command.

默认情况下,它在进行提取时使用 -w 标志,因此在输出中将忽略对行的仅空白更改.不幸的是,这些选项是 硬编码在插件中,用户无法调整.

By default, it uses the -w flag when making the fetch, so white-space-only changes to lines will be ignored in the output. Unfortunately, these options are hard-coded in the plugin, and cannot be adjusted by the user.

粗略搜索没有找到另一个提供附加选项的插件的结果,但您始终可以提交功能请求以获取附加注释选项.

A cursory search yielded no results for another plugin that would provide additional options, but you could always submit a feature request for additional annotate options.

GUI 设计人员倾向于只提供对开发人员日常操作所需的功能和选项的轻松访问.他们假设如果您需要更多功能,或者是维护者,您将使用命令行,它提供了更多 options 任何 IDE 都可以合理地为其实现 GUI.

GUI designers tend to only bother providing easy access to the features and options necessary for daily operation by developers. They assume that if you need more power, or are a maintainer, you'll use the command line, which offers a lot more options any IDE can reasonably implement a GUI for.

这篇关于改进 IntelliJ 注释(git 责备)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆