[Feature] 编辑器支持 Annotate with Git Blame:行号旁显示修改日期 / 修改人,点击跳转到对应提交

Abierto
#2,677 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
5/5
Tiempo estimado
Más de una semana
Aptitud para principiantes
35/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
git, typescript

Línea de trabajo

Start by inspecting the editor’s line number context menu and the existing “使用 Git Blame 注释” implementation, then trace how Git History opens commit details. The issue describes the desired gutter annotations, hover details, click behavior, and context menu actions, but does not name files or tests. Done means blame annotations can be toggled per file, show date and author, expose commit details and navigation, and avoid full-file blame on every edit.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

enhancement issue-form:feature review: low
Problem to solve / 要解决的问题

当前 Lithe 已有“使用 Git Blame 注释”,但它打开的是一个弹框:

  • 弹框里的 Blame 历史无法点击,无法定位 / 跳转到对应的 Git 提交历史,也看不到该提交的改动内容;
  • 看完弹框要关掉再去 Git History 面板里手动找提交,流程是断的,排查“这行是谁、什么时候、为什么改的”很不方便。
Proposed solution / 建议方案

参考 IntelliJ IDEA 的 Annotate with Git Blame 实现:

  1. 入口:在编辑器行号区域右键菜单中增加 Annotate with Git Blame(与 IDEA 同名,便于 IDEA 用户找到),可开关,再次点击 / 选择 Close Annotations 关闭。
  2. 展示位置:开启后,在行号右侧、代码左侧增加一列注释(annotation gutter),按提交分块显示,每行 / 每块只显示两项,和 IDEA 一致,不需要短 hash:
    • 修改日期(如 2026/6/23)
    • 修改人
    • 未提交的行明确标注 Uncommitted changes
  3. Hover 即看提交历史:鼠标移到某一行注释上,弹出该行的提交信息(commit、Author、Date、提交说明),不用点开、不用跳转就能先看一眼。
  4. 可点击跳转:点击某一行的注释,直接跳转到对应的 Git 提交历史 / 提交详情(提交信息、改动文件、diff),而不是只能看列表。
  5. 配套操作(参考 IDEA):
    • 右键注释:Show History / 显示行历史、Show Diff、Copy Revision Number
  6. 性能:只对当前文件 / 可见范围做 blame,避免每次输入都全量重新 blame(之前 #343、#187 有过类似回归)。

现有弹框形式的“使用 Git Blame 注释”可保留作为补充,但不应是唯一的 Blame 查看方式;行内 Blame(inline blame)也不应替代 gutter 注释,两者可共存。

Target platform / 目标平台

macOS

Area / 模块

Editor / 编辑器

Priority / 优先级

P2 / 后续考虑:目前不着急,可安排到后续版本

Alternatives considered / 已考虑的替代方案
  • 继续用弹框 + 手动去 Git History 里找提交:能用,但每次都要多步查找,且无法从行直接定位提交。
  • 用“显示行历史”:只能看单行历史,无法像 Annotate 一样一眼扫过整个文件的修改分布。
Additional context / 补充信息

Lithe 版本:0.8.26
操作系统与架构:macOS Version 27.2.1 (Build 26B131) · arm64
环境信息:build: b963c8a · 2026-12-03;runtime: go1.27.4

  • 参考:IntelliJ IDEA 右键行号菜单中的 Annotate with Git Blame(见截图 1),开启后注释列直接显示在行号旁。
  • 现状:Lithe 行号右键菜单中的“使用 Git Blame 注释”(见截图 2)目前是弹框展示,弹框内历史不可点击、不可定位提交。
  • 相关已关闭 Issue:#451、#1128 当时提的正是这个需求,现实现为弹框,未达到 IDEA 式 gutter 注释 + 点击跳转的效果,故新开此 Issue 作为后续跟进。

截图说明:

  1. IDEA 的 Annotate with Git Blame 菜单
  2. Lithe 现有行号右键菜单,“使用 Git Blame 注释”
  3. IDEA 注释列只显示日期 + 修改人,hover 弹出对应提交的 commit / Author / Date / 提交说明
image-8e675ea9 image-fef2d5c2 image-4b2922c0
Checklist / 提交前检查
  • I searched existing issues for duplicates. / 我已搜索现有 Issue,确认没有重复建议。
Lenguaje dominante
TypeScript
Estrellas
1.8k
Forks
151
Merge medio
3 h 13 min
PR fusionados (30 d)
614

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de 1lck/Lithe-IDEA

Todos los issues de 1lck/Lithe-IDEA

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.