✨ feat(vscode): 「未提交的更改」分暂存区两组、单文件暂存、隐藏测试文件

- 照源代码管理视图分「暂存的更改」「更改」两组(空的不摆,分组行写文件数),部分暂存的文件两组都有
- 「更改」组的文件行上加「暂存」按钮,走 git 扩展的 repository.add
- 标题栏「隐藏测试文件 / 显示测试文件」开关,按工作区记住,藏了几个写在标题后面;测试文件的判断集中在 isTestFile
- 以上只在「未提交的更改」里有:普通文件树、审查模式的行和菜单不变
This commit is contained in:
cruldra committed 2026-09-30 06:30:54 +08:00
1 parent a3b04a443b
commit 87d4360704
14 files changed
+528 -129

No files matched your search

+4
View File
@@ -53,6 +53,8 @@ export interface GitRepository {
readonly state: GitRepositoryState
/** 重读这个仓库的 git 状态 */
status: () => Promise<void>
/** 把这些文件(绝对路径)放进暂存区,同 git add:新文件、删掉的、冲突的都行 */
add: (paths: string[]) => Promise<void>
}
/** initialized 之前 git 扩展还在找工作区里的仓库,repositories 可能不全。 */
@@ -64,6 +66,8 @@ export interface GitApi {
readonly repositories: readonly GitRepository[]
readonly onDidOpenRepository: Event<GitRepository>
readonly onDidCloseRepository: Event<GitRepository>
/** 文件所在的仓库(按路径找,删掉的文件也行);不在任何打开的仓库里时 null */
getRepository: (uri: Uri) => GitRepository | null
}
/** vscode.git 扩展激活后导出的东西。 */