diff --git a/src/annotations/annotationProvider.ts b/src/annotations/annotationProvider.ts index 005991a..159a8fe 100644 --- a/src/annotations/annotationProvider.ts +++ b/src/annotations/annotationProvider.ts @@ -15,7 +15,7 @@ import { ContextKeys, setContext } from '../constants'; import { Logger } from '../logger'; import { GitDocumentState, TrackedDocument } from '../trackers/gitDocumentTracker'; -export enum AnnotationStatus { +export const enum AnnotationStatus { Computing = 'computing', Computed = 'computed', } diff --git a/src/annotations/fileAnnotationController.ts b/src/annotations/fileAnnotationController.ts index 97b8f9b..fa398b4 100644 --- a/src/annotations/fileAnnotationController.ts +++ b/src/annotations/fileAnnotationController.ts @@ -45,7 +45,7 @@ import { GutterBlameAnnotationProvider } from './gutterBlameAnnotationProvider'; import { ChangesAnnotationContext, GutterChangesAnnotationProvider } from './gutterChangesAnnotationProvider'; import { GutterHeatmapBlameAnnotationProvider } from './gutterHeatmapBlameAnnotationProvider'; -export enum AnnotationClearReason { +export const enum AnnotationClearReason { User = 'User', BlameabilityChanged = 'BlameabilityChanged', ColumnChanged = 'ColumnChanged', diff --git a/src/commands/common.ts b/src/commands/common.ts index bb194a7..41b1c0d 100644 --- a/src/commands/common.ts +++ b/src/commands/common.ts @@ -25,7 +25,7 @@ import { Logger } from '../logger'; import { CommandQuickPickItem, RepositoryPicker } from '../quickpicks'; import { ViewNode, ViewRefNode } from '../views/nodes'; -export enum Commands { +export const enum Commands { ActionPrefix = 'gitlens.action.', AddAuthors = 'gitlens.addAuthors', BrowseRepoAtRevision = 'gitlens.browseRepoAtRevision', @@ -732,7 +732,7 @@ export async function openEditor( } } -export enum OpenWorkspaceLocation { +export const enum OpenWorkspaceLocation { CurrentWindow = 'currentWindow', NewWindow = 'newWindow', AddToWorkspace = 'addToWorkspace', diff --git a/src/config.ts b/src/config.ts index 2989bc7..73267c3 100644 --- a/src/config.ts +++ b/src/config.ts @@ -1,6 +1,6 @@ 'use strict'; -export enum TraceLevel { +export const enum TraceLevel { Silent = 'silent', Errors = 'errors', Verbose = 'verbose', @@ -152,7 +152,7 @@ export interface Config { advanced: AdvancedConfig; } -export enum AnnotationsToggleMode { +export const enum AnnotationsToggleMode { File = 'file', Window = 'window', } @@ -165,25 +165,25 @@ export interface AutolinkReference { ignoreCase?: boolean; } -export enum BlameHighlightLocations { +export const enum BlameHighlightLocations { Gutter = 'gutter', Line = 'line', Overview = 'overview', } -export enum BranchSorting { +export const enum BranchSorting { DateDesc = 'date:desc', DateAsc = 'date:asc', NameAsc = 'name:asc', NameDesc = 'name:desc', } -export enum ChangesLocations { +export const enum ChangesLocations { Gutter = 'gutter', Overview = 'overview', } -export enum CodeLensCommand { +export const enum CodeLensCommand { CopyRemoteCommitUrl = 'gitlens.copyRemoteCommitUrl', CopyRemoteFileUrl = 'gitlens.copyRemoteFileUrl', DiffWithPrevious = 'gitlens.diffWithPrevious', @@ -201,13 +201,13 @@ export enum CodeLensCommand { ToggleFileHeatmap = 'gitlens.toggleFileHeatmap', } -export enum CodeLensScopes { +export const enum CodeLensScopes { Document = 'document', Containers = 'containers', Blocks = 'blocks', } -export enum ContributorSorting { +export const enum ContributorSorting { CountDesc = 'count:desc', CountAsc = 'count:asc', DateDesc = 'date:desc', @@ -216,7 +216,7 @@ export enum ContributorSorting { NameDesc = 'name:desc', } -export enum CustomRemoteType { +export const enum CustomRemoteType { AzureDevOps = 'AzureDevOps', Bitbucket = 'Bitbucket', BitbucketServer = 'BitbucketServer', @@ -227,28 +227,28 @@ export enum CustomRemoteType { GitLab = 'GitLab', } -export enum DateSource { +export const enum DateSource { Authored = 'authored', Committed = 'committed', } -export enum DateStyle { +export const enum DateStyle { Absolute = 'absolute', Relative = 'relative', } -export enum FileAnnotationType { +export const enum FileAnnotationType { Blame = 'blame', Changes = 'changes', Heatmap = 'heatmap', } -export enum GitCommandSorting { +export const enum GitCommandSorting { Name = 'name', Usage = 'usage', } -export enum GravatarDefaultStyle { +export const enum GravatarDefaultStyle { Faces = 'wavatar', Geometric = 'identicon', Monster = 'monsterid', @@ -257,18 +257,18 @@ export enum GravatarDefaultStyle { Robot = 'robohash', } -export enum HeatmapLocations { +export const enum HeatmapLocations { Gutter = 'gutter', Overview = 'overview', } -export enum KeyMap { +export const enum KeyMap { Alternate = 'alternate', Chorded = 'chorded', None = 'none', } -export enum StatusBarCommand { +export const enum StatusBarCommand { CopyRemoteCommitUrl = 'gitlens.copyRemoteCommitUrl', CopyRemoteFileUrl = 'gitlens.copyRemoteFileUrl', DiffWithPrevious = 'gitlens.diffWithPrevious', @@ -288,25 +288,25 @@ export enum StatusBarCommand { ToggleFileHeatmap = 'gitlens.toggleFileHeatmap', } -export enum TagSorting { +export const enum TagSorting { DateDesc = 'date:desc', DateAsc = 'date:asc', NameAsc = 'name:asc', NameDesc = 'name:desc', } -export enum ViewBranchesLayout { +export const enum ViewBranchesLayout { List = 'list', Tree = 'tree', } -export enum ViewFilesLayout { +export const enum ViewFilesLayout { Auto = 'auto', List = 'list', Tree = 'tree', } -export enum ViewShowBranchComparison { +export const enum ViewShowBranchComparison { Branch = 'branch', Working = 'working', } diff --git a/src/constants.ts b/src/constants.ts index c72eb6d..4626cd7 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -5,7 +5,7 @@ import { SearchPattern } from './git/git'; export const quickPickTitleMaxChars = 80; -export enum BuiltInCommands { +export const enum BuiltInCommands { CloseActiveEditor = 'workbench.action.closeActiveEditor', CloseAllEditors = 'workbench.action.closeAllEditors', CursorMove = 'cursorMove', @@ -27,7 +27,7 @@ export enum BuiltInCommands { ShowReferences = 'editor.action.showReferences', } -export enum BuiltInGitCommands { +export const enum BuiltInGitCommands { Publish = 'git.publish', Pull = 'git.pull', PullRebase = 'git.pullRebase', @@ -36,13 +36,13 @@ export enum BuiltInGitCommands { UndoCommit = 'git.undoCommit', } -export enum BuiltInGitConfiguration { +export const enum BuiltInGitConfiguration { AutoRepositoryDetection = 'git.autoRepositoryDetection', FetchOnPull = 'git.fetchOnPull', UseForcePushWithLease = 'git.useForcePushWithLease', } -export enum ContextKeys { +export const enum ContextKeys { ActionPrefix = 'gitlens:action:', ActiveFileStatus = 'gitlens:activeFileStatus', AnnotationStatus = 'gitlens:annotationStatus', @@ -71,7 +71,7 @@ export function setContext(key: ContextKeys | string, value: any) { return commands.executeCommand(BuiltInCommands.SetContext, key, value); } -export enum Colors { +export const enum Colors { GutterBackgroundColor = 'gitlens.gutterBackgroundColor', GutterForegroundColor = 'gitlens.gutterForegroundColor', GutterUncommittedForegroundColor = 'gitlens.gutterUncommittedForegroundColor', @@ -87,7 +87,7 @@ export enum Colors { UnpulledChangesIconColor = 'gitlens.unpulledChangesIconColor', } -export enum DocumentSchemes { +export const enum DocumentSchemes { DebugConsole = 'debug', File = 'file', Git = 'git', @@ -172,14 +172,14 @@ export const enum GlyphChars { ZeroWidthSpace = '\u200b', } -export enum SyncedState { +export const enum SyncedState { Version = 'gitlens:synced:version', WelcomeViewVisible = 'gitlens:views:welcome:visible', Deprecated_DisallowConnectionPrefix = 'gitlens:disallow:connection:', } -export enum GlobalState { +export const enum GlobalState { Avatars = 'gitlens:avatars', PendingWelcomeOnFocus = 'gitlens:pendingWelcomeOnFocus', PendingWhatsNewOnFocus = 'gitlens:pendingWhatsNewOnFocus', @@ -254,7 +254,7 @@ export interface Usage { [id: string]: number; } -export enum WorkspaceState { +export const enum WorkspaceState { AssumeRepositoriesOnStartup = 'gitlens:assumeRepositoriesOnStartup', BranchComparisons = 'gitlens:branch:comparisons', diff --git a/src/git/git.ts b/src/git/git.ts index ddb58b7..8418af0 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -56,7 +56,7 @@ const GitWarnings = { notAGitCommand: /'.+' is not a git command/i, }; -export enum GitErrorHandling { +export const enum GitErrorHandling { Ignore = 'ignore', Throw = 'throw', } diff --git a/src/git/gitProvider.ts b/src/git/gitProvider.ts index d4f90f2..8150c17 100644 --- a/src/git/gitProvider.ts +++ b/src/git/gitProvider.ts @@ -35,7 +35,7 @@ import { GitUri } from './gitUri'; import { RemoteProviders } from './remotes/factory'; import { SearchPattern } from './search'; -export enum GitProviderId { +export const enum GitProviderId { Git = 'git', GitHub = 'github', } diff --git a/src/git/models/branch.ts b/src/git/models/branch.ts index 5aea521..8664fe2 100644 --- a/src/git/models/branch.ts +++ b/src/git/models/branch.ts @@ -25,7 +25,7 @@ export interface GitTrackingState { behind: number; } -export enum GitBranchStatus { +export const enum GitBranchStatus { Ahead = 'ahead', Behind = 'behind', Diverged = 'diverged', diff --git a/src/git/models/commit.ts b/src/git/models/commit.ts index 45c4500..2600463 100644 --- a/src/git/models/commit.ts +++ b/src/git/models/commit.ts @@ -21,7 +21,7 @@ export interface GitCommitLine { code?: string; } -export enum GitCommitType { +export const enum GitCommitType { Blame = 'blame', Log = 'log', LogFile = 'logFile', diff --git a/src/git/models/file.ts b/src/git/models/file.ts index cccef3b..f8d8a12 100644 --- a/src/git/models/file.ts +++ b/src/git/models/file.ts @@ -6,7 +6,7 @@ import { GitLogCommit } from './logCommit'; export declare type GitFileStatus = GitFileConflictStatus | GitFileIndexStatus | GitFileWorkingTreeStatus; -export enum GitFileConflictStatus { +export const enum GitFileConflictStatus { AddedByBoth = 'AA', AddedByUs = 'AU', AddedByThem = 'UA', @@ -16,7 +16,7 @@ export enum GitFileConflictStatus { ModifiedByBoth = 'UU', } -export enum GitFileIndexStatus { +export const enum GitFileIndexStatus { Added = 'A', Deleted = 'D', Modified = 'M', @@ -24,7 +24,7 @@ export enum GitFileIndexStatus { Copied = 'C', } -export enum GitFileWorkingTreeStatus { +export const enum GitFileWorkingTreeStatus { Added = 'A', Deleted = 'D', Modified = 'M', diff --git a/src/git/models/pullRequest.ts b/src/git/models/pullRequest.ts index 3df3842..ca7f14f 100644 --- a/src/git/models/pullRequest.ts +++ b/src/git/models/pullRequest.ts @@ -13,7 +13,7 @@ export const PullRequestDateFormatting = { }, }; -export enum PullRequestState { +export const enum PullRequestState { Open = 'Open', Closed = 'Closed', Merged = 'Merged', diff --git a/src/git/models/remote.ts b/src/git/models/remote.ts index b5b3215..79c7e35 100644 --- a/src/git/models/remote.ts +++ b/src/git/models/remote.ts @@ -3,7 +3,7 @@ import { WorkspaceState } from '../../constants'; import { Container } from '../../container'; import { RemoteProvider, RichRemoteProvider } from '../remotes/factory'; -export enum GitRemoteType { +export const enum GitRemoteType { Fetch = 'fetch', Push = 'push', } diff --git a/src/git/remotes/provider.ts b/src/git/remotes/provider.ts index d099944..0201a4e 100644 --- a/src/git/remotes/provider.ts +++ b/src/git/remotes/provider.ts @@ -26,7 +26,7 @@ import { Repository, } from '../models/models'; -export enum RemoteResourceType { +export const enum RemoteResourceType { Branch = 'branch', Branches = 'branches', Commit = 'commit', diff --git a/src/messages.ts b/src/messages.ts index 7cf5172..2f98d08 100644 --- a/src/messages.ts +++ b/src/messages.ts @@ -4,7 +4,7 @@ import { configuration } from './configuration'; import { GitCommit } from './git/git'; import { Logger } from './logger'; -export enum SuppressedMessages { +export const enum SuppressedMessages { CommitHasNoPreviousCommitWarning = 'suppressCommitHasNoPreviousCommitWarning', CommitNotFoundWarning = 'suppressCommitNotFoundWarning', CreatePullRequestPrompt = 'suppressCreatePullRequestPrompt', diff --git a/src/quickpicks/referencePicker.ts b/src/quickpicks/referencePicker.ts index 95b807c..d3ea276 100644 --- a/src/quickpicks/referencePicker.ts +++ b/src/quickpicks/referencePicker.ts @@ -10,7 +10,7 @@ import { BranchQuickPickItem, getQuickPickIgnoreFocusOut, RefQuickPickItem, TagQ export type ReferencesQuickPickItem = BranchQuickPickItem | TagQuickPickItem | RefQuickPickItem; -export enum ReferencesQuickPickIncludes { +export const enum ReferencesQuickPickIncludes { Branches = 1, Tags = 2, WorkingTree = 4, diff --git a/src/views/nodes/viewNode.ts b/src/views/nodes/viewNode.ts index e17d4ab..1b0d6f3 100644 --- a/src/views/nodes/viewNode.ts +++ b/src/views/nodes/viewNode.ts @@ -25,7 +25,7 @@ import { Logger } from '../../logger'; import { debug, Functions, gate, log, logName, Strings } from '../../system'; import { TreeViewNodeCollapsibleStateChangeEvent, View } from '../viewBase'; -export enum ContextValues { +export const enum ContextValues { ActiveFileHistory = 'gitlens:history:active:file', ActiveLineHistory = 'gitlens:history:active:line', Branch = 'gitlens:branch',