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.

578 regels
11 KiB

4 jaren geleden
5 jaren geleden
5 jaren geleden
4 jaren geleden
  1. 'use strict';
  2. export enum TraceLevel {
  3. Silent = 'silent',
  4. Errors = 'errors',
  5. Verbose = 'verbose',
  6. Debug = 'debug',
  7. }
  8. export interface Config {
  9. autolinks: AutolinkReference[] | null;
  10. blame: {
  11. avatars: boolean;
  12. compact: boolean;
  13. dateFormat: string | null;
  14. format: string;
  15. heatmap: {
  16. enabled: boolean;
  17. location: 'left' | 'right';
  18. };
  19. highlight: {
  20. enabled: boolean;
  21. locations: BlameHighlightLocations[];
  22. };
  23. ignoreWhitespace: boolean;
  24. separateLines: boolean;
  25. toggleMode: AnnotationsToggleMode;
  26. };
  27. changes: {
  28. locations: ChangesLocations[];
  29. toggleMode: AnnotationsToggleMode;
  30. };
  31. codeLens: CodeLensConfig;
  32. currentLine: {
  33. dateFormat: string | null;
  34. enabled: boolean;
  35. format: string;
  36. pullRequests: {
  37. enabled: boolean;
  38. };
  39. scrollable: boolean;
  40. };
  41. debug: boolean;
  42. defaultDateFormat: string | null;
  43. defaultDateShortFormat: string | null;
  44. defaultDateSource: DateSource;
  45. defaultDateStyle: DateStyle;
  46. defaultGravatarsStyle: GravatarDefaultStyle;
  47. defaultTimeFormat: string | null;
  48. fileAnnotations: {
  49. command: string | null;
  50. };
  51. gitCommands: {
  52. closeOnFocusOut: boolean;
  53. search: {
  54. matchAll: boolean;
  55. matchCase: boolean;
  56. matchRegex: boolean;
  57. showResultsInSideBar: boolean | null;
  58. };
  59. skipConfirmations: string[];
  60. sortBy: GitCommandSorting;
  61. };
  62. heatmap: {
  63. ageThreshold: number;
  64. coldColor: string;
  65. hotColor: string;
  66. locations: HeatmapLocations[];
  67. toggleMode: AnnotationsToggleMode;
  68. };
  69. hovers: {
  70. annotations: {
  71. changes: boolean;
  72. details: boolean;
  73. enabled: boolean;
  74. over: 'line' | 'annotation';
  75. };
  76. autolinks: {
  77. enabled: boolean;
  78. enhanced: boolean;
  79. };
  80. currentLine: {
  81. changes: boolean;
  82. details: boolean;
  83. enabled: boolean;
  84. over: 'line' | 'annotation';
  85. };
  86. avatars: boolean;
  87. avatarSize: number;
  88. changesDiff: 'line' | 'hunk';
  89. detailsMarkdownFormat: string;
  90. enabled: boolean;
  91. pullRequests: {
  92. enabled: boolean;
  93. };
  94. };
  95. integrations: {
  96. enabled: boolean;
  97. };
  98. keymap: KeyMap;
  99. liveshare: {
  100. allowGuestAccess: boolean;
  101. };
  102. menus: boolean | MenuConfig;
  103. mode: {
  104. active: string;
  105. statusBar: {
  106. enabled: boolean;
  107. alignment: 'left' | 'right';
  108. };
  109. };
  110. modes: Record<string, ModeConfig>;
  111. outputLevel: TraceLevel;
  112. remotes: RemotesConfig[] | null;
  113. showWelcomeOnInstall: boolean;
  114. showWhatsNewAfterUpgrades: boolean;
  115. sortBranchesBy: BranchSorting;
  116. sortTagsBy: TagSorting;
  117. statusBar: {
  118. alignment: 'left' | 'right';
  119. command: StatusBarCommand;
  120. dateFormat: string | null;
  121. enabled: boolean;
  122. format: string;
  123. reduceFlicker: boolean;
  124. pullRequests: {
  125. enabled: boolean;
  126. };
  127. };
  128. strings: {
  129. codeLens: {
  130. unsavedChanges: {
  131. recentChangeAndAuthors: string;
  132. recentChangeOnly: string;
  133. authorsOnly: string;
  134. };
  135. };
  136. };
  137. views: ViewsConfig;
  138. advanced: AdvancedConfig;
  139. }
  140. export enum AnnotationsToggleMode {
  141. File = 'file',
  142. Window = 'window',
  143. }
  144. export interface AutolinkReference {
  145. prefix: string;
  146. url: string;
  147. title?: string;
  148. alphanumeric?: boolean;
  149. ignoreCase?: boolean;
  150. }
  151. export enum BlameHighlightLocations {
  152. Gutter = 'gutter',
  153. Line = 'line',
  154. Overview = 'overview',
  155. }
  156. export enum BranchSorting {
  157. NameDesc = 'name:desc',
  158. NameAsc = 'name:asc',
  159. DateDesc = 'date:desc',
  160. DateAsc = 'date:asc',
  161. }
  162. export enum ChangesLocations {
  163. Gutter = 'gutter',
  164. Overview = 'overview',
  165. }
  166. export enum CodeLensCommand {
  167. DiffWithPrevious = 'gitlens.diffWithPrevious',
  168. RevealCommitInView = 'gitlens.revealCommitInView',
  169. ShowCommitsInView = 'gitlens.showCommitsInView',
  170. ShowQuickCommitDetails = 'gitlens.showQuickCommitDetails',
  171. ShowQuickCommitFileDetails = 'gitlens.showQuickCommitFileDetails',
  172. ShowQuickCurrentBranchHistory = 'gitlens.showQuickRepoHistory',
  173. ShowQuickFileHistory = 'gitlens.showQuickFileHistory',
  174. ToggleFileBlame = 'gitlens.toggleFileBlame',
  175. }
  176. export enum CodeLensScopes {
  177. Document = 'document',
  178. Containers = 'containers',
  179. Blocks = 'blocks',
  180. }
  181. export enum CustomRemoteType {
  182. Bitbucket = 'Bitbucket',
  183. BitbucketServer = 'BitbucketServer',
  184. Custom = 'Custom',
  185. GitHub = 'GitHub',
  186. GitLab = 'GitLab',
  187. }
  188. export enum DateSource {
  189. Authored = 'authored',
  190. Committed = 'committed',
  191. }
  192. export enum DateStyle {
  193. Absolute = 'absolute',
  194. Relative = 'relative',
  195. }
  196. export enum FileAnnotationType {
  197. Blame = 'blame',
  198. Changes = 'changes',
  199. Heatmap = 'heatmap',
  200. }
  201. export enum GitCommandSorting {
  202. Name = 'name',
  203. Usage = 'usage',
  204. }
  205. export enum GravatarDefaultStyle {
  206. Faces = 'wavatar',
  207. Geometric = 'identicon',
  208. Monster = 'monsterid',
  209. MysteryPerson = 'mp',
  210. Retro = 'retro',
  211. Robot = 'robohash',
  212. }
  213. export enum HeatmapLocations {
  214. Gutter = 'gutter',
  215. Overview = 'overview',
  216. }
  217. export enum KeyMap {
  218. Alternate = 'alternate',
  219. Chorded = 'chorded',
  220. None = 'none',
  221. }
  222. export enum StatusBarCommand {
  223. DiffWithPrevious = 'gitlens.diffWithPrevious',
  224. DiffWithWorking = 'gitlens.diffWithWorking',
  225. RevealCommitInView = 'gitlens.revealCommitInView',
  226. ShowCommitsInView = 'gitlens.showCommitsInView',
  227. ShowQuickCommitDetails = 'gitlens.showQuickCommitDetails',
  228. ShowQuickCommitFileDetails = 'gitlens.showQuickCommitFileDetails',
  229. ShowQuickCurrentBranchHistory = 'gitlens.showQuickRepoHistory',
  230. ShowQuickFileHistory = 'gitlens.showQuickFileHistory',
  231. ToggleCodeLens = 'gitlens.toggleCodeLens',
  232. ToggleFileBlame = 'gitlens.toggleFileBlame',
  233. }
  234. export enum TagSorting {
  235. NameDesc = 'name:desc',
  236. NameAsc = 'name:asc',
  237. DateDesc = 'date:desc',
  238. DateAsc = 'date:asc',
  239. }
  240. export enum ViewBranchesLayout {
  241. List = 'list',
  242. Tree = 'tree',
  243. }
  244. export enum ViewFilesLayout {
  245. Auto = 'auto',
  246. List = 'list',
  247. Tree = 'tree',
  248. }
  249. export enum ViewShowBranchComparison {
  250. Branch = 'branch',
  251. Working = 'working',
  252. }
  253. export interface AdvancedConfig {
  254. abbreviatedShaLength: number;
  255. blame: {
  256. customArguments: string[] | null;
  257. delayAfterEdit: number;
  258. sizeThresholdAfterEdit: number;
  259. };
  260. caching: {
  261. enabled: boolean;
  262. };
  263. fileHistoryFollowsRenames: boolean;
  264. fileHistoryShowAllBranches: boolean;
  265. maxListItems: number;
  266. maxSearchItems: number;
  267. messages: {
  268. suppressCommitHasNoPreviousCommitWarning: boolean;
  269. suppressCommitNotFoundWarning: boolean;
  270. suppressFileNotUnderSourceControlWarning: boolean;
  271. suppressGitDisabledWarning: boolean;
  272. suppressGitVersionWarning: boolean;
  273. suppressLineUncommittedWarning: boolean;
  274. suppressNoRepositoryWarning: boolean;
  275. };
  276. quickPick: {
  277. closeOnFocusOut: boolean;
  278. };
  279. repositorySearchDepth: number;
  280. similarityThreshold: number | null;
  281. useSymmetricDifferenceNotation: boolean;
  282. }
  283. export interface CodeLensConfig {
  284. authors: {
  285. enabled: boolean;
  286. command: CodeLensCommand | false;
  287. };
  288. enabled: boolean;
  289. includeSingleLineSymbols: boolean;
  290. recentChange: {
  291. enabled: boolean;
  292. command: CodeLensCommand | false;
  293. };
  294. scopes: CodeLensScopes[];
  295. scopesByLanguage: CodeLensLanguageScope[] | null;
  296. symbolScopes: string[];
  297. }
  298. export interface CodeLensLanguageScope {
  299. language: string | undefined;
  300. scopes?: CodeLensScopes[];
  301. symbolScopes?: string[];
  302. }
  303. export interface MenuConfig {
  304. editor:
  305. | false
  306. | {
  307. blame: boolean;
  308. clipboard: boolean;
  309. compare: boolean;
  310. history: boolean;
  311. remote: boolean;
  312. };
  313. editorGroup:
  314. | false
  315. | {
  316. blame: boolean;
  317. compare: boolean;
  318. };
  319. editorTab:
  320. | false
  321. | {
  322. clipboard: boolean;
  323. compare: boolean;
  324. history: boolean;
  325. remote: boolean;
  326. };
  327. explorer:
  328. | false
  329. | {
  330. clipboard: boolean;
  331. compare: boolean;
  332. history: boolean;
  333. remote: boolean;
  334. };
  335. scm:
  336. | false
  337. | {
  338. authors: boolean;
  339. };
  340. scmGroupInline:
  341. | false
  342. | {
  343. stash: boolean;
  344. };
  345. scmGroup:
  346. | false
  347. | {
  348. compare: boolean;
  349. openClose: boolean;
  350. stash: boolean;
  351. };
  352. scmItem:
  353. | false
  354. | {
  355. clipboard: boolean;
  356. compare: boolean;
  357. history: boolean;
  358. remote: boolean;
  359. stash: boolean;
  360. };
  361. }
  362. export interface ModeConfig {
  363. name: string;
  364. statusBarItemName?: string;
  365. description?: string;
  366. annotations?: 'blame' | 'changes' | 'heatmap';
  367. codeLens?: boolean;
  368. currentLine?: boolean;
  369. hovers?: boolean;
  370. statusBar?: boolean;
  371. }
  372. export interface RemotesConfig {
  373. domain: string;
  374. name?: string;
  375. protocol?: string;
  376. type: CustomRemoteType;
  377. urls?: RemotesUrlsConfig;
  378. }
  379. export interface RemotesUrlsConfig {
  380. repository: string;
  381. branches: string;
  382. branch: string;
  383. commit: string;
  384. comparison?: string;
  385. file: string;
  386. fileInBranch: string;
  387. fileInCommit: string;
  388. fileLine: string;
  389. fileRange: string;
  390. }
  391. export interface ViewsCommonConfig {
  392. defaultItemLimit: number;
  393. formats: {
  394. commits: {
  395. label: string;
  396. description: string;
  397. };
  398. files: {
  399. label: string;
  400. description: string;
  401. };
  402. stashes: {
  403. label: string;
  404. description: string;
  405. };
  406. };
  407. pageItemLimit: number;
  408. showRelativeDateMarkers: boolean;
  409. }
  410. export const viewsCommonConfigKeys: (keyof ViewsCommonConfig)[] = [
  411. 'defaultItemLimit',
  412. 'formats',
  413. 'pageItemLimit',
  414. 'showRelativeDateMarkers',
  415. ];
  416. interface ViewsConfigs {
  417. branches: BranchesViewConfig;
  418. commits: CommitsViewConfig;
  419. contributors: ContributorsViewConfig;
  420. fileHistory: FileHistoryViewConfig;
  421. lineHistory: LineHistoryViewConfig;
  422. remotes: RemotesViewConfig;
  423. repositories: RepositoriesViewConfig;
  424. searchAndCompare: SearchAndCompareViewConfig;
  425. stashes: StashesViewConfig;
  426. tags: TagsViewConfig;
  427. }
  428. export type ViewsConfigKeys = keyof ViewsConfigs;
  429. export const viewsConfigKeys: ViewsConfigKeys[] = [
  430. 'commits',
  431. 'repositories',
  432. 'fileHistory',
  433. 'lineHistory',
  434. 'branches',
  435. 'remotes',
  436. 'stashes',
  437. 'tags',
  438. 'contributors',
  439. 'searchAndCompare',
  440. ];
  441. export type ViewsConfig = ViewsCommonConfig & ViewsConfigs;
  442. export interface BranchesViewConfig {
  443. avatars: boolean;
  444. branches: {
  445. layout: ViewBranchesLayout;
  446. };
  447. files: ViewsFilesConfig;
  448. pullRequests: {
  449. enabled: boolean;
  450. showForBranches: boolean;
  451. showForCommits: boolean;
  452. };
  453. showBranchComparison: false | ViewShowBranchComparison;
  454. }
  455. export interface CommitsViewConfig {
  456. avatars: boolean;
  457. branches: undefined;
  458. files: ViewsFilesConfig;
  459. pullRequests: {
  460. enabled: boolean;
  461. showForBranches: boolean;
  462. showForCommits: boolean;
  463. };
  464. showBranchComparison: false | ViewShowBranchComparison;
  465. }
  466. export interface ContributorsViewConfig {
  467. avatars: boolean;
  468. files: ViewsFilesConfig;
  469. pullRequests: {
  470. enabled: boolean;
  471. showForCommits: boolean;
  472. };
  473. }
  474. export interface FileHistoryViewConfig {
  475. avatars: boolean;
  476. }
  477. export interface LineHistoryViewConfig {
  478. avatars: boolean;
  479. enabled: boolean;
  480. }
  481. export interface RemotesViewConfig {
  482. avatars: boolean;
  483. branches: {
  484. layout: ViewBranchesLayout;
  485. };
  486. files: ViewsFilesConfig;
  487. pullRequests: {
  488. enabled: boolean;
  489. showForBranches: boolean;
  490. showForCommits: boolean;
  491. };
  492. }
  493. export interface RepositoriesViewConfig {
  494. autoRefresh: boolean;
  495. autoReveal: boolean;
  496. avatars: boolean;
  497. branches: {
  498. layout: ViewBranchesLayout;
  499. };
  500. compact: boolean;
  501. enabled: boolean;
  502. files: ViewsFilesConfig;
  503. includeWorkingTree: boolean;
  504. pullRequests: {
  505. enabled: boolean;
  506. showForBranches: boolean;
  507. showForCommits: boolean;
  508. };
  509. showBranchComparison: false | ViewShowBranchComparison;
  510. }
  511. export interface SearchAndCompareViewConfig {
  512. avatars: boolean;
  513. files: ViewsFilesConfig;
  514. pullRequests: {
  515. enabled: boolean;
  516. showForCommits: boolean;
  517. };
  518. }
  519. export interface StashesViewConfig {
  520. files: ViewsFilesConfig;
  521. }
  522. export interface TagsViewConfig {
  523. avatars: boolean;
  524. branches: {
  525. layout: ViewBranchesLayout;
  526. };
  527. files: ViewsFilesConfig;
  528. }
  529. export interface ViewsFilesConfig {
  530. compact: boolean;
  531. layout: ViewFilesLayout;
  532. threshold: number;
  533. }