您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

119 行
4.2 KiB

  1. 'use strict';
  2. import { commands } from 'vscode';
  3. export const ExtensionId = 'gitlens';
  4. export const ExtensionKey = ExtensionId;
  5. export const ExtensionOutputChannelName = 'GitLens';
  6. export const QualifiedExtensionId = `eamodio.${ExtensionId}`;
  7. export const ApplicationInsightsKey = 'a9c302f8-6483-4d01-b92c-c159c799c679';
  8. export type BuiltInCommands = 'cursorMove' |
  9. 'editor.action.showReferences' |
  10. 'editor.action.toggleRenderWhitespace' |
  11. 'editorScroll' |
  12. 'revealLine' |
  13. 'setContext' |
  14. 'vscode.diff' |
  15. 'vscode.executeDocumentSymbolProvider' |
  16. 'vscode.executeCodeLensProvider' |
  17. 'vscode.open' |
  18. 'vscode.previewHtml' |
  19. 'workbench.action.closeActiveEditor' |
  20. 'workbench.action.closeAllEditors' |
  21. 'workbench.action.nextEditor';
  22. export const BuiltInCommands = {
  23. CloseActiveEditor: 'workbench.action.closeActiveEditor' as BuiltInCommands,
  24. CloseAllEditors: 'workbench.action.closeAllEditors' as BuiltInCommands,
  25. CursorMove: 'cursorMove' as BuiltInCommands,
  26. Diff: 'vscode.diff' as BuiltInCommands,
  27. EditorScroll: 'editorScroll' as BuiltInCommands,
  28. ExecuteDocumentSymbolProvider: 'vscode.executeDocumentSymbolProvider' as BuiltInCommands,
  29. ExecuteCodeLensProvider: 'vscode.executeCodeLensProvider' as BuiltInCommands,
  30. Open: 'vscode.open' as BuiltInCommands,
  31. NextEditor: 'workbench.action.nextEditor' as BuiltInCommands,
  32. PreviewHtml: 'vscode.previewHtml' as BuiltInCommands,
  33. RevealLine: 'revealLine' as BuiltInCommands,
  34. SetContext: 'setContext' as BuiltInCommands,
  35. ShowReferences: 'editor.action.showReferences' as BuiltInCommands,
  36. ToggleRenderWhitespace: 'editor.action.toggleRenderWhitespace' as BuiltInCommands
  37. };
  38. export type CommandContext =
  39. 'gitlens:annotationStatus' |
  40. 'gitlens:canToggleCodeLens' |
  41. 'gitlens:enabled' |
  42. 'gitlens:hasRemotes' |
  43. 'gitlens:gitExplorer:view' |
  44. 'gitlens:isBlameable' |
  45. 'gitlens:isRepository' |
  46. 'gitlens:isTracked' |
  47. 'gitlens:key';
  48. export const CommandContext = {
  49. AnnotationStatus: 'gitlens:annotationStatus' as CommandContext,
  50. CanToggleCodeLens: 'gitlens:canToggleCodeLens' as CommandContext,
  51. Enabled: 'gitlens:enabled' as CommandContext,
  52. GitExplorerView: 'gitlens:gitExplorer:view' as CommandContext,
  53. HasRemotes: 'gitlens:hasRemotes' as CommandContext,
  54. IsBlameable: 'gitlens:isBlameable' as CommandContext,
  55. IsRepository: 'gitlens:isRepository' as CommandContext,
  56. IsTracked: 'gitlens:isTracked' as CommandContext,
  57. Key: 'gitlens:key' as CommandContext
  58. };
  59. export function setCommandContext(key: CommandContext | string, value: any) {
  60. return commands.executeCommand(BuiltInCommands.SetContext, key, value);
  61. }
  62. export type DocumentSchemes = 'file' | 'git' | 'gitlens-git';
  63. export const DocumentSchemes = {
  64. File: 'file' as DocumentSchemes,
  65. Git: 'git' as DocumentSchemes,
  66. GitLensGit: 'gitlens-git' as DocumentSchemes
  67. };
  68. export type GlyphChars = '\u21a9' |
  69. '\u2193' |
  70. '\u2937' |
  71. '\u2190' |
  72. '\u2194' |
  73. '\u2192' |
  74. '\u21e8' |
  75. '\u2191' |
  76. '\u2197' |
  77. '\u2217' |
  78. '\u2713' |
  79. '\u2014' |
  80. '\u2022' |
  81. '\u2026' |
  82. '\u270E' |
  83. '\u00a0' |
  84. '\u200b';
  85. export const GlyphChars = {
  86. ArrowBack: '\u21a9' as GlyphChars,
  87. ArrowDown: '\u2193' as GlyphChars,
  88. ArrowDropRight: '\u2937' as GlyphChars,
  89. ArrowLeft: '\u2190' as GlyphChars,
  90. ArrowLeftRight: '\u2194' as GlyphChars,
  91. ArrowRight: '\u2192' as GlyphChars,
  92. ArrowRightHollow: '\u21e8' as GlyphChars,
  93. ArrowUp: '\u2191' as GlyphChars,
  94. ArrowUpRight: '\u2197' as GlyphChars,
  95. Asterisk: '\u2217' as GlyphChars,
  96. Check: '\u2713' as GlyphChars,
  97. Dash: '\u2014' as GlyphChars,
  98. Dot: '\u2022' as GlyphChars,
  99. Ellipsis: '\u2026' as GlyphChars,
  100. Pensil: '\u270E' as GlyphChars,
  101. Space: '\u00a0' as GlyphChars,
  102. ZeroWidthSpace: '\u200b' as GlyphChars
  103. };
  104. export type GlobalState = 'gitlensVersion';
  105. export const GlobalState = {
  106. GitLensVersion: 'gitlensVersion' as GlobalState
  107. };
  108. export type WorkspaceState = 'gitlens:gitExplorer:view';
  109. export const WorkspaceState = {
  110. GitExplorerView: 'gitlens:gitExplorer:view' as WorkspaceState
  111. };