You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

945 lines
33 KiB

Workspaces sidebar view (#2650) * Adds workspaces view Adds skeleton UX outline with hardcoded sample Pull workspaces from api (hacky version) Barebones workspace service, api support to get cloud workspaces Fixes node/api interaction Makes virtual repo nodes for repos using remote url Clean up formatting, rename types, add path provider skeleton Adds workspaces local provider, loads local workspaces, uses saved repo paths Add local path provider, use to resolve paths Adds some handling of workspace repo node types - Adds context of workspace to repo node - Adds missing repo node for when the repo isn't located - Adds green decorator for when the repo is in the current workspace (hacky) Adds locate command for workspace repos Use correct refresh trigger on repo node path change Adds other workspaces api functions, splits calls for workspaces and their repos Adds ux for creating/deleting cloud workspaces Adds UX for adding and removing repos from cloud workspaces Moves locate repo logic to service Makes top-level refresh more functional Fixes a few broken calls Adds sub state responsiveness, UX for plus feature, empty workspace msg Fixes bad request formats, saves on calls to api Adds UX to include all open supported repos in new workspace Pass workspace id down repository node hierarchy Prevents id conflicts when two or more workspaces have the same repo Cleanup More informative tooltip, identify shared workspaces from cloud Splits out web and local path providers Adds more error logging and handling Fixes path provider naming Send workspace fetch info to view, Fixes path formatting Add commands to context menu of items Adds the ability to open workspace as a code workspace file Fixes redundant api calls and bad paths, adds logging for getRepos Preserves settings if overwriting existing code-workspace * Refines menus/toolbars * Adds sign in action to message node * Renames & moves Workspaces to GitLens container * Renames command for opening as vscode workspace * Collapses repo nodes in workspaces by default * Removes unnecessary messaging for missing local workspaces * Disables virtual repo support for now * Fixes "open as vs code workspace" appearing on missing repo nodes * Adds "open repo in new/current window" to workspace repos * Adds "add repo to workspace" to workspace repo context menu * Saves workspace id in settings when converting to code-workspace * Updates namespace of settings key * Adds option to locate all repos in workspace using parent path * Adds current window node and "convert to gk workspace" action * Fixes issue with single repo locate * Improves missing repo nodes, removes deletion from inline * Hides inline items which should not appear without plus account * wip * wip2 * wip 3 * Fixes issue with adding repos to created workspace * Moves cache reset on sub change to service * Fixes bug with legacy local workspaces mapping filepath --------- Co-authored-by: Eric Amodio <eamodio@gmail.com>
1 year ago
  1. import type { ViewShowBranchComparison } from './config';
  2. import type { Environment } from './container';
  3. import type { StoredSearchQuery } from './git/search';
  4. import type { Subscription } from './subscription';
  5. import type { TrackedUsage, TrackedUsageKeys } from './telemetry/usageTracker';
  6. export const extensionPrefix = 'gitlens';
  7. export const quickPickTitleMaxChars = 80;
  8. export const ImageMimetypes: Record<string, string> = {
  9. '.png': 'image/png',
  10. '.gif': 'image/gif',
  11. '.jpg': 'image/jpeg',
  12. '.jpeg': 'image/jpeg',
  13. '.jpe': 'image/jpeg',
  14. '.webp': 'image/webp',
  15. '.tif': 'image/tiff',
  16. '.tiff': 'image/tiff',
  17. '.bmp': 'image/bmp',
  18. };
  19. export const enum CharCode {
  20. /**
  21. * The `#` character.
  22. */
  23. Hash = 35,
  24. /**
  25. * The `/` character.
  26. */
  27. Slash = 47,
  28. Digit0 = 48,
  29. Digit1 = 49,
  30. Digit2 = 50,
  31. Digit3 = 51,
  32. Digit4 = 52,
  33. Digit5 = 53,
  34. Digit6 = 54,
  35. Digit7 = 55,
  36. Digit8 = 56,
  37. Digit9 = 57,
  38. /**
  39. * The `\` character.
  40. */
  41. Backslash = 92,
  42. A = 65,
  43. B = 66,
  44. C = 67,
  45. D = 68,
  46. E = 69,
  47. F = 70,
  48. Z = 90,
  49. a = 97,
  50. b = 98,
  51. c = 99,
  52. d = 100,
  53. e = 101,
  54. f = 102,
  55. z = 122,
  56. }
  57. export type Colors =
  58. | `${typeof extensionPrefix}.closedAutolinkedIssueIconColor`
  59. | `${typeof extensionPrefix}.closedPullRequestIconColor`
  60. | `${typeof extensionPrefix}.decorations.addedForegroundColor`
  61. | `${typeof extensionPrefix}.decorations.branchAheadForegroundColor`
  62. | `${typeof extensionPrefix}.decorations.branchBehindForegroundColor`
  63. | `${typeof extensionPrefix}.decorations.branchDivergedForegroundColor`
  64. | `${typeof extensionPrefix}.decorations.branchMissingUpstreamForegroundColor`
  65. | `${typeof extensionPrefix}.decorations.branchUpToDateForegroundColor`
  66. | `${typeof extensionPrefix}.decorations.branchUnpublishedForegroundColor`
  67. | `${typeof extensionPrefix}.decorations.copiedForegroundColor`
  68. | `${typeof extensionPrefix}.decorations.deletedForegroundColor`
  69. | `${typeof extensionPrefix}.decorations.ignoredForegroundColor`
  70. | `${typeof extensionPrefix}.decorations.modifiedForegroundColor`
  71. | `${typeof extensionPrefix}.decorations.statusMergingOrRebasingConflictForegroundColor`
  72. | `${typeof extensionPrefix}.decorations.statusMergingOrRebasingForegroundColor`
  73. | `${typeof extensionPrefix}.decorations.renamedForegroundColor`
  74. | `${typeof extensionPrefix}.decorations.untrackedForegroundColor`
  75. | `${typeof extensionPrefix}.decorations.workspaceCurrentForegroundColor`
  76. | `${typeof extensionPrefix}.decorations.workspaceRepoMissingForegroundColor`
  77. | `${typeof extensionPrefix}.decorations.workspaceRepoOpenForegroundColor`
  78. | `${typeof extensionPrefix}.decorations.worktreeHasUncommittedChangesForegroundColor`
  79. | `${typeof extensionPrefix}.decorations.worktreeMissingForegroundColor`
  80. | `${typeof extensionPrefix}.gutterBackgroundColor`
  81. | `${typeof extensionPrefix}.gutterForegroundColor`
  82. | `${typeof extensionPrefix}.gutterUncommittedForegroundColor`
  83. | `${typeof extensionPrefix}.lineHighlightBackgroundColor`
  84. | `${typeof extensionPrefix}.lineHighlightOverviewRulerColor`
  85. | `${typeof extensionPrefix}.mergedPullRequestIconColor`
  86. | `${typeof extensionPrefix}.openAutolinkedIssueIconColor`
  87. | `${typeof extensionPrefix}.openPullRequestIconColor`
  88. | `${typeof extensionPrefix}.trailingLineBackgroundColor`
  89. | `${typeof extensionPrefix}.trailingLineForegroundColor`
  90. | `${typeof extensionPrefix}.unpublishedChangesIconColor`
  91. | `${typeof extensionPrefix}.unpublishedCommitIconColor`
  92. | `${typeof extensionPrefix}.unpulledChangesIconColor`;
  93. export type CoreColors =
  94. | 'editorOverviewRuler.addedForeground'
  95. | 'editorOverviewRuler.deletedForeground'
  96. | 'editorOverviewRuler.modifiedForeground'
  97. | 'list.foreground'
  98. | 'list.warningForeground'
  99. | 'statusBarItem.warningBackground';
  100. export const enum Commands {
  101. ActionPrefix = 'gitlens.action.',
  102. AddAuthors = 'gitlens.addAuthors',
  103. BrowseRepoAtRevision = 'gitlens.browseRepoAtRevision',
  104. BrowseRepoAtRevisionInNewWindow = 'gitlens.browseRepoAtRevisionInNewWindow',
  105. BrowseRepoBeforeRevision = 'gitlens.browseRepoBeforeRevision',
  106. BrowseRepoBeforeRevisionInNewWindow = 'gitlens.browseRepoBeforeRevisionInNewWindow',
  107. ClearFileAnnotations = 'gitlens.clearFileAnnotations',
  108. CloseUnchangedFiles = 'gitlens.closeUnchangedFiles',
  109. CloseWelcomeView = 'gitlens.closeWelcomeView',
  110. CompareWith = 'gitlens.compareWith',
  111. CompareHeadWith = 'gitlens.compareHeadWith',
  112. CompareWorkingWith = 'gitlens.compareWorkingWith',
  113. ComputingFileAnnotations = 'gitlens.computingFileAnnotations',
  114. ConnectRemoteProvider = 'gitlens.connectRemoteProvider',
  115. CopyAutolinkUrl = 'gitlens.copyAutolinkUrl',
  116. CopyCurrentBranch = 'gitlens.copyCurrentBranch',
  117. CopyDeepLinkToBranch = 'gitlens.copyDeepLinkToBranch',
  118. CopyDeepLinkToCommit = 'gitlens.copyDeepLinkToCommit',
  119. CopyDeepLinkToComparison = 'gitlens.copyDeepLinkToComparison',
  120. CopyDeepLinkToRepo = 'gitlens.copyDeepLinkToRepo',
  121. CopyDeepLinkToTag = 'gitlens.copyDeepLinkToTag',
  122. CopyDeepLinkToWorkspace = 'gitlens.copyDeepLinkToWorkspace',
  123. CopyMessageToClipboard = 'gitlens.copyMessageToClipboard',
  124. CopyRemoteBranchesUrl = 'gitlens.copyRemoteBranchesUrl',
  125. CopyRemoteBranchUrl = 'gitlens.copyRemoteBranchUrl',
  126. CopyRemoteCommitUrl = 'gitlens.copyRemoteCommitUrl',
  127. CopyRemoteComparisonUrl = 'gitlens.copyRemoteComparisonUrl',
  128. CopyRemoteFileUrl = 'gitlens.copyRemoteFileUrlToClipboard',
  129. CopyRemoteFileUrlWithoutRange = 'gitlens.copyRemoteFileUrlWithoutRange',
  130. CopyRemoteFileUrlFrom = 'gitlens.copyRemoteFileUrlFrom',
  131. CopyRemoteIssueUrl = 'gitlens.copyRemoteIssueUrl',
  132. CopyRemotePullRequestUrl = 'gitlens.copyRemotePullRequestUrl',
  133. CopyRemoteRepositoryUrl = 'gitlens.copyRemoteRepositoryUrl',
  134. CopyShaToClipboard = 'gitlens.copyShaToClipboard',
  135. CopyRelativePathToClipboard = 'gitlens.copyRelativePathToClipboard',
  136. CreatePullRequestOnRemote = 'gitlens.createPullRequestOnRemote',
  137. DiffDirectory = 'gitlens.diffDirectory',
  138. DiffDirectoryWithHead = 'gitlens.diffDirectoryWithHead',
  139. DiffWith = 'gitlens.diffWith',
  140. DiffWithNext = 'gitlens.diffWithNext',
  141. DiffWithNextInDiffLeft = 'gitlens.diffWithNextInDiffLeft',
  142. DiffWithNextInDiffRight = 'gitlens.diffWithNextInDiffRight',
  143. DiffWithPrevious = 'gitlens.diffWithPrevious',
  144. DiffWithPreviousInDiffLeft = 'gitlens.diffWithPreviousInDiffLeft',
  145. DiffWithPreviousInDiffRight = 'gitlens.diffWithPreviousInDiffRight',
  146. DiffLineWithPrevious = 'gitlens.diffLineWithPrevious',
  147. DiffWithRevision = 'gitlens.diffWithRevision',
  148. DiffWithRevisionFrom = 'gitlens.diffWithRevisionFrom',
  149. DiffWithWorking = 'gitlens.diffWithWorking',
  150. DiffWithWorkingInDiffLeft = 'gitlens.diffWithWorkingInDiffLeft',
  151. DiffWithWorkingInDiffRight = 'gitlens.diffWithWorkingInDiffRight',
  152. DiffLineWithWorking = 'gitlens.diffLineWithWorking',
  153. DisconnectRemoteProvider = 'gitlens.disconnectRemoteProvider',
  154. DisableDebugLogging = 'gitlens.disableDebugLogging',
  155. EnableDebugLogging = 'gitlens.enableDebugLogging',
  156. DisableRebaseEditor = 'gitlens.disableRebaseEditor',
  157. EnableRebaseEditor = 'gitlens.enableRebaseEditor',
  158. ExternalDiff = 'gitlens.externalDiff',
  159. ExternalDiffAll = 'gitlens.externalDiffAll',
  160. FetchRepositories = 'gitlens.fetchRepositories',
  161. GenerateCommitMessage = 'gitlens.generateCommitMessage',
  162. GetStarted = 'gitlens.getStarted',
  163. InviteToLiveShare = 'gitlens.inviteToLiveShare',
  164. OpenAutolinkUrl = 'gitlens.openAutolinkUrl',
  165. OpenBlamePriorToChange = 'gitlens.openBlamePriorToChange',
  166. OpenBranchesOnRemote = 'gitlens.openBranchesOnRemote',
  167. OpenBranchOnRemote = 'gitlens.openBranchOnRemote',
  168. OpenCurrentBranchOnRemote = 'gitlens.openCurrentBranchOnRemote',
  169. OpenChangedFiles = 'gitlens.openChangedFiles',
  170. OpenCommitOnRemote = 'gitlens.openCommitOnRemote',
  171. OpenComparisonOnRemote = 'gitlens.openComparisonOnRemote',
  172. OpenFileHistory = 'gitlens.openFileHistory',
  173. OpenFileFromRemote = 'gitlens.openFileFromRemote',
  174. OpenFileOnRemote = 'gitlens.openFileOnRemote',
  175. OpenFileOnRemoteFrom = 'gitlens.openFileOnRemoteFrom',
  176. OpenFileAtRevision = 'gitlens.openFileRevision',
  177. OpenFileAtRevisionFrom = 'gitlens.openFileRevisionFrom',
  178. OpenFolderHistory = 'gitlens.openFolderHistory',
  179. OpenOnRemote = 'gitlens.openOnRemote',
  180. OpenIssueOnRemote = 'gitlens.openIssueOnRemote',
  181. OpenPullRequestOnRemote = 'gitlens.openPullRequestOnRemote',
  182. OpenAssociatedPullRequestOnRemote = 'gitlens.openAssociatedPullRequestOnRemote',
  183. OpenRepoOnRemote = 'gitlens.openRepoOnRemote',
  184. OpenRevisionFile = 'gitlens.openRevisionFile',
  185. OpenRevisionFileInDiffLeft = 'gitlens.openRevisionFileInDiffLeft',
  186. OpenRevisionFileInDiffRight = 'gitlens.openRevisionFileInDiffRight',
  187. OpenWalkthrough = 'gitlens.openWalkthrough',
  188. OpenWorkingFile = 'gitlens.openWorkingFile',
  189. OpenWorkingFileInDiffLeft = 'gitlens.openWorkingFileInDiffLeft',
  190. OpenWorkingFileInDiffRight = 'gitlens.openWorkingFileInDiffRight',
  191. PullRepositories = 'gitlens.pullRepositories',
  192. PushRepositories = 'gitlens.pushRepositories',
  193. GitCommands = 'gitlens.gitCommands',
  194. GitCommandsBranch = 'gitlens.gitCommands.branch',
  195. GitCommandsCherryPick = 'gitlens.gitCommands.cherryPick',
  196. GitCommandsMerge = 'gitlens.gitCommands.merge',
  197. GitCommandsRebase = 'gitlens.gitCommands.rebase',
  198. GitCommandsReset = 'gitlens.gitCommands.reset',
  199. GitCommandsRevert = 'gitlens.gitCommands.revert',
  200. GitCommandsSwitch = 'gitlens.gitCommands.switch',
  201. GitCommandsTag = 'gitlens.gitCommands.tag',
  202. GitCommandsWorktree = 'gitlens.gitCommands.worktree',
  203. GitCommandsWorktreeOpen = 'gitlens.gitCommands.worktree.open',
  204. OpenOrCreateWorktreeForGHPR = 'gitlens.ghpr.views.openOrCreateWorktree',
  205. PlusHide = 'gitlens.plus.hide',
  206. PlusLoginOrSignUp = 'gitlens.plus.loginOrSignUp',
  207. PlusLogout = 'gitlens.plus.logout',
  208. PlusManage = 'gitlens.plus.manage',
  209. PlusPurchase = 'gitlens.plus.purchase',
  210. PlusResendVerification = 'gitlens.plus.resendVerification',
  211. PlusRestore = 'gitlens.plus.restore',
  212. PlusShowPlans = 'gitlens.plus.showPlans',
  213. PlusStartPreviewTrial = 'gitlens.plus.startPreviewTrial',
  214. PlusValidate = 'gitlens.plus.validate',
  215. QuickOpenFileHistory = 'gitlens.quickOpenFileHistory',
  216. RefreshFocus = 'gitlens.focus.refresh',
  217. RefreshGraph = 'gitlens.graph.refresh',
  218. RefreshHover = 'gitlens.refreshHover',
  219. ResetAvatarCache = 'gitlens.resetAvatarCache',
  220. ResetAIKey = 'gitlens.resetAIKey',
  221. ResetSuppressedWarnings = 'gitlens.resetSuppressedWarnings',
  222. ResetTrackedUsage = 'gitlens.resetTrackedUsage',
  223. ResetViewsLayout = 'gitlens.resetViewsLayout',
  224. RevealCommitInView = 'gitlens.revealCommitInView',
  225. SearchCommits = 'gitlens.showCommitSearch',
  226. SearchCommitsInView = 'gitlens.views.searchAndCompare.searchCommits',
  227. ShowBranchesView = 'gitlens.showBranchesView',
  228. ShowCommitDetailsView = 'gitlens.showCommitDetailsView',
  229. ShowCommitInView = 'gitlens.showCommitInView',
  230. ShowCommitsInView = 'gitlens.showCommitsInView',
  231. ShowCommitsView = 'gitlens.showCommitsView',
  232. ShowContributorsView = 'gitlens.showContributorsView',
  233. ShowFileHistoryView = 'gitlens.showFileHistoryView',
  234. ShowFocusPage = 'gitlens.showFocusPage',
  235. ShowGraph = 'gitlens.showGraph',
  236. ShowGraphPage = 'gitlens.showGraphPage',
  237. ShowGraphView = 'gitlens.showGraphView',
  238. ShowHomeView = 'gitlens.showHomeView',
  239. ShowAccountView = 'gitlens.showAccountView',
  240. ShowInCommitGraph = 'gitlens.showInCommitGraph',
  241. ShowInCommitGraphView = 'gitlens.showInCommitGraphView',
  242. ShowInDetailsView = 'gitlens.showInDetailsView',
  243. ShowInTimeline = 'gitlens.showInTimeline',
  244. ShowLastQuickPick = 'gitlens.showLastQuickPick',
  245. ShowLineCommitInView = 'gitlens.showLineCommitInView',
  246. ShowLineHistoryView = 'gitlens.showLineHistoryView',
  247. OpenOnlyChangedFiles = 'gitlens.openOnlyChangedFiles',
  248. ShowQuickBranchHistory = 'gitlens.showQuickBranchHistory',
  249. ShowQuickCommit = 'gitlens.showQuickCommitDetails',
  250. ShowQuickCommitFile = 'gitlens.showQuickCommitFileDetails',
  251. ShowQuickCurrentBranchHistory = 'gitlens.showQuickRepoHistory',
  252. ShowQuickFileHistory = 'gitlens.showQuickFileHistory',
  253. ShowQuickRepoStatus = 'gitlens.showQuickRepoStatus',
  254. ShowQuickCommitRevision = 'gitlens.showQuickRevisionDetails',
  255. ShowQuickCommitRevisionInDiffLeft = 'gitlens.showQuickRevisionDetailsInDiffLeft',
  256. ShowQuickCommitRevisionInDiffRight = 'gitlens.showQuickRevisionDetailsInDiffRight',
  257. ShowQuickStashList = 'gitlens.showQuickStashList',
  258. ShowRemotesView = 'gitlens.showRemotesView',
  259. ShowRepositoriesView = 'gitlens.showRepositoriesView',
  260. ShowSearchAndCompareView = 'gitlens.showSearchAndCompareView',
  261. ShowSettingsPage = 'gitlens.showSettingsPage',
  262. ShowSettingsPageAndJumpToBranchesView = 'gitlens.showSettingsPage#branches-view',
  263. ShowSettingsPageAndJumpToCommitsView = 'gitlens.showSettingsPage#commits-view',
  264. ShowSettingsPageAndJumpToContributorsView = 'gitlens.showSettingsPage#contributors-view',
  265. ShowSettingsPageAndJumpToFileHistoryView = 'gitlens.showSettingsPage#file-history-view',
  266. ShowSettingsPageAndJumpToLineHistoryView = 'gitlens.showSettingsPage#line-history-view',
  267. ShowSettingsPageAndJumpToRemotesView = 'gitlens.showSettingsPage#remotes-view',
  268. ShowSettingsPageAndJumpToRepositoriesView = 'gitlens.showSettingsPage#repositories-view',
  269. ShowSettingsPageAndJumpToSearchAndCompareView = 'gitlens.showSettingsPage#search-compare-view',
  270. ShowSettingsPageAndJumpToStashesView = 'gitlens.showSettingsPage#stashes-view',
  271. ShowSettingsPageAndJumpToTagsView = 'gitlens.showSettingsPage#tags-view',
  272. ShowSettingsPageAndJumpToWorkTreesView = 'gitlens.showSettingsPage#worktrees-view',
  273. ShowSettingsPageAndJumpToViews = 'gitlens.showSettingsPage#views',
  274. ShowSettingsPageAndJumpToCommitGraph = 'gitlens.showSettingsPage#commit-graph',
  275. ShowSettingsPageAndJumpToAutolinks = 'gitlens.showSettingsPage#autolinks',
  276. ShowStashesView = 'gitlens.showStashesView',
  277. ShowTagsView = 'gitlens.showTagsView',
  278. ShowTimelinePage = 'gitlens.showTimelinePage',
  279. ShowTimelineView = 'gitlens.showTimelineView',
  280. ShowWelcomePage = 'gitlens.showWelcomePage',
  281. ShowWorktreesView = 'gitlens.showWorktreesView',
  282. ShowWorkspacesView = 'gitlens.showWorkspacesView',
  283. StashApply = 'gitlens.stashApply',
  284. StashSave = 'gitlens.stashSave',
  285. StashSaveFiles = 'gitlens.stashSaveFiles',
  286. SwitchAIModel = 'gitlens.switchAIModel',
  287. SwitchMode = 'gitlens.switchMode',
  288. ToggleCodeLens = 'gitlens.toggleCodeLens',
  289. ToggleFileBlame = 'gitlens.toggleFileBlame',
  290. ToggleFileBlameInDiffLeft = 'gitlens.toggleFileBlameInDiffLeft',
  291. ToggleFileBlameInDiffRight = 'gitlens.toggleFileBlameInDiffRight',
  292. ToggleFileChanges = 'gitlens.toggleFileChanges',
  293. ToggleFileChangesOnly = 'gitlens.toggleFileChangesOnly',
  294. ToggleFileHeatmap = 'gitlens.toggleFileHeatmap',
  295. ToggleFileHeatmapInDiffLeft = 'gitlens.toggleFileHeatmapInDiffLeft',
  296. ToggleFileHeatmapInDiffRight = 'gitlens.toggleFileHeatmapInDiffRight',
  297. ToggleGraph = 'gitlens.toggleGraph',
  298. ToggleMaximizedGraph = 'gitlens.toggleMaximizedGraph',
  299. ToggleLineBlame = 'gitlens.toggleLineBlame',
  300. ToggleReviewMode = 'gitlens.toggleReviewMode',
  301. ToggleZenMode = 'gitlens.toggleZenMode',
  302. ViewsCopy = 'gitlens.views.copy',
  303. ViewsOpenDirectoryDiff = 'gitlens.views.openDirectoryDiff',
  304. ViewsOpenDirectoryDiffWithWorking = 'gitlens.views.openDirectoryDiffWithWorking',
  305. Deprecated_DiffHeadWith = 'gitlens.diffHeadWith',
  306. Deprecated_DiffWorkingWith = 'gitlens.diffWorkingWith',
  307. Deprecated_OpenBranchesInRemote = 'gitlens.openBranchesInRemote',
  308. Deprecated_OpenBranchInRemote = 'gitlens.openBranchInRemote',
  309. Deprecated_OpenCommitInRemote = 'gitlens.openCommitInRemote',
  310. Deprecated_OpenFileInRemote = 'gitlens.openFileInRemote',
  311. Deprecated_OpenInRemote = 'gitlens.openInRemote',
  312. Deprecated_OpenRepoInRemote = 'gitlens.openRepoInRemote',
  313. Deprecated_ShowFileHistoryInView = 'gitlens.showFileHistoryInView',
  314. }
  315. export type TreeViewCommands = `gitlens.views.${
  316. | `branches.${
  317. | 'copy'
  318. | 'refresh'
  319. | `setLayoutTo${'List' | 'Tree'}`
  320. | `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
  321. | `setShowAvatars${'On' | 'Off'}`
  322. | `setShowBranchComparison${'On' | 'Off'}`
  323. | `setShowBranchPullRequest${'On' | 'Off'}`}`
  324. | `commits.${
  325. | 'copy'
  326. | 'refresh'
  327. | `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
  328. | `setCommitsFilter${'Authors' | 'Off'}`
  329. | `setShowAvatars${'On' | 'Off'}`
  330. | `setShowBranchComparison${'On' | 'Off'}`
  331. | `setShowBranchPullRequest${'On' | 'Off'}`
  332. | `setShowMergeCommits${'On' | 'Off'}`}`
  333. | `contributors.${
  334. | 'copy'
  335. | 'refresh'
  336. | `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
  337. | `setShowAllBranches${'On' | 'Off'}`
  338. | `setShowAvatars${'On' | 'Off'}`
  339. | `setShowStatistics${'On' | 'Off'}`}`
  340. | `fileHistory.${
  341. | 'copy'
  342. | 'refresh'
  343. | 'changeBase'
  344. | `setCursorFollowing${'On' | 'Off'}`
  345. | `setEditorFollowing${'On' | 'Off'}`
  346. | `setRenameFollowing${'On' | 'Off'}`
  347. | `setShowAllBranches${'On' | 'Off'}`
  348. | `setShowMergeCommits${'On' | 'Off'}`
  349. | `setShowAvatars${'On' | 'Off'}`}`
  350. | `lineHistory.${
  351. | 'copy'
  352. | 'refresh'
  353. | 'changeBase'
  354. | `setEditorFollowing${'On' | 'Off'}`
  355. | `setShowAvatars${'On' | 'Off'}`}`
  356. | `remotes.${
  357. | 'copy'
  358. | 'refresh'
  359. | `setLayoutTo${'List' | 'Tree'}`
  360. | `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
  361. | `setShowAvatars${'On' | 'Off'}`
  362. | `setShowBranchPullRequest${'On' | 'Off'}`}`
  363. | `repositories.${
  364. | 'copy'
  365. | 'refresh'
  366. | `setBranchesLayoutTo${'List' | 'Tree'}`
  367. | `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
  368. | `setAutoRefreshTo${'On' | 'Off'}`
  369. | `setShowAvatars${'On' | 'Off'}`
  370. | `setShowBranchComparison${'On' | 'Off'}`
  371. | `setBranchesShowBranchComparison${'On' | 'Off'}`
  372. | `setShowBranches${'On' | 'Off'}`
  373. | `setShowCommits${'On' | 'Off'}`
  374. | `setShowContributors${'On' | 'Off'}`
  375. | `setShowRemotes${'On' | 'Off'}`
  376. | `setShowStashes${'On' | 'Off'}`
  377. | `setShowTags${'On' | 'Off'}`
  378. | `setShowWorktrees${'On' | 'Off'}`
  379. | `setShowUpstreamStatus${'On' | 'Off'}`
  380. | `setShowSectionOff`}`
  381. | `searchAndCompare.${
  382. | 'copy'
  383. | 'refresh'
  384. | 'clear'
  385. | 'pin'
  386. | 'unpin'
  387. | 'swapComparison'
  388. | 'selectForCompare'
  389. | 'compareWithSelected'
  390. | `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
  391. | `setKeepResultsTo${'On' | 'Off'}`
  392. | `setShowAvatars${'On' | 'Off'}`
  393. | `setFilesFilterOn${'Left' | 'Right'}`
  394. | 'setFilesFilterOff'}`
  395. | `stashes.${'copy' | 'refresh' | `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`}`
  396. | `tags.${
  397. | 'copy'
  398. | 'refresh'
  399. | `setLayoutTo${'List' | 'Tree'}`
  400. | `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
  401. | `setShowAvatars${'On' | 'Off'}`}`
  402. | `workspaces.${
  403. | 'info'
  404. | 'copy'
  405. | 'refresh'
  406. | 'addRepos'
  407. | 'addReposFromLinked'
  408. | 'changeAutoAddSetting'
  409. | 'convert'
  410. | 'create'
  411. | 'createLocal'
  412. | 'delete'
  413. | 'locateAllRepos'
  414. | 'openLocal'
  415. | 'openLocalNewWindow'
  416. | `repo.${'locate' | 'open' | 'openInNewWindow' | 'addToWindow' | 'remove'}`}`
  417. | `worktrees.${
  418. | 'copy'
  419. | 'refresh'
  420. | `setFilesLayoutTo${'Auto' | 'List' | 'Tree'}`
  421. | `setShowAvatars${'On' | 'Off'}`
  422. | `setShowBranchComparison${'On' | 'Off'}`
  423. | `setShowBranchPullRequest${'On' | 'Off'}`}`}`;
  424. type ExtractSuffix<Prefix extends string, U> = U extends `${Prefix}${infer V}` ? V : never;
  425. type FilterCommands<Prefix extends string, U> = U extends `${Prefix}${infer V}` ? `${Prefix}${V}` : never;
  426. export type TreeViewCommandsByViewId<T extends TreeViewIds> = FilterCommands<T, TreeViewCommands>;
  427. export type TreeViewCommandsByViewType<T extends TreeViewTypes> = FilterCommands<
  428. `gitlens.views.${T}.`,
  429. TreeViewCommands
  430. >;
  431. export type TreeViewCommandSuffixesByViewType<T extends TreeViewTypes> = ExtractSuffix<
  432. `gitlens.views.${T}.`,
  433. FilterCommands<`gitlens.views.${T}.`, TreeViewCommands>
  434. >;
  435. export type CustomEditorTypes = 'rebase';
  436. export type CustomEditorIds = `gitlens.${CustomEditorTypes}`;
  437. export type TreeViewTypes =
  438. | 'branches'
  439. | 'commits'
  440. | 'contributors'
  441. | 'fileHistory'
  442. | 'lineHistory'
  443. | 'remotes'
  444. | 'repositories'
  445. | 'searchAndCompare'
  446. | 'stashes'
  447. | 'tags'
  448. | 'workspaces'
  449. | 'worktrees';
  450. export type TreeViewIds = `gitlens.views.${TreeViewTypes}`;
  451. export type WebviewTypes = 'graph' | 'settings' | 'timeline' | 'welcome' | 'focus';
  452. export type WebviewIds = `gitlens.${WebviewTypes}`;
  453. export type WebviewViewTypes = 'account' | 'commitDetails' | 'graph' | 'graphDetails' | 'home' | 'timeline';
  454. export type WebviewViewIds = `gitlens.views.${WebviewViewTypes}`;
  455. export type ViewTypes = TreeViewTypes | WebviewViewTypes;
  456. export type ViewIds = TreeViewIds | WebviewViewIds;
  457. export type ViewContainerTypes = 'gitlens' | 'gitlensInspect' | 'gitlensPanel';
  458. export type ViewContainerIds = `workbench.view.extension.${ViewContainerTypes}`;
  459. export type CoreViewContainerTypes = 'scm';
  460. export type CoreViewContainerIds = `workbench.view.${CoreViewContainerTypes}`;
  461. // export const viewTypes: ViewTypes[] = [
  462. // 'account',
  463. // 'branches',
  464. // 'commits',
  465. // 'commitDetails',
  466. // 'contributors',
  467. // 'fileHistory',
  468. // 'graph',
  469. // 'graphDetails',
  470. // 'home',
  471. // 'lineHistory',
  472. // 'remotes',
  473. // 'repositories',
  474. // 'searchAndCompare',
  475. // 'stashes',
  476. // 'tags',
  477. // 'timeline',
  478. // 'workspaces',
  479. // 'worktrees',
  480. // ];
  481. export const viewIdsByDefaultContainerId = new Map<ViewContainerIds | CoreViewContainerIds, ViewTypes[]>([
  482. [
  483. 'workbench.view.scm',
  484. ['branches', 'commits', 'remotes', 'repositories', 'stashes', 'tags', 'worktrees', 'contributors'],
  485. ],
  486. ['workbench.view.extension.gitlensPanel', ['graph', 'graphDetails']],
  487. [
  488. 'workbench.view.extension.gitlensInspect',
  489. ['commitDetails', 'fileHistory', 'lineHistory', 'timeline', 'searchAndCompare'],
  490. ],
  491. ['workbench.view.extension.gitlens', ['home', 'workspaces', 'account']],
  492. ]);
  493. export type TreeViewRefNodeTypes = 'branch' | 'commit' | 'stash' | 'tag';
  494. export type TreeViewRefFileNodeTypes = 'commit-file' | 'file-commit' | 'results-file' | 'stash-file';
  495. export type TreeViewFileNodeTypes =
  496. | TreeViewRefFileNodeTypes
  497. | 'conflict-file'
  498. | 'folder'
  499. | 'status-file'
  500. | 'uncommitted-file';
  501. export type TreeViewSubscribableNodeTypes =
  502. | 'compare-branch'
  503. | 'compare-results'
  504. | 'file-history'
  505. | 'file-history-tracker'
  506. | 'line-history'
  507. | 'line-history-tracker'
  508. | 'repositories'
  509. | 'repository'
  510. | 'repo-folder'
  511. | 'search-results'
  512. | 'workspace';
  513. export type TreeViewNodeTypes =
  514. | TreeViewRefNodeTypes
  515. | TreeViewFileNodeTypes
  516. | TreeViewSubscribableNodeTypes
  517. | 'autolink'
  518. | 'autolinks'
  519. | 'branch-tag-folder'
  520. | 'branches'
  521. | 'compare-picker'
  522. | 'contributor'
  523. | 'contributors'
  524. | 'conflict-files'
  525. | 'conflict-current-changes'
  526. | 'conflict-incoming-changes'
  527. | 'merge-status'
  528. | 'message'
  529. | 'pager'
  530. | 'pullrequest'
  531. | 'rebase-status'
  532. | 'reflog'
  533. | 'reflog-record'
  534. | 'remote'
  535. | 'remotes'
  536. | 'results-commits'
  537. | 'results-files'
  538. | 'search-compare'
  539. | 'stashes'
  540. | 'status-files'
  541. | 'tags'
  542. | 'tracking-status'
  543. | 'tracking-status-files'
  544. | 'uncommitted-files'
  545. | 'workspace-missing-repository'
  546. | 'workspaces-view'
  547. | 'worktree'
  548. | 'worktrees';
  549. export type ContextKeys =
  550. | `${typeof extensionPrefix}:action:${string}`
  551. | `${typeof extensionPrefix}:key:${Keys}`
  552. | `${typeof extensionPrefix}:webview:${WebviewTypes | CustomEditorTypes}:visible`
  553. | `${typeof extensionPrefix}:webviewView:${WebviewViewTypes}:visible`
  554. | `${typeof extensionPrefix}:activeFileStatus`
  555. | `${typeof extensionPrefix}:annotationStatus`
  556. | `${typeof extensionPrefix}:debugging`
  557. | `${typeof extensionPrefix}:disabledToggleCodeLens`
  558. | `${typeof extensionPrefix}:disabled`
  559. | `${typeof extensionPrefix}:enabled`
  560. | `${typeof extensionPrefix}:hasConnectedRemotes`
  561. | `${typeof extensionPrefix}:hasRemotes`
  562. | `${typeof extensionPrefix}:hasRichRemotes`
  563. | `${typeof extensionPrefix}:hasVirtualFolders`
  564. | `${typeof extensionPrefix}:prerelease`
  565. | `${typeof extensionPrefix}:readonly`
  566. | `${typeof extensionPrefix}:untrusted`
  567. | `${typeof extensionPrefix}:views:canCompare`
  568. | `${typeof extensionPrefix}:views:canCompare:file`
  569. | `${typeof extensionPrefix}:views:commits:filtered`
  570. | `${typeof extensionPrefix}:views:commits:hideMergeCommits`
  571. | `${typeof extensionPrefix}:views:fileHistory:canPin`
  572. | `${typeof extensionPrefix}:views:fileHistory:cursorFollowing`
  573. | `${typeof extensionPrefix}:views:fileHistory:editorFollowing`
  574. | `${typeof extensionPrefix}:views:lineHistory:editorFollowing`
  575. | `${typeof extensionPrefix}:views:repositories:autoRefresh`
  576. | `${typeof extensionPrefix}:vsls`
  577. | `${typeof extensionPrefix}:plus`
  578. | `${typeof extensionPrefix}:plus:disallowedRepos`
  579. | `${typeof extensionPrefix}:plus:enabled`
  580. | `${typeof extensionPrefix}:plus:required`
  581. | `${typeof extensionPrefix}:plus:state`;
  582. export type CoreCommands =
  583. | 'cursorMove'
  584. | 'editor.action.showHover'
  585. | 'editor.action.showReferences'
  586. | 'editor.action.webvieweditor.showFind'
  587. | 'editorScroll'
  588. | 'list.collapseAllToFocus'
  589. | 'openInTerminal'
  590. | 'revealFileInOS'
  591. | 'revealInExplorer'
  592. | 'revealLine'
  593. | 'setContext'
  594. | 'vscode.open'
  595. | 'vscode.openFolder'
  596. | 'vscode.openWith'
  597. | 'vscode.diff'
  598. | 'vscode.executeCodeLensProvider'
  599. | 'vscode.executeDocumentSymbolProvider'
  600. | 'vscode.moveViews'
  601. | 'vscode.previewHtml'
  602. | 'workbench.action.closeActiveEditor'
  603. | 'workbench.action.closeAllEditors'
  604. | 'workbench.action.closePanel'
  605. | 'workbench.action.nextEditor'
  606. | 'workbench.action.openWalkthrough'
  607. | 'workbench.action.toggleMaximizedPanel'
  608. | 'workbench.extensions.installExtension'
  609. | 'workbench.extensions.uninstallExtension'
  610. | 'workbench.files.action.focusFilesExplorer'
  611. | 'workbench.view.explorer'
  612. | 'workbench.view.scm'
  613. | `${ViewContainerIds | CoreViewContainerIds}.resetViewContainerLocation`
  614. | `${ViewIds}.${'focus' | 'removeView' | 'resetViewLocation' | 'toggleVisibility'}`;
  615. export type CoreGitCommands =
  616. | 'git.fetch'
  617. | 'git.publish'
  618. | 'git.pull'
  619. | 'git.pullRebase'
  620. | 'git.push'
  621. | 'git.pushForce'
  622. | 'git.undoCommit';
  623. export type CoreConfiguration =
  624. | 'editor.letterSpacing'
  625. | 'files.encoding'
  626. | 'files.exclude'
  627. | 'http.proxy'
  628. | 'http.proxySupport'
  629. | 'http.proxyStrictSSL'
  630. | 'search.exclude'
  631. | 'workbench.editorAssociations'
  632. | 'workbench.tree.renderIndentGuides';
  633. export type CoreGitConfiguration =
  634. | 'git.autoRepositoryDetection'
  635. | 'git.enabled'
  636. | 'git.fetchOnPull'
  637. | 'git.path'
  638. | 'git.pullTags'
  639. | 'git.repositoryScanIgnoredFolders'
  640. | 'git.repositoryScanMaxDepth'
  641. | 'git.useForcePushWithLease';
  642. export const enum GlyphChars {
  643. AngleBracketLeftHeavy = '\u2770',
  644. AngleBracketRightHeavy = '\u2771',
  645. ArrowBack = '\u21a9',
  646. ArrowDown = '\u2193',
  647. ArrowDownUp = '\u21F5',
  648. ArrowDropRight = '\u2937',
  649. ArrowHeadRight = '\u27A4',
  650. ArrowLeft = '\u2190',
  651. ArrowLeftDouble = '\u21d0',
  652. ArrowLeftRight = '\u2194',
  653. ArrowLeftRightDouble = '\u21d4',
  654. ArrowLeftRightDoubleStrike = '\u21ce',
  655. ArrowLeftRightLong = '\u27f7',
  656. ArrowRight = '\u2192',
  657. ArrowRightDouble = '\u21d2',
  658. ArrowRightHollow = '\u21e8',
  659. ArrowUp = '\u2191',
  660. ArrowUpDown = '\u21C5',
  661. ArrowUpRight = '\u2197',
  662. ArrowsHalfLeftRight = '\u21cb',
  663. ArrowsHalfRightLeft = '\u21cc',
  664. ArrowsLeftRight = '\u21c6',
  665. ArrowsRightLeft = '\u21c4',
  666. Asterisk = '\u2217',
  667. Check = '✔',
  668. Dash = '\u2014',
  669. Dot = '\u2022',
  670. Ellipsis = '\u2026',
  671. EnDash = '\u2013',
  672. Envelope = '\u2709',
  673. EqualsTriple = '\u2261',
  674. Flag = '\u2691',
  675. FlagHollow = '\u2690',
  676. MiddleEllipsis = '\u22EF',
  677. MuchLessThan = '\u226A',
  678. MuchGreaterThan = '\u226B',
  679. Pencil = '\u270E',
  680. Space = '\u00a0',
  681. SpaceThin = '\u2009',
  682. SpaceThinnest = '\u200A',
  683. SquareWithBottomShadow = '\u274F',
  684. SquareWithTopShadow = '\u2750',
  685. Warning = '\u26a0',
  686. ZeroWidthSpace = '\u200b',
  687. }
  688. export const keys = [
  689. 'left',
  690. 'alt+left',
  691. 'ctrl+left',
  692. 'right',
  693. 'alt+right',
  694. 'ctrl+right',
  695. 'alt+,',
  696. 'alt+.',
  697. 'alt+enter',
  698. 'ctrl+enter',
  699. 'escape',
  700. ] as const;
  701. export type Keys = (typeof keys)[number];
  702. export const enum Schemes {
  703. DebugConsole = 'debug',
  704. File = 'file',
  705. Git = 'git',
  706. GitHub = 'github',
  707. GitLens = 'gitlens',
  708. Output = 'output',
  709. PRs = 'pr',
  710. Terminal = 'vscode-terminal',
  711. Vsls = 'vsls',
  712. VslsScc = 'vsls-scc',
  713. Virtual = 'vscode-vfs',
  714. }
  715. export type TelemetryEvents =
  716. | 'account/validation/failed'
  717. | 'activate'
  718. | 'command'
  719. | 'command/core'
  720. | 'remoteProviders/connected'
  721. | 'remoteProviders/disconnected'
  722. | 'providers/changed'
  723. | 'providers/context'
  724. | 'providers/registrationComplete'
  725. | 'repositories/changed'
  726. | 'repositories/visibility'
  727. | 'repository/opened'
  728. | 'repository/visibility'
  729. | 'subscription'
  730. | 'subscription/changed'
  731. | 'usage/track';
  732. export type AIProviders = 'anthropic' | 'openai';
  733. export type SecretKeys =
  734. | `gitlens.integration.auth:${string}`
  735. | `gitlens.${AIProviders}.key`
  736. | `gitlens.plus.auth:${Environment}`;
  737. export const enum SyncedStorageKeys {
  738. Version = 'gitlens:synced:version',
  739. PreReleaseVersion = 'gitlens:synced:preVersion',
  740. HomeViewWelcomeVisible = 'gitlens:views:welcome:visible',
  741. }
  742. export type DeprecatedGlobalStorage = {
  743. /** @deprecated use `confirm:ai:tos:${AIProviders}` */
  744. 'confirm:sendToOpenAI': boolean;
  745. /** @deprecated */
  746. 'home:actions:completed': ('dismissed:welcome' | 'opened:scm')[];
  747. /** @deprecated */
  748. 'home:steps:completed': string[];
  749. /** @deprecated */
  750. 'home:sections:dismissed': string[];
  751. /** @deprecated */
  752. 'home:status:pinned': boolean;
  753. /** @deprecated */
  754. 'home:banners:dismissed': string[];
  755. /** @deprecated */
  756. 'plus:discountNotificationShown': boolean;
  757. /** @deprecated */
  758. 'plus:migratedAuthentication': boolean;
  759. /** @deprecated */
  760. 'plus:renewalDiscountNotificationShown': boolean;
  761. /** @deprecated */
  762. 'views:layout': 'gitlens' | 'scm';
  763. /** @deprecated */
  764. 'views:commitDetails:dismissed': 'sidebar'[];
  765. } & {
  766. /** @deprecated */
  767. [key in `disallow:connection:${string}`]: any;
  768. };
  769. export type GlobalStorage = {
  770. avatars: [string, StoredAvatar][];
  771. repoVisibility: [string, StoredRepoVisibilityInfo][];
  772. 'deepLinks:pending': StoredDeepLinkContext;
  773. pendingWelcomeOnFocus: boolean;
  774. pendingWhatsNewOnFocus: boolean;
  775. // Don't change this key name ('premium`) as its the stored subscription
  776. 'premium:subscription': Stored<Subscription & { lastValidatedAt: number | undefined }>;
  777. 'synced:version': string;
  778. // Keep the pre-release version separate from the released version
  779. 'synced:preVersion': string;
  780. usages: Record<TrackedUsageKeys, TrackedUsage>;
  781. version: string;
  782. // Keep the pre-release version separate from the released version
  783. preVersion: string;
  784. 'views:welcome:visible': boolean;
  785. } & { [key in `confirm:ai:tos:${AIProviders}`]: boolean } & {
  786. [key in `provider:authentication:skip:${string}`]: boolean;
  787. };
  788. export type DeprecatedWorkspaceStorage = {
  789. /** @deprecated use `confirm:ai:tos:${AIProviders}` */
  790. 'confirm:sendToOpenAI': boolean;
  791. /** @deprecated */
  792. 'graph:banners:dismissed': Record<string, boolean>;
  793. /** @deprecated use `graph:filtersByRepo.excludeRefs` */
  794. 'graph:hiddenRefs': Record<string, StoredGraphExcludedRef>;
  795. /** @deprecated */
  796. 'views:searchAndCompare:keepResults': boolean;
  797. };
  798. export type WorkspaceStorage = {
  799. assumeRepositoriesOnStartup?: boolean;
  800. 'branch:comparisons': StoredBranchComparisons;
  801. 'gitComandPalette:usage': RecentUsage;
  802. gitPath: string;
  803. 'graph:columns': Record<string, StoredGraphColumn>;
  804. 'graph:filtersByRepo': Record<string, StoredGraphFilters>;
  805. 'remote:default': string;
  806. 'starred:branches': StoredStarred;
  807. 'starred:repositories': StoredStarred;
  808. 'views:repositories:autoRefresh': boolean;
  809. 'views:searchAndCompare:pinned': StoredSearchAndCompareItems;
  810. 'views:commitDetails:autolinksExpanded': boolean;
  811. } & { [key in `confirm:ai:tos:${AIProviders}`]: boolean } & { [key in `connected:${string}`]: boolean };
  812. export interface Stored<T, SchemaVersion extends number = 1> {
  813. v: SchemaVersion;
  814. data: T;
  815. }
  816. export interface StoredAvatar {
  817. uri: string;
  818. timestamp: number;
  819. }
  820. export type StoredRepositoryVisibility = 'private' | 'public' | 'local';
  821. export interface StoredRepoVisibilityInfo {
  822. visibility: StoredRepositoryVisibility;
  823. timestamp: number;
  824. remotesHash?: string;
  825. }
  826. export interface StoredBranchComparison {
  827. ref: string;
  828. notation: '..' | '...' | undefined;
  829. type: Exclude<ViewShowBranchComparison, false> | undefined;
  830. checkedFiles?: string[];
  831. }
  832. export type StoredBranchComparisons = Record<string, string | StoredBranchComparison>;
  833. export interface StoredDeepLinkContext {
  834. url?: string | undefined;
  835. repoPath?: string | undefined;
  836. }
  837. export interface StoredGraphColumn {
  838. isHidden?: boolean;
  839. mode?: string;
  840. width?: number;
  841. }
  842. export interface StoredGraphFilters {
  843. includeOnlyRefs?: Record<string, StoredGraphIncludeOnlyRef>;
  844. excludeRefs?: Record<string, StoredGraphExcludedRef>;
  845. excludeTypes?: Record<string, boolean>;
  846. }
  847. export type StoredGraphRefType = 'head' | 'remote' | 'tag';
  848. export interface StoredGraphExcludedRef {
  849. id: string;
  850. type: StoredGraphRefType;
  851. name: string;
  852. owner?: string;
  853. }
  854. export interface StoredGraphIncludeOnlyRef {
  855. id: string;
  856. type: StoredGraphRefType;
  857. name: string;
  858. owner?: string;
  859. }
  860. export interface StoredNamedRef {
  861. label?: string;
  862. ref: string;
  863. }
  864. export interface StoredComparison {
  865. type: 'comparison';
  866. timestamp: number;
  867. path: string;
  868. ref1: StoredNamedRef;
  869. ref2: StoredNamedRef;
  870. notation?: '..' | '...';
  871. checkedFiles?: string[];
  872. }
  873. export interface StoredSearch {
  874. type: 'search';
  875. timestamp: number;
  876. path: string;
  877. labels: {
  878. label: string;
  879. queryLabel:
  880. | string
  881. | {
  882. label: string;
  883. resultsType?: { singular: string; plural: string };
  884. };
  885. };
  886. search: StoredSearchQuery;
  887. }
  888. export type StoredSearchAndCompareItem = StoredComparison | StoredSearch;
  889. export type StoredSearchAndCompareItems = Record<string, StoredSearchAndCompareItem>;
  890. export type StoredStarred = Record<string, boolean>;
  891. export type RecentUsage = Record<string, number>;