diff --git a/src/annotations/annotationProvider.ts b/src/annotations/annotationProvider.ts index f06bae6..a9efc71 100644 --- a/src/annotations/annotationProvider.ts +++ b/src/annotations/annotationProvider.ts @@ -1,5 +1,4 @@ 'use strict'; -import { Functions } from '../system'; import { DecorationOptions, Disposable, @@ -11,9 +10,10 @@ import { Uri, window } from 'vscode'; -import { FileAnnotationType } from '../configuration'; import { TextDocumentComparer } from '../comparers'; +import { FileAnnotationType } from '../configuration'; import { CommandContext, setCommandContext } from '../constants'; +import { Functions } from '../system'; import { GitDocumentState, TrackedDocument } from '../trackers/gitDocumentTracker'; export enum AnnotationStatus { diff --git a/src/annotations/annotations.ts b/src/annotations/annotations.ts index d1b167a..397aae7 100644 --- a/src/annotations/annotations.ts +++ b/src/annotations/annotations.ts @@ -1,4 +1,3 @@ -import { Objects, Strings } from '../system'; import { DecorationInstanceRenderOptions, DecorationOptions, @@ -13,7 +12,7 @@ import { ShowQuickCommitDetailsCommand, ShowQuickCommitFileDetailsCommand } from '../commands'; -import { FileAnnotationType } from './../configuration'; +import { FileAnnotationType } from '../configuration'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { @@ -25,6 +24,7 @@ import { GitUri, ICommitFormatOptions } from '../gitService'; +import { Objects, Strings } from '../system'; import { toRgba } from '../ui/shared/colors'; export interface ComputedHeatmap { diff --git a/src/annotations/blameAnnotationProvider.ts b/src/annotations/blameAnnotationProvider.ts index 0b8f763..37d4bef 100644 --- a/src/annotations/blameAnnotationProvider.ts +++ b/src/annotations/blameAnnotationProvider.ts @@ -1,5 +1,4 @@ 'use strict'; -import { Arrays, Iterables } from '../system'; import { CancellationToken, Disposable, @@ -12,11 +11,12 @@ import { TextEditor, TextEditorDecorationType } from 'vscode'; -import { AnnotationProviderBase } from './annotationProvider'; -import { Annotations, ComputedHeatmap } from './annotations'; import { Container } from '../container'; -import { GitDocumentState, TrackedDocument } from '../trackers/gitDocumentTracker'; import { GitBlame, GitCommit, GitUri } from '../gitService'; +import { Arrays, Iterables } from '../system'; +import { GitDocumentState, TrackedDocument } from '../trackers/gitDocumentTracker'; +import { AnnotationProviderBase } from './annotationProvider'; +import { Annotations, ComputedHeatmap } from './annotations'; export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase { protected _blame: Promise; diff --git a/src/annotations/fileAnnotationController.ts b/src/annotations/fileAnnotationController.ts index 37b422d..1571839 100644 --- a/src/annotations/fileAnnotationController.ts +++ b/src/annotations/fileAnnotationController.ts @@ -1,5 +1,5 @@ 'use strict'; -import { Functions, Iterables } from '../system'; +import * as path from 'path'; import { ConfigurationChangeEvent, DecorationRangeBehavior, @@ -18,21 +18,21 @@ import { window, workspace } from 'vscode'; -import { AnnotationProviderBase, AnnotationStatus, TextEditorCorrelationKey } from './annotationProvider'; import { AnnotationsToggleMode, configuration, FileAnnotationType, HighlightLocations } from '../configuration'; import { CommandContext, isTextEditor, setCommandContext } from '../constants'; import { Container } from '../container'; +import { KeyboardScope, KeyCommand, Keys } from '../keyboard'; +import { Logger } from '../logger'; +import { Functions, Iterables } from '../system'; import { DocumentBlameStateChangeEvent, DocumentDirtyStateChangeEvent, GitDocumentState } from '../trackers/gitDocumentTracker'; +import { AnnotationProviderBase, AnnotationStatus, TextEditorCorrelationKey } from './annotationProvider'; import { GutterBlameAnnotationProvider } from './gutterBlameAnnotationProvider'; import { HeatmapBlameAnnotationProvider } from './heatmapBlameAnnotationProvider'; -import { KeyboardScope, KeyCommand, Keys } from '../keyboard'; -import { Logger } from '../logger'; import { RecentChangesAnnotationProvider } from './recentChangesAnnotationProvider'; -import * as path from 'path'; export enum AnnotationClearReason { User = 'User', diff --git a/src/annotations/gutterBlameAnnotationProvider.ts b/src/annotations/gutterBlameAnnotationProvider.ts index 39d7fc5..2a129dc 100644 --- a/src/annotations/gutterBlameAnnotationProvider.ts +++ b/src/annotations/gutterBlameAnnotationProvider.ts @@ -1,13 +1,13 @@ 'use strict'; -import { Objects, Strings } from '../system'; import { DecorationOptions, DecorationRenderOptions, Range, TextEditorDecorationType, window } from 'vscode'; -import { Annotations } from './annotations'; -import { BlameAnnotationProviderBase } from './blameAnnotationProvider'; import { FileAnnotationType, GravatarDefaultStyle } from '../configuration'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { GitBlameCommit, ICommitFormatOptions } from '../gitService'; import { Logger } from '../logger'; +import { Objects, Strings } from '../system'; +import { Annotations } from './annotations'; +import { BlameAnnotationProviderBase } from './blameAnnotationProvider'; export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase { async onProvideAnnotation(shaOrLine?: string | number, type?: FileAnnotationType): Promise { diff --git a/src/annotations/heatmapBlameAnnotationProvider.ts b/src/annotations/heatmapBlameAnnotationProvider.ts index 2070cc8..306b4f3 100644 --- a/src/annotations/heatmapBlameAnnotationProvider.ts +++ b/src/annotations/heatmapBlameAnnotationProvider.ts @@ -1,11 +1,11 @@ 'use strict'; import { DecorationOptions, Range } from 'vscode'; -import { Annotations } from './annotations'; -import { BlameAnnotationProviderBase } from './blameAnnotationProvider'; -import { FileAnnotationType } from './../configuration'; +import { FileAnnotationType } from '../configuration'; import { Container } from '../container'; import { GitBlameCommit } from '../gitService'; import { Logger } from '../logger'; +import { Annotations } from './annotations'; +import { BlameAnnotationProviderBase } from './blameAnnotationProvider'; export class HeatmapBlameAnnotationProvider extends BlameAnnotationProviderBase { async onProvideAnnotation(shaOrLine?: string | number, type?: FileAnnotationType): Promise { diff --git a/src/annotations/hoverBlameAnnotationProvider.ts b/src/annotations/hoverBlameAnnotationProvider.ts deleted file mode 100644 index 29e1f9c..0000000 --- a/src/annotations/hoverBlameAnnotationProvider.ts +++ /dev/null @@ -1,71 +0,0 @@ -// 'use strict'; -// import { DecorationOptions, Range } from 'vscode'; -// import { Annotations } from './annotations'; -// import { BlameAnnotationProviderBase } from './blameAnnotationProvider'; -// import { FileAnnotationType } from './../configuration'; -// import { Container } from '../container'; -// import { GitBlameCommit } from '../gitService'; -// import { Logger } from '../logger'; - -// export class HoverBlameAnnotationProvider extends BlameAnnotationProviderBase { - -// async onProvideAnnotation(shaOrLine?: string | number): Promise { -// this.annotationType = FileAnnotationType.Hover; - -// const cfg = Container.config.annotations.file.hover; - -// const blame = await this.getBlame(); -// if (blame === undefined) return false; - -// if (cfg.heatmap.enabled) { -// const start = process.hrtime(); - -// const now = Date.now(); -// const renderOptions = Annotations.hoverRenderOptions(cfg.heatmap); - -// this.decorations = []; -// const decorationsMap: { [sha: string]: DecorationOptions } = Object.create(null); - -// let commit: GitBlameCommit | undefined; -// let hover: DecorationOptions | undefined; - -// for (const l of blame.lines) { -// const line = l.line; - -// hover = decorationsMap[l.sha]; - -// if (hover !== undefined) { -// hover = { -// ...hover, -// range: new Range(line, 0, line, 0) -// } as DecorationOptions; - -// this.decorations.push(hover); - -// continue; -// } - -// commit = blame.commits.get(l.sha); -// if (commit === undefined) continue; - -// hover = Annotations.hover(commit, renderOptions, now); -// hover.range = new Range(line, 0, line, 0); - -// this.decorations.push(hover); -// decorationsMap[l.sha] = hover; - -// } - -// if (this.decorations.length) { -// this.editor.setDecorations(this.decoration!, this.decorations); -// } - -// const duration = process.hrtime(start); -// Logger.log(`${(duration[0] * 1000) + Math.floor(duration[1] / 1000000)} ms to compute hover blame annotations`); -// } - -// this.registerHoverProviders(cfg); -// this.selection(shaOrLine, blame); -// return true; -// } -// } diff --git a/src/annotations/lineAnnotationController.ts b/src/annotations/lineAnnotationController.ts index dc3b1df..e85a58f 100644 --- a/src/annotations/lineAnnotationController.ts +++ b/src/annotations/lineAnnotationController.ts @@ -10,11 +10,11 @@ import { TextEditorDecorationType, window } from 'vscode'; +import { configuration } from '../configuration'; +import { isTextEditor } from '../constants'; +import { Container } from '../container'; +import { LinesChangeEvent } from '../trackers/gitLineTracker'; import { Annotations } from './annotations'; -import { configuration } from './../configuration'; -import { isTextEditor } from './../constants'; -import { Container } from './../container'; -import { LinesChangeEvent } from './../trackers/gitLineTracker'; const annotationDecoration: TextEditorDecorationType = window.createTextEditorDecorationType({ after: { diff --git a/src/annotations/recentChangesAnnotationProvider.ts b/src/annotations/recentChangesAnnotationProvider.ts index e80b6c8..cb15a5d 100644 --- a/src/annotations/recentChangesAnnotationProvider.ts +++ b/src/annotations/recentChangesAnnotationProvider.ts @@ -1,12 +1,12 @@ 'use strict'; import { DecorationOptions, MarkdownString, Position, Range, TextEditor, TextEditorDecorationType } from 'vscode'; -import { AnnotationProviderBase } from './annotationProvider'; -import { Annotations } from './annotations'; -import { FileAnnotationType } from './../configuration'; +import { FileAnnotationType } from '../configuration'; import { Container } from '../container'; -import { GitDocumentState, TrackedDocument } from '../trackers/gitDocumentTracker'; import { GitUri } from '../gitService'; import { Logger } from '../logger'; +import { GitDocumentState, TrackedDocument } from '../trackers/gitDocumentTracker'; +import { AnnotationProviderBase } from './annotationProvider'; +import { Annotations } from './annotations'; export class RecentChangesAnnotationProvider extends AnnotationProviderBase { private readonly _uri: GitUri; diff --git a/src/codeLensController.ts b/src/codelens/codeLensController.ts similarity index 94% rename from src/codeLensController.ts rename to src/codelens/codeLensController.ts index a8970b9..3ffbaee 100644 --- a/src/codeLensController.ts +++ b/src/codelens/codeLensController.ts @@ -1,15 +1,15 @@ 'use strict'; import { ConfigurationChangeEvent, Disposable, languages } from 'vscode'; -import { configuration } from './configuration'; -import { CommandContext, setCommandContext } from './constants'; -import { Container } from './container'; +import { configuration } from '../configuration'; +import { CommandContext, setCommandContext } from '../constants'; +import { Container } from '../container'; +import { Logger } from '../logger'; import { DocumentBlameStateChangeEvent, DocumentDirtyIdleTriggerEvent, GitDocumentState -} from './trackers/gitDocumentTracker'; +} from '../trackers/gitDocumentTracker'; import { GitCodeLensProvider } from './gitCodeLensProvider'; -import { Logger } from './logger'; export class CodeLensController extends Disposable { private _canToggle: boolean = false; diff --git a/src/gitCodeLensProvider.ts b/src/codelens/gitCodeLensProvider.ts similarity index 98% rename from src/gitCodeLensProvider.ts rename to src/codelens/gitCodeLensProvider.ts index 8419159..c3bbbb0 100644 --- a/src/gitCodeLensProvider.ts +++ b/src/codelens/gitCodeLensProvider.ts @@ -1,5 +1,4 @@ 'use strict'; -import { Functions, Iterables } from './system'; import { CancellationToken, CodeLens, @@ -24,19 +23,20 @@ import { ShowQuickCommitDetailsCommandArgs, ShowQuickCommitFileDetailsCommandArgs, ShowQuickFileHistoryCommandArgs -} from './commands'; +} from '../commands'; import { CodeLensCommand, CodeLensLanguageScope, CodeLensScopes, configuration, ICodeLensConfig -} from './configuration'; -import { BuiltInCommands, DocumentSchemes } from './constants'; -import { Container } from './container'; -import { DocumentTracker, GitDocumentState } from './trackers/gitDocumentTracker'; -import { GitBlame, GitBlameCommit, GitBlameLines, GitService, GitUri } from './gitService'; -import { Logger } from './logger'; +} from '../configuration'; +import { BuiltInCommands, DocumentSchemes } from '../constants'; +import { Container } from '../container'; +import { GitBlame, GitBlameCommit, GitBlameLines, GitService, GitUri } from '../gitService'; +import { Logger } from '../logger'; +import { Functions, Iterables } from '../system'; +import { DocumentTracker, GitDocumentState } from '../trackers/gitDocumentTracker'; export class GitRecentChangeCodeLens extends CodeLens { constructor( diff --git a/src/gitRevisionCodeLensProvider.ts b/src/codelens/gitRevisionCodeLensProvider.ts similarity index 94% rename from src/gitRevisionCodeLensProvider.ts rename to src/codelens/gitRevisionCodeLensProvider.ts index 7368158..c7a56ad 100644 --- a/src/gitRevisionCodeLensProvider.ts +++ b/src/codelens/gitRevisionCodeLensProvider.ts @@ -1,9 +1,9 @@ 'use strict'; import { CancellationToken, CodeLens, CodeLensProvider, DocumentSelector, Range, TextDocument, Uri } from 'vscode'; -import { Commands, DiffWithPreviousCommandArgs, DiffWithWorkingCommandArgs } from './commands'; -import { DocumentSchemes } from './constants'; -import { Container } from './container'; -import { GitCommit, GitUri } from './gitService'; +import { Commands, DiffWithPreviousCommandArgs, DiffWithWorkingCommandArgs } from '../commands'; +import { DocumentSchemes } from '../constants'; +import { Container } from '../container'; +import { GitCommit, GitUri } from '../gitService'; export class GitDiffWithWorkingCodeLens extends CodeLens { constructor( diff --git a/src/commands/clearFileAnnotations.ts b/src/commands/clearFileAnnotations.ts index 8448167..3d6f3e2 100644 --- a/src/commands/clearFileAnnotations.ts +++ b/src/commands/clearFileAnnotations.ts @@ -1,9 +1,9 @@ 'use strict'; import { TextEditor, TextEditorEdit, Uri, window } from 'vscode'; -import { Commands, EditorCommand } from './common'; import { UriComparer } from '../comparers'; import { Container } from '../container'; import { Logger } from '../logger'; +import { Commands, EditorCommand } from './common'; export class ClearFileAnnotationsCommand extends EditorCommand { constructor() { diff --git a/src/commands/closeUnchangedFiles.ts b/src/commands/closeUnchangedFiles.ts index 5d20827..7e6d9c4 100644 --- a/src/commands/closeUnchangedFiles.ts +++ b/src/commands/closeUnchangedFiles.ts @@ -1,11 +1,11 @@ 'use strict'; import { commands, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorTracker } from '../trackers/activeEditorTracker'; -import { ActiveEditorCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; import { TextEditorComparer, UriComparer } from '../comparers'; import { BuiltInCommands, GlyphChars } from '../constants'; import { Container } from '../container'; import { Logger } from '../logger'; +import { ActiveEditorTracker } from '../trackers/activeEditorTracker'; +import { ActiveEditorCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; export interface CloseUnchangedFilesCommandArgs { uris?: Uri[]; diff --git a/src/commands/common.ts b/src/commands/common.ts index ec5b069..9f87897 100644 --- a/src/commands/common.ts +++ b/src/commands/common.ts @@ -1,4 +1,5 @@ 'use strict'; +import * as path from 'path'; import { commands, Disposable, @@ -14,12 +15,11 @@ import { } from 'vscode'; import { BuiltInCommands, DocumentSchemes, ImageExtensions } from '../constants'; import { Container } from '../container'; -import { ExplorerNode, ExplorerRefNode } from '../views/explorerNodes'; import { GitBranch, GitCommit, GitRemote, GitUri } from '../gitService'; import { Logger } from '../logger'; +import { CommandQuickPickItem, RepositoriesQuickPick } from '../quickpicks'; // import { Telemetry } from '../telemetry'; -import * as path from 'path'; -import { CommandQuickPickItem, RepositoriesQuickPick } from '../quickPicks/quickPicks'; +import { ExplorerNode, ExplorerRefNode } from '../views/nodes'; export enum Commands { ClearFileAnnotations = 'gitlens.clearFileAnnotations', diff --git a/src/commands/copyMessageToClipboard.ts b/src/commands/copyMessageToClipboard.ts index 27653ca..f5fab11 100644 --- a/src/commands/copyMessageToClipboard.ts +++ b/src/commands/copyMessageToClipboard.ts @@ -1,10 +1,10 @@ 'use strict'; -import { Iterables } from '../system'; import { TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, isCommandViewContextWithCommit } from './common'; import { Container } from '../container'; import { GitUri } from '../gitService'; import { Logger } from '../logger'; +import { Iterables } from '../system'; +import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, isCommandViewContextWithCommit } from './common'; export interface CopyMessageToClipboardCommandArgs { message?: string; diff --git a/src/commands/copyShaToClipboard.ts b/src/commands/copyShaToClipboard.ts index d94a688..e0bd04a 100644 --- a/src/commands/copyShaToClipboard.ts +++ b/src/commands/copyShaToClipboard.ts @@ -1,10 +1,10 @@ 'use strict'; -import { Iterables } from '../system'; import { TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, isCommandViewContextWithCommit } from './common'; import { Container } from '../container'; import { GitUri } from '../gitService'; import { Logger } from '../logger'; +import { Iterables } from '../system'; +import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, isCommandViewContextWithCommit } from './common'; export interface CopyShaToClipboardCommandArgs { sha?: string; diff --git a/src/commands/diffBranchWithBranch.ts b/src/commands/diffBranchWithBranch.ts index 574131f..1f4783e 100644 --- a/src/commands/diffBranchWithBranch.ts +++ b/src/commands/diffBranchWithBranch.ts @@ -1,10 +1,10 @@ 'use strict'; import { CancellationTokenSource, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { Logger } from '../logger'; -import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickPicks/quickPicks'; +import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickpicks'; +import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; export interface DiffBranchWithBranchCommandArgs { ref1?: string; diff --git a/src/commands/diffDirectory.ts b/src/commands/diffDirectory.ts index e0747db..001aa24 100644 --- a/src/commands/diffDirectory.ts +++ b/src/commands/diffDirectory.ts @@ -1,12 +1,18 @@ 'use strict'; import { CancellationTokenSource, commands, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; -import { CommandContext, isCommandViewContextWithRef } from '../commands'; import { BuiltInCommands, GlyphChars } from '../constants'; import { Container } from '../container'; -import { ComparisonResultsNode } from '../views/explorerNodes'; import { Logger } from '../logger'; -import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickPicks/quickPicks'; +import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickpicks'; +import { ComparisonResultsNode } from '../views/nodes'; +import { + ActiveEditorCommand, + CommandContext, + Commands, + getCommandUri, + getRepoPathOrActiveOrPrompt, + isCommandViewContextWithRef +} from './common'; export interface DiffDirectoryCommandArgs { ref1?: string; diff --git a/src/commands/diffLineWithPrevious.ts b/src/commands/diffLineWithPrevious.ts index a057586..9402a94 100644 --- a/src/commands/diffLineWithPrevious.ts +++ b/src/commands/diffLineWithPrevious.ts @@ -1,11 +1,11 @@ 'use strict'; import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands, getCommandUri } from './common'; import { Container } from '../container'; -import { DiffWithCommandArgs } from './diffWith'; import { GitCommit, GitService, GitUri } from '../gitService'; import { Logger } from '../logger'; import { Messages } from '../messages'; +import { ActiveEditorCommand, Commands, getCommandUri } from './common'; +import { DiffWithCommandArgs } from './diffWith'; export interface DiffLineWithPreviousCommandArgs { commit?: GitCommit; diff --git a/src/commands/diffLineWithWorking.ts b/src/commands/diffLineWithWorking.ts index 8707bb2..87b2d9a 100644 --- a/src/commands/diffLineWithWorking.ts +++ b/src/commands/diffLineWithWorking.ts @@ -1,11 +1,11 @@ 'use strict'; import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands, getCommandUri } from './common'; import { Container } from '../container'; -import { DiffWithCommandArgs } from './diffWith'; import { GitCommit, GitService, GitUri } from '../gitService'; -import { Messages } from '../messages'; import { Logger } from '../logger'; +import { Messages } from '../messages'; +import { ActiveEditorCommand, Commands, getCommandUri } from './common'; +import { DiffWithCommandArgs } from './diffWith'; export interface DiffLineWithWorkingCommandArgs { commit?: GitCommit; diff --git a/src/commands/diffWith.ts b/src/commands/diffWith.ts index 1824d03..0067049 100644 --- a/src/commands/diffWith.ts +++ b/src/commands/diffWith.ts @@ -1,11 +1,11 @@ 'use strict'; +import * as path from 'path'; import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, ViewColumn, window } from 'vscode'; -import { ActiveEditorCommand, Commands } from './common'; import { BuiltInCommands, GlyphChars } from '../constants'; import { Container } from '../container'; import { GitCommit, GitService, GitUri } from '../gitService'; import { Logger } from '../logger'; -import * as path from 'path'; +import { ActiveEditorCommand, Commands } from './common'; export interface DiffWithCommandArgsRevision { sha: string; diff --git a/src/commands/diffWithBranch.ts b/src/commands/diffWithBranch.ts index bcaa07a..25b3b02 100644 --- a/src/commands/diffWithBranch.ts +++ b/src/commands/diffWithBranch.ts @@ -1,14 +1,14 @@ 'use strict'; -import { Strings } from '../system'; +import * as path from 'path'; import { commands, TextDocumentShowOptions, TextEditor, Uri } from 'vscode'; -import { ActiveEditorCommand, Commands, getCommandUri } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; -import { DiffWithCommandArgs } from './diffWith'; import { GitUri } from '../gitService'; import { Messages } from '../messages'; -import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickPicks/quickPicks'; -import * as path from 'path'; +import { BranchesAndTagsQuickPick, CommandQuickPickItem } from '../quickpicks'; +import { Strings } from '../system'; +import { ActiveEditorCommand, Commands, getCommandUri } from './common'; +import { DiffWithCommandArgs } from './diffWith'; export interface DiffWithBranchCommandArgs { line?: number; diff --git a/src/commands/diffWithNext.ts b/src/commands/diffWithNext.ts index 957e83d..d24b0f9 100644 --- a/src/commands/diffWithNext.ts +++ b/src/commands/diffWithNext.ts @@ -1,12 +1,12 @@ 'use strict'; -import { Iterables } from '../system'; import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands, getCommandUri } from './common'; import { Container } from '../container'; -import { DiffWithCommandArgs } from './diffWith'; import { GitLogCommit, GitService, GitStatusFile, GitUri } from '../gitService'; import { Logger } from '../logger'; import { Messages } from '../messages'; +import { Iterables } from '../system'; +import { ActiveEditorCommand, Commands, getCommandUri } from './common'; +import { DiffWithCommandArgs } from './diffWith'; export interface DiffWithNextCommandArgs { commit?: GitLogCommit; diff --git a/src/commands/diffWithPrevious.ts b/src/commands/diffWithPrevious.ts index bc113eb..c3d4de4 100644 --- a/src/commands/diffWithPrevious.ts +++ b/src/commands/diffWithPrevious.ts @@ -1,13 +1,13 @@ 'use strict'; -import { Iterables } from '../system'; import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, CommandContext, Commands, getCommandUri } from './common'; import { Container } from '../container'; -import { DiffWithCommandArgs } from './diffWith'; -import { DiffWithWorkingCommandArgs } from './diffWithWorking'; import { GitCommit, GitService, GitUri } from '../gitService'; import { Logger } from '../logger'; import { Messages } from '../messages'; +import { Iterables } from '../system'; +import { ActiveEditorCommand, CommandContext, Commands, getCommandUri } from './common'; +import { DiffWithCommandArgs } from './diffWith'; +import { DiffWithWorkingCommandArgs } from './diffWithWorking'; export interface DiffWithPreviousCommandArgs { commit?: GitCommit; diff --git a/src/commands/diffWithRevision.ts b/src/commands/diffWithRevision.ts index cfc6954..504c95b 100644 --- a/src/commands/diffWithRevision.ts +++ b/src/commands/diffWithRevision.ts @@ -1,14 +1,14 @@ 'use strict'; -import { Iterables, Strings } from '../system'; import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands, getCommandUri } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; -import { DiffWithCommandArgs } from './diffWith'; import { GitBranch, GitTag, GitUri } from '../gitService'; import { Logger } from '../logger'; import { Messages } from '../messages'; -import { CommandQuickPickItem, FileHistoryQuickPick, ShowBranchesAndTagsQuickPickItem } from '../quickPicks/quickPicks'; +import { ChooseFromBranchesAndTagsQuickPickItem, CommandQuickPickItem, FileHistoryQuickPick } from '../quickpicks'; +import { Iterables, Strings } from '../system'; +import { ActiveEditorCommand, Commands, getCommandUri } from './common'; +import { DiffWithCommandArgs } from './diffWith'; export interface DiffWithRevisionCommandArgs { branchOrTag?: GitBranch | GitTag; @@ -122,7 +122,7 @@ export class DiffWithRevisionCommand extends ActiveEditorCommand { let ref: string; - if (pick instanceof ShowBranchesAndTagsQuickPickItem) { + if (pick instanceof ChooseFromBranchesAndTagsQuickPickItem) { const branchOrTag = await pick.execute(); if (branchOrTag === undefined) return undefined; if (branchOrTag instanceof CommandQuickPickItem) return branchOrTag.execute(); diff --git a/src/commands/diffWithWorking.ts b/src/commands/diffWithWorking.ts index 91d8d07..e411c39 100644 --- a/src/commands/diffWithWorking.ts +++ b/src/commands/diffWithWorking.ts @@ -1,11 +1,11 @@ 'use strict'; import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands, getCommandUri } from './common'; import { Container } from '../container'; -import { DiffWithCommandArgs } from './diffWith'; import { GitCommit, GitService, GitUri } from '../gitService'; import { Logger } from '../logger'; import { Messages } from '../messages'; +import { ActiveEditorCommand, Commands, getCommandUri } from './common'; +import { DiffWithCommandArgs } from './diffWith'; export interface DiffWithWorkingCommandArgs { commit?: GitCommit; diff --git a/src/commands/externalDiff.ts b/src/commands/externalDiff.ts index 20350af..e8c17f9 100644 --- a/src/commands/externalDiff.ts +++ b/src/commands/externalDiff.ts @@ -1,11 +1,10 @@ 'use strict'; -import { Arrays } from '../system'; import { commands, SourceControlResourceState, Uri, window } from 'vscode'; -import { Command, Commands, getRepoPathOrActiveOrPrompt } from './common'; import { BuiltInCommands, GlyphChars } from '../constants'; -import { CommandContext } from '../commands'; import { Container } from '../container'; import { Logger } from '../logger'; +import { Arrays } from '../system'; +import { Command, CommandContext, Commands, getRepoPathOrActiveOrPrompt } from './common'; enum Status { INDEX_MODIFIED, diff --git a/src/commands/openBranchInRemote.ts b/src/commands/openBranchInRemote.ts index c0bec83..980bcbb 100644 --- a/src/commands/openBranchInRemote.ts +++ b/src/commands/openBranchInRemote.ts @@ -1,5 +1,10 @@ 'use strict'; import { commands, TextEditor, Uri, window } from 'vscode'; +import { GlyphChars } from '../constants'; +import { Container } from '../container'; +import { GitUri } from '../gitService'; +import { Logger } from '../logger'; +import { BranchesQuickPick, CommandQuickPickItem } from '../quickpicks'; import { ActiveEditorCommand, CommandContext, @@ -8,11 +13,6 @@ import { getRepoPathOrActiveOrPrompt, isCommandViewContextWithBranch } from './common'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; -import { GitUri } from '../gitService'; -import { Logger } from '../logger'; -import { BranchesQuickPick, CommandQuickPickItem } from '../quickPicks/quickPicks'; import { OpenInRemoteCommandArgs } from './openInRemote'; export interface OpenBranchInRemoteCommandArgs { diff --git a/src/commands/openBranchesInRemote.ts b/src/commands/openBranchesInRemote.ts index 128636f..cc05402 100644 --- a/src/commands/openBranchesInRemote.ts +++ b/src/commands/openBranchesInRemote.ts @@ -1,5 +1,9 @@ 'use strict'; import { commands, TextEditor, Uri, window } from 'vscode'; +import { GlyphChars } from '../constants'; +import { Container } from '../container'; +import { GitUri } from '../gitService'; +import { Logger } from '../logger'; import { ActiveEditorCommand, CommandContext, @@ -8,10 +12,6 @@ import { getRepoPathOrActiveOrPrompt, isCommandViewContextWithRemote } from './common'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; -import { GitUri } from '../gitService'; -import { Logger } from '../logger'; import { OpenInRemoteCommandArgs } from './openInRemote'; export interface OpenBranchesInRemoteCommandArgs { diff --git a/src/commands/openChangedFiles.ts b/src/commands/openChangedFiles.ts index 030e38b..534ac91 100644 --- a/src/commands/openChangedFiles.ts +++ b/src/commands/openChangedFiles.ts @@ -1,10 +1,10 @@ 'use strict'; -import { Arrays } from '../system'; import { TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt, openEditor } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { Logger } from '../logger'; +import { Arrays } from '../system'; +import { ActiveEditorCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt, openEditor } from './common'; export interface OpenChangedFilesCommandArgs { uris?: Uri[]; diff --git a/src/commands/openCommitInRemote.ts b/src/commands/openCommitInRemote.ts index 0eab9dc..e4d854a 100644 --- a/src/commands/openCommitInRemote.ts +++ b/src/commands/openCommitInRemote.ts @@ -1,10 +1,10 @@ 'use strict'; import { commands, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, isCommandViewContextWithCommit } from './common'; import { Container } from '../container'; import { GitUri } from '../gitService'; import { Logger } from '../logger'; import { Messages } from '../messages'; +import { ActiveEditorCommand, CommandContext, Commands, getCommandUri, isCommandViewContextWithCommit } from './common'; import { OpenInRemoteCommandArgs } from './openInRemote'; export interface OpenCommitInRemoteCommandArgs { diff --git a/src/commands/openFileInRemote.ts b/src/commands/openFileInRemote.ts index 1bf9994..9fa0b70 100644 --- a/src/commands/openFileInRemote.ts +++ b/src/commands/openFileInRemote.ts @@ -1,5 +1,10 @@ 'use strict'; import { commands, Range, TextEditor, Uri, window } from 'vscode'; +import { GlyphChars } from '../constants'; +import { Container } from '../container'; +import { GitUri } from '../gitService'; +import { Logger } from '../logger'; +import { BranchesQuickPick, CommandQuickPickItem } from '../quickpicks'; import { ActiveEditorCommand, CommandContext, @@ -8,12 +13,7 @@ import { isCommandViewContextWithBranch, isCommandViewContextWithCommit } from './common'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; -import { GitUri } from '../gitService'; -import { Logger } from '../logger'; import { OpenInRemoteCommandArgs } from './openInRemote'; -import { BranchesQuickPick, CommandQuickPickItem } from '../quickPicks/quickPicks'; export interface OpenFileInRemoteCommandArgs { branch?: string; diff --git a/src/commands/openFileRevision.ts b/src/commands/openFileRevision.ts index 52575d9..89495d8 100644 --- a/src/commands/openFileRevision.ts +++ b/src/commands/openFileRevision.ts @@ -1,14 +1,14 @@ 'use strict'; -import { Iterables, Strings } from '../system'; import { CancellationTokenSource, commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands, getCommandUri, openEditor } from './common'; import { FileAnnotationType } from '../configuration'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { GitBranch, GitTag, GitUri } from '../gitService'; import { Logger } from '../logger'; import { Messages } from '../messages'; -import { CommandQuickPickItem, FileHistoryQuickPick, ShowBranchesAndTagsQuickPickItem } from '../quickPicks/quickPicks'; +import { ChooseFromBranchesAndTagsQuickPickItem, CommandQuickPickItem, FileHistoryQuickPick } from '../quickpicks'; +import { Iterables, Strings } from '../system'; +import { ActiveEditorCommand, Commands, getCommandUri, openEditor } from './common'; export interface OpenFileRevisionCommandArgs { branchOrTag?: GitBranch | GitTag; @@ -150,7 +150,7 @@ export class OpenFileRevisionCommand extends ActiveEditorCommand { }); if (pick === undefined) return undefined; - if (pick instanceof ShowBranchesAndTagsQuickPickItem) { + if (pick instanceof ChooseFromBranchesAndTagsQuickPickItem) { const branchOrTag = await pick.execute(); if (branchOrTag === undefined) return undefined; if (branchOrTag instanceof CommandQuickPickItem) return branchOrTag.execute(); diff --git a/src/commands/openInRemote.ts b/src/commands/openInRemote.ts index 7afba48..4a186be 100644 --- a/src/commands/openInRemote.ts +++ b/src/commands/openInRemote.ts @@ -1,11 +1,11 @@ 'use strict'; -import { Strings } from '../system'; import { TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands } from './common'; import { GlyphChars } from '../constants'; import { GitLogCommit, GitRemote, GitService, RemoteResource, RemoteResourceType } from '../gitService'; import { Logger } from '../logger'; -import { CommandQuickPickItem, OpenRemoteCommandQuickPickItem, RemotesQuickPick } from '../quickPicks/quickPicks'; +import { CommandQuickPickItem, OpenRemoteCommandQuickPickItem, RemotesQuickPick } from '../quickpicks'; +import { Strings } from '../system'; +import { ActiveEditorCommand, Commands } from './common'; export interface OpenInRemoteCommandArgs { remote?: string; diff --git a/src/commands/openRepoInRemote.ts b/src/commands/openRepoInRemote.ts index 5da5227..97ae6cf 100644 --- a/src/commands/openRepoInRemote.ts +++ b/src/commands/openRepoInRemote.ts @@ -1,5 +1,9 @@ 'use strict'; import { commands, TextEditor, Uri, window } from 'vscode'; +import { GlyphChars } from '../constants'; +import { Container } from '../container'; +import { GitUri } from '../gitService'; +import { Logger } from '../logger'; import { ActiveEditorCommand, CommandContext, @@ -8,10 +12,6 @@ import { getRepoPathOrActiveOrPrompt, isCommandViewContextWithRemote } from './common'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; -import { GitUri } from '../gitService'; -import { Logger } from '../logger'; import { OpenInRemoteCommandArgs } from './openInRemote'; export interface OpenRepoInRemoteCommandArgs { diff --git a/src/commands/openWorkingFile.ts b/src/commands/openWorkingFile.ts index 971d743..bae37fa 100644 --- a/src/commands/openWorkingFile.ts +++ b/src/commands/openWorkingFile.ts @@ -1,11 +1,11 @@ 'use strict'; +import * as path from 'path'; import { Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands, getCommandUri, openEditor } from './common'; import { FileAnnotationType } from '../configuration'; import { Container } from '../container'; import { GitUri } from '../gitService'; import { Logger } from '../logger'; -import * as path from 'path'; +import { ActiveEditorCommand, Commands, getCommandUri, openEditor } from './common'; export interface OpenWorkingFileCommandArgs { uri?: Uri; diff --git a/src/commands/resetSuppressedWarnings.ts b/src/commands/resetSuppressedWarnings.ts index ba5297c..29372f3 100644 --- a/src/commands/resetSuppressedWarnings.ts +++ b/src/commands/resetSuppressedWarnings.ts @@ -1,7 +1,7 @@ 'use strict'; import { ConfigurationTarget } from 'vscode'; -import { Command, Commands } from './common'; import { configuration } from '../configuration'; +import { Command, Commands } from './common'; export class ResetSuppressedWarningsCommand extends Command { constructor() { diff --git a/src/commands/showCommitSearch.ts b/src/commands/showCommitSearch.ts index 1cd5a58..ff115e3 100644 --- a/src/commands/showCommitSearch.ts +++ b/src/commands/showCommitSearch.ts @@ -1,16 +1,12 @@ 'use strict'; -import { Strings } from '../system'; import { commands, InputBoxOptions, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCachedCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { GitRepoSearchBy, GitService, GitUri } from '../gitService'; import { Logger } from '../logger'; -import { - CommandQuickPickItem, - CommitsQuickPick, - ShowCommitsSearchInResultsQuickPickItem -} from '../quickPicks/quickPicks'; +import { CommandQuickPickItem, CommitsQuickPick, ShowCommitsSearchInResultsQuickPickItem } from '../quickpicks'; +import { Strings } from '../system'; +import { ActiveEditorCachedCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails'; const searchByRegex = /^([@~=:#])/; diff --git a/src/commands/showGitExplorer.ts b/src/commands/showGitExplorer.ts index 357ec2c..6170f11 100644 --- a/src/commands/showGitExplorer.ts +++ b/src/commands/showGitExplorer.ts @@ -1,7 +1,7 @@ 'use strict'; -import { Command, Commands } from './common'; import { GitExplorerView } from '../configuration'; import { Container } from '../container'; +import { Command, Commands } from './common'; export class ShowGitExplorerCommand extends Command { constructor() { diff --git a/src/commands/showHistoryExplorer.ts b/src/commands/showHistoryExplorer.ts index af3c279..c9a037c 100644 --- a/src/commands/showHistoryExplorer.ts +++ b/src/commands/showHistoryExplorer.ts @@ -1,7 +1,7 @@ 'use strict'; -import { Command, Commands } from './common'; import { GitExplorerView } from '../configuration'; import { Container } from '../container'; +import { Command, Commands } from './common'; export class ShowHistoryExplorerCommand extends Command { constructor() { diff --git a/src/commands/showLastQuickPick.ts b/src/commands/showLastQuickPick.ts index 1813b74..77c1b61 100644 --- a/src/commands/showLastQuickPick.ts +++ b/src/commands/showLastQuickPick.ts @@ -1,7 +1,7 @@ 'use strict'; import { commands, window } from 'vscode'; -import { Command, Commands, getLastCommand } from './common'; import { Logger } from '../logger'; +import { Command, Commands, getLastCommand } from './common'; export class ShowLastQuickPickCommand extends Command { constructor() { diff --git a/src/commands/showQuickBranchHistory.ts b/src/commands/showQuickBranchHistory.ts index 30bfa29..2998ba3 100644 --- a/src/commands/showQuickBranchHistory.ts +++ b/src/commands/showQuickBranchHistory.ts @@ -1,12 +1,12 @@ 'use strict'; -import { Strings } from '../system'; import { commands, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCachedCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { GitLog, GitUri } from '../gitService'; import { Logger } from '../logger'; -import { BranchesQuickPick, BranchHistoryQuickPick, CommandQuickPickItem } from '../quickPicks/quickPicks'; +import { BranchesQuickPick, BranchHistoryQuickPick, CommandQuickPickItem } from '../quickpicks'; +import { Strings } from '../system'; +import { ActiveEditorCachedCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails'; export interface ShowQuickBranchHistoryCommandArgs { diff --git a/src/commands/showQuickCommitDetails.ts b/src/commands/showQuickCommitDetails.ts index 30f9db4..e7e763e 100644 --- a/src/commands/showQuickCommitDetails.ts +++ b/src/commands/showQuickCommitDetails.ts @@ -1,6 +1,13 @@ 'use strict'; -import { Strings } from '../system'; +import * as path from 'path'; import { commands, TextEditor, Uri, window } from 'vscode'; +import { GlyphChars } from '../constants'; +import { Container } from '../container'; +import { GitCommit, GitLog, GitLogCommit, GitUri } from '../gitService'; +import { Logger } from '../logger'; +import { Messages } from '../messages'; +import { CommandQuickPickItem, CommitQuickPick, CommitWithFileStatusQuickPickItem } from '../quickpicks'; +import { Strings } from '../system'; import { ActiveEditorCachedCommand, CommandContext, @@ -8,14 +15,7 @@ import { getCommandUri, isCommandViewContextWithCommit } from './common'; -import { GlyphChars } from '../constants'; -import { GitCommit, GitLog, GitLogCommit, GitUri } from '../gitService'; -import { Logger } from '../logger'; -import { CommandQuickPickItem, CommitQuickPick, CommitWithFileStatusQuickPickItem } from '../quickPicks/quickPicks'; import { ShowQuickCommitFileDetailsCommandArgs } from './showQuickCommitFileDetails'; -import { Messages } from '../messages'; -import * as path from 'path'; -import { Container } from '../container'; export interface ShowQuickCommitDetailsCommandArgs { sha?: string; diff --git a/src/commands/showQuickCommitFileDetails.ts b/src/commands/showQuickCommitFileDetails.ts index ce0745a..55e5c4c 100644 --- a/src/commands/showQuickCommitFileDetails.ts +++ b/src/commands/showQuickCommitFileDetails.ts @@ -1,6 +1,13 @@ 'use strict'; -import { Strings } from '../system'; +import * as path from 'path'; import { TextEditor, Uri, window } from 'vscode'; +import { GlyphChars } from '../constants'; +import { Container } from '../container'; +import { GitCommit, GitLog, GitLogCommit, GitService, GitUri } from '../gitService'; +import { Logger } from '../logger'; +import { Messages } from '../messages'; +import { CommandQuickPickItem, CommitFileQuickPick } from '../quickpicks'; +import { Strings } from '../system'; import { ActiveEditorCachedCommand, CommandContext, @@ -8,14 +15,7 @@ import { getCommandUri, isCommandViewContextWithCommit } from './common'; -import { GlyphChars } from '../constants'; -import { GitCommit, GitLog, GitLogCommit, GitService, GitUri } from '../gitService'; -import { Logger } from '../logger'; -import { CommandQuickPickItem, CommitFileQuickPick } from '../quickPicks/quickPicks'; import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails'; -import { Messages } from '../messages'; -import * as path from 'path'; -import { Container } from '../container'; export interface ShowQuickCommitFileDetailsCommandArgs { sha?: string; diff --git a/src/commands/showQuickCurrentBranchHistory.ts b/src/commands/showQuickCurrentBranchHistory.ts index 411da5a..16babfa 100644 --- a/src/commands/showQuickCurrentBranchHistory.ts +++ b/src/commands/showQuickCurrentBranchHistory.ts @@ -1,10 +1,10 @@ 'use strict'; import { commands, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCachedCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { Logger } from '../logger'; -import { CommandQuickPickItem } from '../quickPicks/quickPicks'; +import { CommandQuickPickItem } from '../quickpicks'; +import { ActiveEditorCachedCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; import { ShowQuickBranchHistoryCommandArgs } from './showQuickBranchHistory'; export interface ShowQuickCurrentBranchHistoryCommandArgs { diff --git a/src/commands/showQuickFileHistory.ts b/src/commands/showQuickFileHistory.ts index 7f66c42..f91c84b 100644 --- a/src/commands/showQuickFileHistory.ts +++ b/src/commands/showQuickFileHistory.ts @@ -1,20 +1,20 @@ 'use strict'; +import * as path from 'path'; import { commands, Range, TextEditor, Uri, window } from 'vscode'; -import { Iterables, Strings } from '../system'; -import { ActiveEditorCachedCommand, Commands, getCommandUri } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { GitBranch, GitLog, GitTag, GitUri } from '../gitService'; import { Logger } from '../logger'; +import { Messages } from '../messages'; import { + ChooseFromBranchesAndTagsQuickPickItem, CommandQuickPickItem, FileHistoryQuickPick, - ShowBranchesAndTagsQuickPickItem, ShowCommitsInResultsQuickPickItem -} from '../quickPicks/quickPicks'; +} from '../quickpicks'; +import { Iterables, Strings } from '../system'; +import { ActiveEditorCachedCommand, Commands, getCommandUri } from './common'; import { ShowQuickCommitFileDetailsCommandArgs } from './showQuickCommitFileDetails'; -import { Messages } from '../messages'; -import * as path from 'path'; export interface ShowQuickFileHistoryCommandArgs { branchOrTag?: GitBranch | GitTag; @@ -138,7 +138,7 @@ export class ShowQuickFileHistoryCommand extends ActiveEditorCachedCommand { }); if (pick === undefined) return undefined; - if (pick instanceof ShowBranchesAndTagsQuickPickItem) { + if (pick instanceof ChooseFromBranchesAndTagsQuickPickItem) { const branchOrTag = await pick.execute(); if (branchOrTag === undefined) return undefined; if (branchOrTag instanceof CommandQuickPickItem) return branchOrTag.execute(); diff --git a/src/commands/showQuickRepoStatus.ts b/src/commands/showQuickRepoStatus.ts index 6fbdf01..dba8d47 100644 --- a/src/commands/showQuickRepoStatus.ts +++ b/src/commands/showQuickRepoStatus.ts @@ -1,10 +1,10 @@ 'use strict'; import { TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCachedCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { Logger } from '../logger'; -import { CommandQuickPickItem, RepoStatusQuickPick } from '../quickPicks/quickPicks'; +import { CommandQuickPickItem, RepoStatusQuickPick } from '../quickpicks'; +import { ActiveEditorCachedCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; export interface ShowQuickRepoStatusCommandArgs { goBackCommand?: CommandQuickPickItem; diff --git a/src/commands/showQuickStashList.ts b/src/commands/showQuickStashList.ts index c31949c..376a8cb 100644 --- a/src/commands/showQuickStashList.ts +++ b/src/commands/showQuickStashList.ts @@ -1,11 +1,11 @@ 'use strict'; -import { Strings } from '../system'; import { commands, TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCachedCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { Logger } from '../logger'; -import { CommandQuickPickItem, StashListQuickPick } from '../quickPicks/quickPicks'; +import { CommandQuickPickItem, StashListQuickPick } from '../quickpicks'; +import { Strings } from '../system'; +import { ActiveEditorCachedCommand, Commands, getCommandUri, getRepoPathOrActiveOrPrompt } from './common'; import { ShowQuickCommitDetailsCommandArgs } from './showQuickCommitDetails'; export interface ShowQuickStashListCommandArgs { diff --git a/src/commands/showResultsExplorer.ts b/src/commands/showResultsExplorer.ts index 414ceee..0914624 100644 --- a/src/commands/showResultsExplorer.ts +++ b/src/commands/showResultsExplorer.ts @@ -1,6 +1,6 @@ 'use strict'; -import { Command, Commands } from './common'; import { Container } from '../container'; +import { Command, Commands } from './common'; export class ShowResultsExplorerCommand extends Command { constructor() { diff --git a/src/commands/stashApply.ts b/src/commands/stashApply.ts index a922d8e..13d788e 100644 --- a/src/commands/stashApply.ts +++ b/src/commands/stashApply.ts @@ -1,12 +1,12 @@ 'use strict'; -import { Strings } from '../system'; import { MessageItem, window } from 'vscode'; -import { Command, CommandContext, Commands, isCommandViewContextWithCommit } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { GitStashCommit } from '../gitService'; import { Logger } from '../logger'; -import { CommandQuickPickItem, RepositoriesQuickPick, StashListQuickPick } from '../quickPicks/quickPicks'; +import { CommandQuickPickItem, RepositoriesQuickPick, StashListQuickPick } from '../quickpicks'; +import { Strings } from '../system'; +import { Command, CommandContext, Commands, isCommandViewContextWithCommit } from './common'; export interface StashApplyCommandArgs { confirm?: boolean; diff --git a/src/commands/stashDelete.ts b/src/commands/stashDelete.ts index 4953d1f..9c94fec 100644 --- a/src/commands/stashDelete.ts +++ b/src/commands/stashDelete.ts @@ -1,11 +1,11 @@ 'use strict'; import { MessageItem, window } from 'vscode'; -import { Command, CommandContext, Commands, isCommandViewContextWithCommit } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { GitStashCommit } from '../gitService'; import { Logger } from '../logger'; -import { CommandQuickPickItem } from '../quickPicks/quickPicks'; +import { CommandQuickPickItem } from '../quickpicks'; +import { Command, CommandContext, Commands, isCommandViewContextWithCommit } from './common'; export interface StashDeleteCommandArgs { confirm?: boolean; diff --git a/src/commands/stashSave.ts b/src/commands/stashSave.ts index 5bb26b2..54696fb 100644 --- a/src/commands/stashSave.ts +++ b/src/commands/stashSave.ts @@ -1,11 +1,10 @@ 'use strict'; import { InputBoxOptions, Uri, window } from 'vscode'; -import { CommandContext } from '../commands'; -import { Command, Commands } from './common'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { Logger } from '../logger'; -import { CommandQuickPickItem, RepositoriesQuickPick } from '../quickPicks/quickPicks'; +import { CommandQuickPickItem, RepositoriesQuickPick } from '../quickpicks'; +import { Command, CommandContext, Commands } from './common'; export interface StashSaveCommandArgs { message?: string; diff --git a/src/commands/switchMode.ts b/src/commands/switchMode.ts index 5aac20e..c96cad8 100644 --- a/src/commands/switchMode.ts +++ b/src/commands/switchMode.ts @@ -1,9 +1,9 @@ 'use strict'; import { ConfigurationTarget } from 'vscode'; -import { Command, Commands } from './common'; import { configuration } from '../configuration'; import { Container } from '../container'; -import { ModesQuickPick } from '../quickPicks/quickPicks'; +import { ModesQuickPick } from '../quickpicks'; +import { Command, Commands } from './common'; export class SwitchModeCommand extends Command { constructor() { diff --git a/src/commands/toggleCodeLens.ts b/src/commands/toggleCodeLens.ts index 4ea916a..075153d 100644 --- a/src/commands/toggleCodeLens.ts +++ b/src/commands/toggleCodeLens.ts @@ -1,6 +1,6 @@ 'use strict'; -import { Command, Commands } from './common'; import { Container } from '../container'; +import { Command, Commands } from './common'; export class ToggleCodeLensCommand extends Command { constructor() { diff --git a/src/commands/toggleFileBlame.ts b/src/commands/toggleFileBlame.ts index 60c9215..1d37615 100644 --- a/src/commands/toggleFileBlame.ts +++ b/src/commands/toggleFileBlame.ts @@ -1,10 +1,10 @@ 'use strict'; import { TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands } from './common'; import { UriComparer } from '../comparers'; import { FileAnnotationType } from '../configuration'; import { Container } from '../container'; import { Logger } from '../logger'; +import { ActiveEditorCommand, Commands } from './common'; export interface ToggleFileBlameCommandArgs { sha?: string; diff --git a/src/commands/toggleFileHeatmap.ts b/src/commands/toggleFileHeatmap.ts index 5900ace..e58bad8 100644 --- a/src/commands/toggleFileHeatmap.ts +++ b/src/commands/toggleFileHeatmap.ts @@ -1,8 +1,8 @@ 'use strict'; import { commands, TextEditor, Uri } from 'vscode'; -import { ToggleFileBlameCommandArgs } from '../commands'; -import { ActiveEditorCommand, Commands } from './common'; import { FileAnnotationType } from '../configuration'; +import { ActiveEditorCommand, Commands } from './common'; +import { ToggleFileBlameCommandArgs } from './toggleFileBlame'; export class ToggleFileHeatmapCommand extends ActiveEditorCommand { constructor() { diff --git a/src/commands/toggleFileRecentChanges.ts b/src/commands/toggleFileRecentChanges.ts index 4d70df0..c466811 100644 --- a/src/commands/toggleFileRecentChanges.ts +++ b/src/commands/toggleFileRecentChanges.ts @@ -1,8 +1,8 @@ 'use strict'; import { commands, TextEditor, Uri } from 'vscode'; -import { ToggleFileBlameCommandArgs } from '../commands'; -import { ActiveEditorCommand, Commands } from './common'; import { FileAnnotationType } from '../configuration'; +import { ActiveEditorCommand, Commands } from './common'; +import { ToggleFileBlameCommandArgs } from './toggleFileBlame'; export class ToggleFileRecentChangesCommand extends ActiveEditorCommand { constructor() { diff --git a/src/commands/toggleLineBlame.ts b/src/commands/toggleLineBlame.ts index d1cc49f..cedf3d0 100644 --- a/src/commands/toggleLineBlame.ts +++ b/src/commands/toggleLineBlame.ts @@ -1,8 +1,8 @@ 'use strict'; import { TextEditor, Uri, window } from 'vscode'; -import { ActiveEditorCommand, Commands } from './common'; import { Container } from '../container'; import { Logger } from '../logger'; +import { ActiveEditorCommand, Commands } from './common'; export class ToggleLineBlameCommand extends ActiveEditorCommand { constructor() { diff --git a/src/configuration.ts b/src/configuration.ts index 0fddb81..417e561 100644 --- a/src/configuration.ts +++ b/src/configuration.ts @@ -1,7 +1,6 @@ 'use strict'; export * from './ui/config'; -import { Functions } from './system'; import { ConfigurationChangeEvent, ConfigurationTarget, @@ -11,10 +10,11 @@ import { Uri, workspace } from 'vscode'; -import { IConfig, KeyMap } from './ui/config'; import { CommandContext, extensionId, setCommandContext } from './constants'; import { Container } from './container'; import { clearGravatarCache } from './gitService'; +import { Functions } from './system'; +import { IConfig, KeyMap } from './ui/config'; const emptyConfig: any = new Proxy({} as IConfig, { get(target, propKey, receiver) { diff --git a/src/container.ts b/src/container.ts index e4914a1..65d470d 100644 --- a/src/container.ts +++ b/src/container.ts @@ -1,22 +1,22 @@ 'use strict'; import { Disposable, ExtensionContext, languages, workspace } from 'vscode'; import { FileAnnotationController } from './annotations/fileAnnotationController'; -import { CodeLensController } from './codeLensController'; -import { configuration, IConfig } from './configuration'; import { LineAnnotationController } from './annotations/lineAnnotationController'; -import { LineHoverController } from './annotations/lineHoverController'; -import { ExplorerCommands } from './views/explorerCommands'; +import { CodeLensController } from './codelens/codeLensController'; +import { GitRevisionCodeLensProvider } from './codelens/gitRevisionCodeLensProvider'; +import { configuration, IConfig } from './configuration'; import { GitContentProvider } from './gitContentProvider'; +import { GitService } from './gitService'; +import { LineHoverController } from './hovers/lineHoverController'; +import { Keyboard } from './keyboard'; +import { StatusBarController } from './statusbar/statusBarController'; import { GitDocumentTracker } from './trackers/gitDocumentTracker'; -import { GitExplorer } from './views/gitExplorer'; import { GitLineTracker } from './trackers/gitLineTracker'; -import { GitRevisionCodeLensProvider } from './gitRevisionCodeLensProvider'; -import { GitService } from './gitService'; +import { ExplorerCommands } from './views/explorerCommands'; +import { GitExplorer } from './views/gitExplorer'; import { HistoryExplorer } from './views/historyExplorer'; -import { Keyboard } from './keyboard'; import { ResultsExplorer } from './views/resultsExplorer'; import { SettingsEditor } from './webviews/settingsEditor'; -import { StatusBarController } from './statusBarController'; import { WelcomeEditor } from './webviews/welcomeEditor'; export class Container { diff --git a/src/extension.ts b/src/extension.ts index 6cfa45c..42a6dd4 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,8 +1,7 @@ 'use strict'; -import { Logger } from './logger'; -import { Versions } from './system'; import { commands, ExtensionContext, extensions, window, workspace } from 'vscode'; +import { Commands, configureCommands } from './commands'; import { CodeLensLanguageScope, CodeLensScopes, @@ -15,10 +14,11 @@ import { OutputLevel } from './configuration'; import { CommandContext, extensionId, extensionQualifiedId, GlobalState, setCommandContext } from './constants'; -import { Commands, configureCommands } from './commands'; import { Container } from './container'; import { GitService } from './gitService'; +import { Logger } from './logger'; import { Messages } from './messages'; +import { Versions } from './system'; // import { Telemetry } from './telemetry'; interface GitApi { diff --git a/src/git/formatters/commitFormatter.ts b/src/git/formatters/commitFormatter.ts index f7bec9d..3703990 100644 --- a/src/git/formatters/commitFormatter.ts +++ b/src/git/formatters/commitFormatter.ts @@ -1,8 +1,8 @@ 'use strict'; -import { Strings } from '../../system'; -import { GitCommit } from '../models/commit'; import { DateStyle } from '../../configuration'; import { Container } from '../../container'; +import { Strings } from '../../system'; +import { GitCommit } from '../models/commit'; import { Formatter, IFormatOptions } from './formatter'; export interface ICommitFormatOptions extends IFormatOptions { diff --git a/src/git/formatters/statusFormatter.ts b/src/git/formatters/statusFormatter.ts index c78be82..87d466b 100644 --- a/src/git/formatters/statusFormatter.ts +++ b/src/git/formatters/statusFormatter.ts @@ -1,9 +1,9 @@ 'use strict'; -import { Strings } from '../../system'; +import * as path from 'path'; import { GlyphChars } from '../../constants'; -import { Formatter, IFormatOptions } from './formatter'; +import { Strings } from '../../system'; import { GitStatusFile, IGitStatusFile, IGitStatusFileWithCommit } from '../models/status'; -import * as path from 'path'; +import { Formatter, IFormatOptions } from './formatter'; export interface IStatusFormatOptions extends IFormatOptions { relativePath?: string; diff --git a/src/git/git.ts b/src/git/git.ts index 34c6091..c29e55c 100644 --- a/src/git/git.ts +++ b/src/git/git.ts @@ -1,11 +1,11 @@ 'use strict'; -import { Objects, Strings } from '../system'; -import { findGitPath, IGit } from './gitLocator'; -import { Logger } from '../logger'; -import { CommandOptions, runCommand } from './shell'; import * as fs from 'fs'; import * as iconv from 'iconv-lite'; import * as path from 'path'; +import { Logger } from '../logger'; +import { Objects, Strings } from '../system'; +import { findGitPath, IGit } from './gitLocator'; +import { CommandOptions, runCommand } from './shell'; export { IGit }; export * from './models/models'; diff --git a/src/git/gitLocator.ts b/src/git/gitLocator.ts index d2ec88e..8d9b8f6 100644 --- a/src/git/gitLocator.ts +++ b/src/git/gitLocator.ts @@ -1,7 +1,7 @@ 'use strict'; // import { findActualExecutable, spawnPromise } from 'spawn-rx'; -import { findExecutable, runCommand } from './shell'; import * as path from 'path'; +import { findExecutable, runCommand } from './shell'; export interface IGit { path: string; diff --git a/src/git/gitUri.ts b/src/git/gitUri.ts index c72e143..0607657 100644 --- a/src/git/gitUri.ts +++ b/src/git/gitUri.ts @@ -1,11 +1,11 @@ 'use strict'; -import { Strings } from '../system'; +import * as path from 'path'; import { Uri } from 'vscode'; import { UriComparer } from '../comparers'; import { DocumentSchemes, GlyphChars } from '../constants'; import { Container } from '../container'; import { GitCommit, GitService, IGitStatusFile } from '../gitService'; -import * as path from 'path'; +import { Strings } from '../system'; export interface IGitCommitInfo { fileName?: string; diff --git a/src/git/models/blame.ts b/src/git/models/blame.ts index 7a5820b..b0b40d2 100644 --- a/src/git/models/blame.ts +++ b/src/git/models/blame.ts @@ -1,6 +1,6 @@ 'use strict'; -import { GitAuthor, GitCommitLine } from './commit'; import { GitBlameCommit } from './blameCommit'; +import { GitAuthor, GitCommitLine } from './commit'; export interface GitBlame { readonly repoPath: string; diff --git a/src/git/models/commit.ts b/src/git/models/commit.ts index aef7ba6..eb3212f 100644 --- a/src/git/models/commit.ts +++ b/src/git/models/commit.ts @@ -1,12 +1,12 @@ 'use strict'; -import { Dates, Strings } from '../../system'; +import * as path from 'path'; import { Uri } from 'vscode'; import { configuration, DateStyle, GravatarDefaultStyle } from '../../configuration'; import { GlyphChars } from '../../constants'; import { Container } from '../../container'; +import { Dates, Strings } from '../../system'; import { Git } from '../git'; import { GitUri } from '../gitUri'; -import * as path from 'path'; const gravatarCache: Map = new Map(); export function clearGravatarCache() { diff --git a/src/git/models/logCommit.ts b/src/git/models/logCommit.ts index 132adf9..44f1006 100644 --- a/src/git/models/logCommit.ts +++ b/src/git/models/logCommit.ts @@ -1,10 +1,10 @@ 'use strict'; -import { Strings } from '../../system'; +import * as path from 'path'; import { Uri } from 'vscode'; -import { GitCommit, GitCommitType } from './commit'; +import { Strings } from '../../system'; import { Git } from '../git'; +import { GitCommit, GitCommitType } from './commit'; import { GitStatusFileStatus, IGitStatusFile } from './status'; -import * as path from 'path'; export class GitLogCommit extends GitCommit { nextSha?: string; diff --git a/src/git/models/repository.ts b/src/git/models/repository.ts index 3e36a62..5c9febc 100644 --- a/src/git/models/repository.ts +++ b/src/git/models/repository.ts @@ -1,5 +1,5 @@ 'use strict'; -import { Functions } from '../../system'; +import * as _path from 'path'; import { ConfigurationChangeEvent, Disposable, @@ -12,10 +12,10 @@ import { } from 'vscode'; import { configuration, IRemotesConfig } from '../../configuration'; import { Container } from '../../container'; -import { GitBranch, GitDiffShortStat, GitRemote, GitStash, GitStatus, GitTag } from '../git'; import { GitUri } from '../../gitService'; +import { Functions } from '../../system'; +import { GitBranch, GitDiffShortStat, GitRemote, GitStash, GitStatus, GitTag } from '../git'; import { RemoteProviderFactory, RemoteProviderMap } from '../remotes/factory'; -import * as _path from 'path'; export enum RepositoryChange { Config = 'config', diff --git a/src/git/models/status.ts b/src/git/models/status.ts index c79042f..dbd4172 100644 --- a/src/git/models/status.ts +++ b/src/git/models/status.ts @@ -1,10 +1,10 @@ 'use strict'; -import { Strings } from '../../system'; +import * as path from 'path'; import { Uri } from 'vscode'; import { GlyphChars } from '../../constants'; +import { Strings } from '../../system'; import { GitUri } from '../gitUri'; import { GitLogCommit } from './logCommit'; -import * as path from 'path'; export interface GitStatusUpstreamState { ahead: number; diff --git a/src/git/parsers/blameParser.ts b/src/git/parsers/blameParser.ts index be82760..248cb99 100644 --- a/src/git/parsers/blameParser.ts +++ b/src/git/parsers/blameParser.ts @@ -1,7 +1,7 @@ 'use strict'; +import * as path from 'path'; import { Strings } from '../../system'; import { Git, GitAuthor, GitBlame, GitBlameCommit, GitCommitLine } from './../git'; -import * as path from 'path'; interface BlameEntry { sha: string; diff --git a/src/git/parsers/logParser.ts b/src/git/parsers/logParser.ts index b26867c..732a5a1 100644 --- a/src/git/parsers/logParser.ts +++ b/src/git/parsers/logParser.ts @@ -1,9 +1,8 @@ 'use strict'; -import { Arrays, Strings } from '../../system'; +import * as path from 'path'; import { Range } from 'vscode'; +import { Arrays, Strings } from '../../system'; import { Git, GitAuthor, GitCommitType, GitLog, GitLogCommit, GitStatusFileStatus, IGitStatusFile } from './../git'; -// import { Logger } from '../../logger'; -import * as path from 'path'; interface LogEntry { ref?: string; diff --git a/src/git/parsers/remoteParser.ts b/src/git/parsers/remoteParser.ts index 35e3bd1..9c56854 100644 --- a/src/git/parsers/remoteParser.ts +++ b/src/git/parsers/remoteParser.ts @@ -1,7 +1,7 @@ 'use strict'; -import { GitRemote } from './../git'; import { GitRemoteType } from '../models/remote'; import { RemoteProvider } from '../remotes/factory'; +import { GitRemote } from './../git'; const remoteRegex = /^(.*)\t(.*)\s\((.*)\)$/gm; const urlRegex = /^(?:(git:\/\/)(.*?)\/|(https?:\/\/)(?:.*?@)?(.*?)\/|git@(.*):|(ssh:\/\/)(?:.*@)?(.*?)(?::.*?)?\/|(?:.*?@)(.*?):)(.*)$/; diff --git a/src/git/parsers/stashParser.ts b/src/git/parsers/stashParser.ts index 92be0f3..7f1b9f6 100644 --- a/src/git/parsers/stashParser.ts +++ b/src/git/parsers/stashParser.ts @@ -1,7 +1,7 @@ 'use strict'; import { Arrays, Strings } from '../../system'; import { GitCommitType, GitLogParser, GitStash, GitStashCommit, GitStatusFileStatus, IGitStatusFile } from './../git'; -// import { Logger } from '../../logger'; +// import { Logger } from './logger'; interface StashEntry { ref?: string; diff --git a/src/git/remotes/custom.ts b/src/git/remotes/custom.ts index 1051b8a..4478528 100644 --- a/src/git/remotes/custom.ts +++ b/src/git/remotes/custom.ts @@ -1,7 +1,7 @@ 'use strict'; -import { Strings } from '../../system'; import { Range } from 'vscode'; import { IRemotesUrlsConfig } from '../../configuration'; +import { Strings } from '../../system'; import { RemoteProvider } from './provider'; export class CustomService extends RemoteProvider { diff --git a/src/git/remotes/factory.ts b/src/git/remotes/factory.ts index 4127017..6f0e7ca 100644 --- a/src/git/remotes/factory.ts +++ b/src/git/remotes/factory.ts @@ -1,11 +1,11 @@ 'use strict'; +import { CustomRemoteType, IRemotesConfig } from '../../configuration'; +import { Logger } from '../../logger'; import { BitbucketService } from './bitbucket'; import { BitbucketServerService } from './bitbucket-server'; -import { CustomRemoteType, IRemotesConfig } from '../../configuration'; import { CustomService } from './custom'; import { GitHubService } from './github'; import { GitLabService } from './gitlab'; -import { Logger } from '../../logger'; import { RemoteProvider } from './provider'; import { VisualStudioService } from './visualStudio'; diff --git a/src/git/shell.ts b/src/git/shell.ts index 4ce419f..d66c90a 100644 --- a/src/git/shell.ts +++ b/src/git/shell.ts @@ -1,8 +1,8 @@ 'use strict'; import { execFile } from 'child_process'; -import { Logger } from '../logger'; import * as fs from 'fs'; import * as path from 'path'; +import { Logger } from '../logger'; const isWindows = process.platform === 'win32'; diff --git a/src/gitContentProvider.ts b/src/gitContentProvider.ts index f8568d6..c6da389 100644 --- a/src/gitContentProvider.ts +++ b/src/gitContentProvider.ts @@ -1,10 +1,10 @@ 'use strict'; +import * as path from 'path'; import { CancellationToken, TextDocumentContentProvider, Uri, window } from 'vscode'; import { DocumentSchemes } from './constants'; import { Container } from './container'; import { GitService, GitUri } from './gitService'; import { Logger } from './logger'; -import * as path from 'path'; export class GitContentProvider implements TextDocumentContentProvider { static scheme = DocumentSchemes.GitLensGit; diff --git a/src/gitService.ts b/src/gitService.ts index 92967ac..2a97be4 100644 --- a/src/gitService.ts +++ b/src/gitService.ts @@ -1,5 +1,6 @@ 'use strict'; -import { Iterables, Objects, Strings, TernarySearchTree, Versions } from './system'; +import * as fs from 'fs'; +import * as path from 'path'; import { ConfigurationChangeEvent, Disposable, @@ -17,7 +18,6 @@ import { import { configuration, IRemotesConfig } from './configuration'; import { CommandContext, DocumentSchemes, setCommandContext } from './constants'; import { Container } from './container'; -import { RemoteProviderFactory, RemoteProviderMap } from './git/remotes/factory'; import { CommitFormatting, Git, @@ -51,11 +51,11 @@ import { Repository, RepositoryChange } from './git/git'; -import { CachedBlame, CachedDiff, CachedLog, GitDocumentState, TrackedDocument } from './trackers/gitDocumentTracker'; import { GitUri, IGitCommitInfo } from './git/gitUri'; +import { RemoteProviderFactory, RemoteProviderMap } from './git/remotes/factory'; import { Logger } from './logger'; -import * as fs from 'fs'; -import * as path from 'path'; +import { Iterables, Objects, Strings, TernarySearchTree, Versions } from './system'; +import { CachedBlame, CachedDiff, CachedLog, GitDocumentState, TrackedDocument } from './trackers/gitDocumentTracker'; export { GitUri, IGit, IGitCommitInfo }; export * from './git/models/models'; diff --git a/src/annotations/lineHoverController.ts b/src/hovers/lineHoverController.ts similarity index 97% rename from src/annotations/lineHoverController.ts rename to src/hovers/lineHoverController.ts index c1a8da8..b730288 100644 --- a/src/annotations/lineHoverController.ts +++ b/src/hovers/lineHoverController.ts @@ -13,10 +13,10 @@ import { TextEditor, window } from 'vscode'; -import { Annotations } from './annotations'; -import { configuration } from './../configuration'; -import { Container } from './../container'; -import { LinesChangeEvent } from './../trackers/gitLineTracker'; +import { Annotations } from '../annotations/annotations'; +import { configuration } from '../configuration'; +import { Container } from '../container'; +import { LinesChangeEvent } from '../trackers/gitLineTracker'; export class LineHoverController extends Disposable { private _debugSessionEndDisposable: Disposable | undefined; diff --git a/src/quickPicks/branchHistoryQuickPick.ts b/src/quickPicks/branchHistoryQuickPick.ts index 0c61dce..0ab0cf0 100644 --- a/src/quickPicks/branchHistoryQuickPick.ts +++ b/src/quickPicks/branchHistoryQuickPick.ts @@ -1,17 +1,17 @@ 'use strict'; -import { Iterables, Strings } from '../system'; import { CancellationTokenSource, QuickPickOptions, window } from 'vscode'; import { Commands, ShowCommitSearchCommandArgs, ShowQuickBranchHistoryCommandArgs } from '../commands'; +import { GlyphChars } from '../constants'; +import { Container } from '../container'; +import { GitLog, GitUri, RemoteResource } from '../gitService'; +import { KeyNoopCommand } from '../keyboard'; +import { Iterables, Strings } from '../system'; import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from './commonQuickPicks'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; -import { GitLog, GitUri, RemoteResource } from '../gitService'; -import { KeyNoopCommand } from '../keyboard'; import { OpenRemotesCommandQuickPickItem } from './remotesQuickPick'; export class BranchHistoryQuickPick { diff --git a/src/quickPicks/branchesAndTagsQuickPick.ts b/src/quickPicks/branchesAndTagsQuickPick.ts index fe9afc7..03002ed 100644 --- a/src/quickPicks/branchesAndTagsQuickPick.ts +++ b/src/quickPicks/branchesAndTagsQuickPick.ts @@ -1,10 +1,10 @@ 'use strict'; import { CancellationTokenSource, QuickPickItem, QuickPickOptions, window } from 'vscode'; -import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from './commonQuickPicks'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { GitBranch, GitTag } from '../gitService'; import { KeyNoopCommand } from '../keyboard'; +import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress } from './commonQuickPicks'; export class BranchOrTagQuickPickItem implements QuickPickItem { label: string; diff --git a/src/quickPicks/branchesQuickPick.ts b/src/quickPicks/branchesQuickPick.ts index b1b253e..9e98a16 100644 --- a/src/quickPicks/branchesQuickPick.ts +++ b/src/quickPicks/branchesQuickPick.ts @@ -1,8 +1,8 @@ 'use strict'; import { QuickPickItem, QuickPickOptions, window } from 'vscode'; -import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './commonQuickPicks'; import { GlyphChars } from '../constants'; import { GitBranch } from '../gitService'; +import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './commonQuickPicks'; export class BranchQuickPickItem implements QuickPickItem { label: string; diff --git a/src/quickPicks/commitFileQuickPick.ts b/src/quickPicks/commitFileQuickPick.ts index 2eedf45..1c14d61 100644 --- a/src/quickPicks/commitFileQuickPick.ts +++ b/src/quickPicks/commitFileQuickPick.ts @@ -1,5 +1,5 @@ 'use strict'; -import { Iterables, Strings } from '../system'; +import * as path from 'path'; import { QuickPickItem, QuickPickOptions, Uri, window } from 'vscode'; import { Commands, @@ -12,18 +12,18 @@ import { ShowQuickCommitFileDetailsCommandArgs, ShowQuickFileHistoryCommandArgs } from '../commands'; +import { GlyphChars } from '../constants'; +import { Container } from '../container'; +import { GitLog, GitLogCommit, GitUri, RemoteResource } from '../gitService'; +import { KeyCommand, KeyNoopCommand } from '../keyboard'; +import { Iterables, Strings } from '../system'; import { CommandQuickPickItem, getQuickPickIgnoreFocusOut, KeyCommandQuickPickItem, OpenFileCommandQuickPickItem } from './commonQuickPicks'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; -import { GitLog, GitLogCommit, GitUri, RemoteResource } from '../gitService'; -import { KeyCommand, KeyNoopCommand } from '../keyboard'; import { OpenRemotesCommandQuickPickItem } from './remotesQuickPick'; -import * as path from 'path'; export class ApplyCommitFileChangesCommandQuickPickItem extends CommandQuickPickItem { constructor( diff --git a/src/quickPicks/commitQuickPick.ts b/src/quickPicks/commitQuickPick.ts index 8817341..11a79e8 100644 --- a/src/quickPicks/commitQuickPick.ts +++ b/src/quickPicks/commitQuickPick.ts @@ -1,5 +1,5 @@ 'use strict'; -import { Arrays, Iterables, Strings } from '../system'; +import * as path from 'path'; import { commands, QuickPickOptions, TextDocumentShowOptions, Uri, window } from 'vscode'; import { Commands, @@ -11,15 +11,6 @@ import { StashApplyCommandArgs, StashDeleteCommandArgs } from '../commands'; -import { - CommandQuickPickItem, - getQuickPickIgnoreFocusOut, - KeyCommandQuickPickItem, - OpenFileCommandQuickPickItem, - OpenFilesCommandQuickPickItem, - QuickPickItem, - ShowCommitInResultsQuickPickItem -} from './commonQuickPicks'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { @@ -34,8 +25,17 @@ import { RemoteResource } from '../gitService'; import { KeyCommand, KeyNoopCommand, Keys } from '../keyboard'; +import { Arrays, Iterables, Strings } from '../system'; +import { + CommandQuickPickItem, + getQuickPickIgnoreFocusOut, + KeyCommandQuickPickItem, + OpenFileCommandQuickPickItem, + OpenFilesCommandQuickPickItem, + QuickPickItem, + ShowCommitInResultsQuickPickItem +} from './commonQuickPicks'; import { OpenRemotesCommandQuickPickItem } from './remotesQuickPick'; -import * as path from 'path'; export class CommitWithFileStatusQuickPickItem extends OpenFileCommandQuickPickItem { readonly status: GitStatusFileStatus; diff --git a/src/quickPicks/commitsQuickPick.ts b/src/quickPicks/commitsQuickPick.ts index 9a3f1aa..33bcb48 100644 --- a/src/quickPicks/commitsQuickPick.ts +++ b/src/quickPicks/commitsQuickPick.ts @@ -1,16 +1,16 @@ 'use strict'; -import { Iterables } from '../system'; import { CancellationTokenSource, QuickPickOptions, window } from 'vscode'; import { Container } from '../container'; import { GitLog } from '../gitService'; import { KeyNoopCommand } from '../keyboard'; +import { Iterables } from '../system'; import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, MessageQuickPickItem, showQuickPickProgress -} from '../quickPicks/quickPicks'; +} from './commonQuickPicks'; export class CommitsQuickPick { static showProgress(message: string) { diff --git a/src/quickPicks/commonQuickPicks.ts b/src/quickPicks/commonQuickPicks.ts index da7be0a..4f43a9b 100644 --- a/src/quickPicks/commonQuickPicks.ts +++ b/src/quickPicks/commonQuickPicks.ts @@ -1,5 +1,4 @@ 'use strict'; -import { Strings } from '../system'; import { CancellationTokenSource, commands, @@ -10,13 +9,14 @@ import { Uri, window } from 'vscode'; -import { BranchesAndTagsQuickPick, BranchOrTagQuickPickItem } from './branchesAndTagsQuickPick'; import { Commands, openEditor } from '../commands'; import { configuration } from '../configuration'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { GitLog, GitLogCommit, GitStashCommit } from '../gitService'; import { KeyMapping, Keys } from '../keyboard'; +import { Strings } from '../system'; +import { BranchesAndTagsQuickPick, BranchOrTagQuickPickItem } from './branchesAndTagsQuickPick'; export function getQuickPickIgnoreFocusOut() { return !configuration.get(configuration.name('advanced')('quickPick')('closeOnFocusOut').value); @@ -100,9 +100,68 @@ export class CommandQuickPickItem implements QuickPickItem { } } -export class MessageQuickPickItem extends CommandQuickPickItem { - constructor(message: string) { - super({ label: message, description: '' } as QuickPickItem); +export class CommitQuickPickItem implements QuickPickItem { + label: string; + description: string; + detail: string; + + constructor( + public readonly commit: GitLogCommit + ) { + const message = commit.getShortMessage(); + if (commit.isStash) { + this.label = message; + this.description = ''; + this.detail = `${GlyphChars.Space} ${(commit as GitStashCommit).stashName || commit.shortSha} ${Strings.pad( + GlyphChars.Dot, + 1, + 1 + )} ${commit.formattedDate} ${Strings.pad(GlyphChars.Dot, 1, 1)} ${commit.getDiffStatus()}`; + } + else { + this.label = message; + this.description = `${Strings.pad('$(git-commit)', 1, 1)} ${commit.shortSha}`; + this.detail = `${GlyphChars.Space} ${commit.author}, ${commit.formattedDate}${ + commit.isFile ? '' : ` ${Strings.pad(GlyphChars.Dot, 1, 1)} ${commit.getDiffStatus()}` + }`; + } + } +} + +export class ChooseFromBranchesAndTagsQuickPickItem extends CommandQuickPickItem { + constructor( + private readonly repoPath: string, + private readonly placeHolder: string, + private readonly goBackCommand?: CommandQuickPickItem, + item: QuickPickItem = { + label: 'Choose from Branch or Tag History...', + description: `${Strings.pad(GlyphChars.Dash, 2, 2)} shows list of branches and tags` + } + ) { + super(item, undefined, undefined); + } + + async execute( + options: TextDocumentShowOptions = { preserveFocus: false, preview: false } + ): Promise { + const progressCancellation = BranchesAndTagsQuickPick.showProgress(this.placeHolder); + + try { + const [branches, tags] = await Promise.all([ + Container.git.getBranches(this.repoPath), + Container.git.getTags(this.repoPath) + ]); + + if (progressCancellation.token.isCancellationRequested) return undefined; + + return BranchesAndTagsQuickPick.show(branches, tags, this.placeHolder, { + progressCancellation: progressCancellation, + goBackCommand: this.goBackCommand + }); + } + finally { + progressCancellation.cancel(); + } } } @@ -112,6 +171,12 @@ export class KeyCommandQuickPickItem extends CommandQuickPickItem { } } +export class MessageQuickPickItem extends CommandQuickPickItem { + constructor(message: string) { + super({ label: message, description: '' } as QuickPickItem); + } +} + export class OpenFileCommandQuickPickItem extends CommandQuickPickItem { constructor( public readonly uri: Uri, @@ -164,34 +229,6 @@ export class OpenFilesCommandQuickPickItem extends CommandQuickPickItem { } } -export class CommitQuickPickItem implements QuickPickItem { - label: string; - description: string; - detail: string; - - constructor( - public readonly commit: GitLogCommit - ) { - const message = commit.getShortMessage(); - if (commit.isStash) { - this.label = message; - this.description = ''; - this.detail = `${GlyphChars.Space} ${(commit as GitStashCommit).stashName || commit.shortSha} ${Strings.pad( - GlyphChars.Dot, - 1, - 1 - )} ${commit.formattedDate} ${Strings.pad(GlyphChars.Dot, 1, 1)} ${commit.getDiffStatus()}`; - } - else { - this.label = message; - this.description = `${Strings.pad('$(git-commit)', 1, 1)} ${commit.shortSha}`; - this.detail = `${GlyphChars.Space} ${commit.author}, ${commit.formattedDate}${ - commit.isFile ? '' : ` ${Strings.pad(GlyphChars.Dot, 1, 1)} ${commit.getDiffStatus()}` - }`; - } - } -} - export class ShowCommitInResultsQuickPickItem extends CommandQuickPickItem { constructor( public readonly commit: GitLogCommit, @@ -243,40 +280,3 @@ export class ShowCommitsSearchInResultsQuickPickItem extends ShowCommitsInResult super(results, { label: search }, item); } } - -export class ShowBranchesAndTagsQuickPickItem extends CommandQuickPickItem { - constructor( - private readonly repoPath: string, - private readonly placeHolder: string, - private readonly goBackCommand?: CommandQuickPickItem, - item: QuickPickItem = { - label: 'Choose from Branch or Tag History...', - description: `${Strings.pad(GlyphChars.Dash, 2, 2)} shows list of branches and tags` - } - ) { - super(item, undefined, undefined); - } - - async execute( - options: TextDocumentShowOptions = { preserveFocus: false, preview: false } - ): Promise { - const progressCancellation = BranchesAndTagsQuickPick.showProgress(this.placeHolder); - - try { - const [branches, tags] = await Promise.all([ - Container.git.getBranches(this.repoPath), - Container.git.getTags(this.repoPath) - ]); - - if (progressCancellation.token.isCancellationRequested) return undefined; - - return BranchesAndTagsQuickPick.show(branches, tags, this.placeHolder, { - progressCancellation: progressCancellation, - goBackCommand: this.goBackCommand - }); - } - finally { - progressCancellation.cancel(); - } - } -} diff --git a/src/quickPicks/fileHistoryQuickPick.ts b/src/quickPicks/fileHistoryQuickPick.ts index ae418a3..c6c6340 100644 --- a/src/quickPicks/fileHistoryQuickPick.ts +++ b/src/quickPicks/fileHistoryQuickPick.ts @@ -1,20 +1,20 @@ 'use strict'; -import { Iterables, Strings } from '../system'; +import * as path from 'path'; import { CancellationTokenSource, QuickPickOptions, Uri, window } from 'vscode'; import { Commands, ShowQuickCurrentBranchHistoryCommandArgs, ShowQuickFileHistoryCommandArgs } from '../commands'; +import { GlyphChars } from '../constants'; +import { Container } from '../container'; +import { GitLog, GitUri, RemoteResource } from '../gitService'; +import { KeyNoopCommand } from '../keyboard'; +import { Iterables, Strings } from '../system'; import { + ChooseFromBranchesAndTagsQuickPickItem, CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, - ShowBranchesAndTagsQuickPickItem, showQuickPickProgress } from './commonQuickPicks'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; -import { GitLog, GitUri, RemoteResource } from '../gitService'; -import { KeyNoopCommand } from '../keyboard'; import { OpenRemotesCommandQuickPickItem } from './remotesQuickPick'; -import * as path from 'path'; export class FileHistoryQuickPick { static showProgress(placeHolder: string) { @@ -49,7 +49,11 @@ export class FileHistoryQuickPick { let index = 0; index++; - items.splice(0, 0, new ShowBranchesAndTagsQuickPickItem(log.repoPath, placeHolder, options.currentCommand)); + items.splice( + 0, + 0, + new ChooseFromBranchesAndTagsQuickPickItem(log.repoPath, placeHolder, options.currentCommand) + ); if (options.showInResultsExplorerCommand !== undefined) { index++; diff --git a/src/quickPicks/modesQuickPick.ts b/src/quickPicks/modesQuickPick.ts index 36017c4..3fcee6e 100644 --- a/src/quickPicks/modesQuickPick.ts +++ b/src/quickPicks/modesQuickPick.ts @@ -1,7 +1,7 @@ 'use strict'; import { QuickPickItem, QuickPickOptions, window } from 'vscode'; -import { Container } from '../container'; import { GlyphChars } from '../constants'; +import { Container } from '../container'; export interface ModesQuickPickItem extends QuickPickItem { key: string | undefined; diff --git a/src/quickPicks/quickPicks.ts b/src/quickPicks/quickPicks.ts deleted file mode 100644 index faee378..0000000 --- a/src/quickPicks/quickPicks.ts +++ /dev/null @@ -1,15 +0,0 @@ -'use strict'; - -export * from './branchesAndTagsQuickPick'; -export * from './branchesQuickPick'; -export * from './branchHistoryQuickPick'; -export * from './commitFileQuickPick'; -export * from './commitQuickPick'; -export * from './commitsQuickPick'; -export * from './commonQuickPicks'; -export * from './fileHistoryQuickPick'; -export * from './modesQuickPick'; -export * from './remotesQuickPick'; -export * from './repositoriesQuickPick'; -export * from './repoStatusQuickPick'; -export * from './stashListQuickPick'; diff --git a/src/quickPicks/remotesQuickPick.ts b/src/quickPicks/remotesQuickPick.ts index 4a88032..347ab76 100644 --- a/src/quickPicks/remotesQuickPick.ts +++ b/src/quickPicks/remotesQuickPick.ts @@ -1,8 +1,7 @@ 'use strict'; -import { Strings } from '../system'; +import * as path from 'path'; import { QuickPickOptions, window } from 'vscode'; import { Commands, OpenInRemoteCommandArgs } from '../commands'; -import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './commonQuickPicks'; import { GlyphChars } from '../constants'; import { getNameFromRemoteResource, @@ -12,7 +11,8 @@ import { RemoteResource, RemoteResourceType } from '../gitService'; -import * as path from 'path'; +import { Strings } from '../system'; +import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './commonQuickPicks'; export class OpenRemoteCommandQuickPickItem extends CommandQuickPickItem { private remote: GitRemote; diff --git a/src/quickPicks/repoStatusQuickPick.ts b/src/quickPicks/repoStatusQuickPick.ts index 4e6a976..86e8f53 100644 --- a/src/quickPicks/repoStatusQuickPick.ts +++ b/src/quickPicks/repoStatusQuickPick.ts @@ -1,5 +1,5 @@ 'use strict'; -import { Iterables, Strings } from '../system'; +import * as path from 'path'; import { commands, QuickPickOptions, TextDocumentShowOptions, window } from 'vscode'; import { Commands, @@ -9,12 +9,6 @@ import { ShowQuickRepoStatusCommandArgs, ShowQuickStashListCommandArgs } from '../commands'; -import { - CommandQuickPickItem, - getQuickPickIgnoreFocusOut, - OpenFileCommandQuickPickItem, - QuickPickItem -} from './commonQuickPicks'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { @@ -27,7 +21,13 @@ import { GitUri } from '../gitService'; import { Keys } from '../keyboard'; -import * as path from 'path'; +import { Iterables, Strings } from '../system'; +import { + CommandQuickPickItem, + getQuickPickIgnoreFocusOut, + OpenFileCommandQuickPickItem, + QuickPickItem +} from './commonQuickPicks'; export class OpenStatusFileCommandQuickPickItem extends OpenFileCommandQuickPickItem { public readonly status: GitStatusFile; diff --git a/src/quickPicks/repositoriesQuickPick.ts b/src/quickPicks/repositoriesQuickPick.ts index 02abce0..e4077f0 100644 --- a/src/quickPicks/repositoriesQuickPick.ts +++ b/src/quickPicks/repositoriesQuickPick.ts @@ -1,9 +1,9 @@ 'use strict'; -import { Iterables } from '../system'; import { QuickPickItem, QuickPickOptions, window } from 'vscode'; -import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './commonQuickPicks'; import { Container } from '../container'; import { Repository } from '../gitService'; +import { Iterables } from '../system'; +import { CommandQuickPickItem, getQuickPickIgnoreFocusOut } from './commonQuickPicks'; export class RepositoryQuickPickItem implements QuickPickItem { label: string; diff --git a/src/quickPicks/stashListQuickPick.ts b/src/quickPicks/stashListQuickPick.ts index 49e72be..3c40d13 100644 --- a/src/quickPicks/stashListQuickPick.ts +++ b/src/quickPicks/stashListQuickPick.ts @@ -1,17 +1,17 @@ 'use strict'; -import { Iterables, Strings } from '../system'; import { CancellationTokenSource, QuickPickOptions, window } from 'vscode'; import { Commands, StashSaveCommandArgs } from '../commands'; import { GlyphChars } from '../constants'; import { Container } from '../container'; import { GitStash } from '../gitService'; import { KeyNoopCommand } from '../keyboard'; +import { Iterables, Strings } from '../system'; import { CommandQuickPickItem, CommitQuickPickItem, getQuickPickIgnoreFocusOut, showQuickPickProgress -} from '../quickPicks/quickPicks'; +} from './commonQuickPicks'; export class StashListQuickPick { static showProgress(mode: 'list' | 'apply') { diff --git a/src/quickpicks.ts b/src/quickpicks.ts new file mode 100644 index 0000000..13017bc --- /dev/null +++ b/src/quickpicks.ts @@ -0,0 +1,15 @@ +'use strict'; + +export * from './quickpicks/branchesAndTagsQuickPick'; +export * from './quickpicks/branchesQuickPick'; +export * from './quickpicks/branchHistoryQuickPick'; +export * from './quickpicks/commitFileQuickPick'; +export * from './quickpicks/commitQuickPick'; +export * from './quickpicks/commitsQuickPick'; +export * from './quickpicks/commonQuickPicks'; +export * from './quickpicks/fileHistoryQuickPick'; +export * from './quickpicks/modesQuickPick'; +export * from './quickpicks/remotesQuickPick'; +export * from './quickpicks/repositoriesQuickPick'; +export * from './quickpicks/repoStatusQuickPick'; +export * from './quickpicks/stashListQuickPick'; diff --git a/src/statusBarController.ts b/src/statusbar/statusBarController.ts similarity index 96% rename from src/statusBarController.ts rename to src/statusbar/statusBarController.ts index 84d067b..db87e49 100644 --- a/src/statusBarController.ts +++ b/src/statusbar/statusBarController.ts @@ -1,11 +1,11 @@ 'use strict'; import { ConfigurationChangeEvent, Disposable, StatusBarAlignment, StatusBarItem, TextEditor, window } from 'vscode'; -import { Commands } from './commands'; -import { configuration, StatusBarCommand } from './configuration'; -import { isTextEditor } from './constants'; -import { Container } from './container'; -import { LinesChangeEvent } from './trackers/gitLineTracker'; -import { CommitFormatter, GitCommit, ICommitFormatOptions } from './gitService'; +import { Commands } from '../commands'; +import { configuration, StatusBarCommand } from '../configuration'; +import { isTextEditor } from '../constants'; +import { Container } from '../container'; +import { CommitFormatter, GitCommit, ICommitFormatOptions } from '../gitService'; +import { LinesChangeEvent } from '../trackers/gitLineTracker'; export class StatusBarController extends Disposable { private _blameStatusBarItem: StatusBarItem | undefined; diff --git a/src/trackers/activeEditorTracker.ts b/src/trackers/activeEditorTracker.ts index 7954285..0da65a7 100644 --- a/src/trackers/activeEditorTracker.ts +++ b/src/trackers/activeEditorTracker.ts @@ -1,7 +1,7 @@ 'use strict'; -import { Functions } from './../system'; import { commands, Disposable, TextEditor, window } from 'vscode'; -import { BuiltInCommands } from './../constants'; +import { BuiltInCommands } from '../constants'; +import { Functions } from '../system'; export class ActiveEditorTracker extends Disposable { private _disposable: Disposable; diff --git a/src/trackers/documentTracker.ts b/src/trackers/documentTracker.ts index c019ec4..277023a 100644 --- a/src/trackers/documentTracker.ts +++ b/src/trackers/documentTracker.ts @@ -1,5 +1,4 @@ 'use strict'; -import { Functions, IDeferrable } from './../system'; import { ConfigurationChangeEvent, Disposable, @@ -16,9 +15,10 @@ import { window, workspace } from 'vscode'; -import { configuration } from './../configuration'; -import { CommandContext, DocumentSchemes, isActiveDocument, isTextEditor, setCommandContext } from './../constants'; +import { configuration } from '../configuration'; +import { CommandContext, DocumentSchemes, isActiveDocument, isTextEditor, setCommandContext } from '../constants'; import { GitUri } from '../gitService'; +import { Functions, IDeferrable } from '../system'; import { DocumentBlameStateChangeEvent, TrackedDocument } from './trackedDocument'; export * from './trackedDocument'; diff --git a/src/trackers/gitDocumentTracker.ts b/src/trackers/gitDocumentTracker.ts index a070d59..6268579 100644 --- a/src/trackers/gitDocumentTracker.ts +++ b/src/trackers/gitDocumentTracker.ts @@ -1,6 +1,6 @@ 'use strict'; +import { GitBlame, GitDiff, GitLog } from '../git/git'; import { DocumentTracker } from './documentTracker'; -import { GitBlame, GitDiff, GitLog } from './../git/git'; export * from './documentTracker'; diff --git a/src/trackers/gitLineTracker.ts b/src/trackers/gitLineTracker.ts index fbd0bdd..3015e26 100644 --- a/src/trackers/gitLineTracker.ts +++ b/src/trackers/gitLineTracker.ts @@ -1,14 +1,14 @@ 'use strict'; import { Disposable, TextEditor } from 'vscode'; -import { GitBlameCommit, GitLogCommit } from '../gitService'; -import { LinesChangeEvent, LineTracker } from './lineTracker'; import { Container } from '../container'; +import { GitBlameCommit, GitLogCommit } from '../gitService'; import { DocumentBlameStateChangeEvent, DocumentDirtyIdleTriggerEvent, DocumentDirtyStateChangeEvent, GitDocumentState } from './gitDocumentTracker'; +import { LinesChangeEvent, LineTracker } from './lineTracker'; export * from './lineTracker'; diff --git a/src/trackers/lineTracker.ts b/src/trackers/lineTracker.ts index c39b983..152ea36 100644 --- a/src/trackers/lineTracker.ts +++ b/src/trackers/lineTracker.ts @@ -1,7 +1,7 @@ 'use strict'; -import { Functions, IDeferrable } from './../system'; import { Disposable, Event, EventEmitter, TextEditor, TextEditorSelectionChangeEvent, window } from 'vscode'; -import { isTextEditor } from './../constants'; +import { isTextEditor } from '../constants'; +import { Functions, IDeferrable } from '../system'; export interface LinesChangeEvent { readonly editor: TextEditor | undefined; diff --git a/src/trackers/trackedDocument.ts b/src/trackers/trackedDocument.ts index d0837d9..a10c5ea 100644 --- a/src/trackers/trackedDocument.ts +++ b/src/trackers/trackedDocument.ts @@ -1,10 +1,10 @@ 'use strict'; -import { Functions } from '../system'; import { Disposable, Event, EventEmitter, TextDocument, TextEditor, Uri } from 'vscode'; -import { CommandContext, getEditorIfActive, isActiveDocument, setCommandContext } from './../constants'; -import { Container } from './../container'; -import { GitUri, Repository, RepositoryChange, RepositoryChangeEvent } from './../gitService'; -import { Logger } from './../logger'; +import { CommandContext, getEditorIfActive, isActiveDocument, setCommandContext } from '../constants'; +import { Container } from '../container'; +import { GitUri, Repository, RepositoryChange, RepositoryChangeEvent } from '../gitService'; +import { Logger } from '../logger'; +import { Functions } from '../system'; export interface DocumentBlameStateChangeEvent { readonly editor: TextEditor; diff --git a/src/views/explorerCommands.ts b/src/views/explorerCommands.ts index 183c19e..088b2a1 100644 --- a/src/views/explorerCommands.ts +++ b/src/views/explorerCommands.ts @@ -1,18 +1,5 @@ -import { Arrays } from '../system'; +'use strict'; import { commands, Disposable, InputBoxOptions, Terminal, TextDocumentShowOptions, Uri, window } from 'vscode'; -import { CommandContext, extensionTerminalName, setCommandContext } from '../constants'; -import { Container } from '../container'; -import { BranchNode, ExplorerNode, TagNode } from '../views/gitExplorer'; -import { - CommitFileNode, - CommitNode, - ExplorerRefNode, - RemoteNode, - StashFileNode, - StashNode, - StatusFileCommitsNode, - StatusUpstreamNode -} from './explorerNodes'; import { Commands, DiffWithCommandArgs, @@ -23,10 +10,26 @@ import { OpenFileInRemoteCommandArgs, OpenFileRevisionCommandArgs } from '../commands'; +import { CommandContext, extensionTerminalName, setCommandContext } from '../constants'; +import { Container } from '../container'; import { GitService, GitUri } from '../gitService'; -import { RepositoryNode } from './repositoryNode'; -import { StatusNode } from './statusNode'; -import { StatusFileNode } from './statusFileNode'; +import { Arrays } from '../system'; +import { + BranchNode, + CommitFileNode, + CommitNode, + ExplorerNode, + ExplorerRefNode, + RemoteNode, + RepositoryNode, + StashFileNode, + StashNode, + StatusFileCommitsNode, + StatusFileNode, + StatusNode, + StatusUpstreamNode, + TagNode +} from './nodes'; export interface RefreshNodeCommandArgs { maxCount?: number; diff --git a/src/views/explorerNodes.ts b/src/views/explorerNodes.ts deleted file mode 100644 index ba08c68..0000000 --- a/src/views/explorerNodes.ts +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; - -export * from './explorerNode'; -export * from './activeRepositoryNode'; -export * from './branchesNode'; -export * from './branchNode'; -export * from './commitFileNode'; -export * from './commitNode'; -export * from './commitResultsNode'; -export * from './commitsNode'; -export * from './commitsResultsNode'; -export * from './comparisonResultsNode'; -export * from './fileHistoryNode'; -export * from './historyNode'; -export * from './remoteNode'; -export * from './remotesNode'; -export * from './repositoriesNode'; -export * from './repositoryNode'; -export * from './stashesNode'; -export * from './stashFileNode'; -export * from './stashNode'; -export * from './statusFileCommitsNode'; -export * from './statusFileNode'; -export * from './statusFilesNode'; -export * from './statusFilesResultsNode'; -export * from './statusNode'; -export * from './statusUpstreamNode'; -export * from './tagsNode'; -export * from './tagNode'; diff --git a/src/views/gitExplorer.ts b/src/views/gitExplorer.ts index 24d158a..eb98644 100644 --- a/src/views/gitExplorer.ts +++ b/src/views/gitExplorer.ts @@ -1,5 +1,5 @@ 'use strict'; -import { Functions } from '../system'; +import * as path from 'path'; import { commands, ConfigurationChangeEvent, @@ -25,7 +25,10 @@ import { } from '../configuration'; import { CommandContext, GlyphChars, setCommandContext, WorkspaceState } from '../constants'; import { Container } from '../container'; -import { RefreshNodeCommandArgs } from './explorerCommands'; +import { GitUri } from '../gitService'; +import { Logger } from '../logger'; +import { Functions } from '../system'; +import { RefreshNodeCommandArgs } from '../views/explorerCommands'; import { Explorer, ExplorerNode, @@ -34,12 +37,9 @@ import { RefreshReason, RepositoriesNode, RepositoryNode -} from './explorerNodes'; -import { GitUri } from '../gitService'; -import { Logger } from '../logger'; -import * as path from 'path'; +} from './nodes'; -export * from './explorerNodes'; +export * from './nodes'; export interface OpenFileRevisionCommandArgs { uri?: Uri; diff --git a/src/views/historyExplorer.ts b/src/views/historyExplorer.ts index ac3739c..e7fd2fb 100644 --- a/src/views/historyExplorer.ts +++ b/src/views/historyExplorer.ts @@ -1,5 +1,4 @@ 'use strict'; -import { Functions } from '../system'; import { commands, ConfigurationChangeEvent, @@ -15,12 +14,13 @@ import { import { configuration, GitExplorerView, IExplorersConfig, IHistoryExplorerConfig } from '../configuration'; import { CommandContext, GlyphChars, setCommandContext } from '../constants'; import { Container } from '../container'; -import { RefreshNodeCommandArgs } from './explorerCommands'; -import { ExplorerNode, MessageNode, RefreshReason } from './explorerNodes'; -import { GitExplorer } from './gitExplorer'; import { Logger } from '../logger'; +import { Functions } from '../system'; +import { RefreshNodeCommandArgs } from '../views/explorerCommands'; +import { GitExplorer } from '../views/gitExplorer'; +import { ExplorerNode, MessageNode, RefreshReason } from './nodes'; -export * from './explorerNodes'; +export * from './nodes'; export class HistoryExplorer extends Disposable implements TreeDataProvider { private _disposable: Disposable | undefined; diff --git a/src/views/nodes.ts b/src/views/nodes.ts new file mode 100644 index 0000000..b73df32 --- /dev/null +++ b/src/views/nodes.ts @@ -0,0 +1,29 @@ +'use strict'; + +export * from './nodes/explorerNode'; +export * from './nodes/activeRepositoryNode'; +export * from './nodes/branchesNode'; +export * from './nodes/branchNode'; +export * from './nodes/commitFileNode'; +export * from './nodes/commitNode'; +export * from './nodes/commitResultsNode'; +export * from './nodes/commitsNode'; +export * from './nodes/commitsResultsNode'; +export * from './nodes/comparisonResultsNode'; +export * from './nodes/fileHistoryNode'; +export * from './nodes/historyNode'; +export * from './nodes/remoteNode'; +export * from './nodes/remotesNode'; +export * from './nodes/repositoriesNode'; +export * from './nodes/repositoryNode'; +export * from './nodes/stashesNode'; +export * from './nodes/stashFileNode'; +export * from './nodes/stashNode'; +export * from './nodes/statusFileCommitsNode'; +export * from './nodes/statusFileNode'; +export * from './nodes/statusFilesNode'; +export * from './nodes/statusFilesResultsNode'; +export * from './nodes/statusNode'; +export * from './nodes/statusUpstreamNode'; +export * from './nodes/tagsNode'; +export * from './nodes/tagNode'; diff --git a/src/views/activeRepositoryNode.ts b/src/views/nodes/activeRepositoryNode.ts similarity index 92% rename from src/views/activeRepositoryNode.ts rename to src/views/nodes/activeRepositoryNode.ts index 72f7169..0a8e20d 100644 --- a/src/views/activeRepositoryNode.ts +++ b/src/views/nodes/activeRepositoryNode.ts @@ -1,11 +1,11 @@ 'use strict'; -import { Functions } from '../system'; import { TextEditor, TreeItem, TreeItemCollapsibleState, window } from 'vscode'; -import { isTextEditor } from '../constants'; -import { Container } from '../container'; +import { isTextEditor } from '../../constants'; +import { Container } from '../../container'; +import { GitUri } from '../../gitService'; +import { Functions } from '../../system'; +import { GitExplorer } from '../gitExplorer'; import { ExplorerNode } from './explorerNode'; -import { GitExplorer } from './gitExplorer'; -import { GitUri } from '../gitService'; import { RepositoryNode } from './repositoryNode'; export class ActiveRepositoryNode extends ExplorerNode { diff --git a/src/views/branchNode.ts b/src/views/nodes/branchNode.ts similarity index 93% rename from src/views/branchNode.ts rename to src/views/nodes/branchNode.ts index 245697b..7fef0cd 100644 --- a/src/views/branchNode.ts +++ b/src/views/nodes/branchNode.ts @@ -1,13 +1,13 @@ 'use strict'; -import { Arrays, Iterables } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { ExplorerBranchesLayout } from '../../configuration'; +import { GlyphChars } from '../../constants'; +import { Container } from '../../container'; +import { GitBranch, GitUri } from '../../gitService'; +import { Arrays, Iterables } from '../../system'; +import { GitExplorer } from '../gitExplorer'; import { CommitNode } from './commitNode'; -import { ExplorerBranchesLayout } from '../configuration'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; import { ExplorerNode, ExplorerRefNode, MessageNode, ResourceType, ShowAllNode } from './explorerNode'; -import { GitExplorer } from './gitExplorer'; -import { GitBranch, GitUri } from '../gitService'; export class BranchNode extends ExplorerRefNode { readonly supportsPaging: boolean = true; diff --git a/src/views/branchOrTagFolderNode.ts b/src/views/nodes/branchOrTagFolderNode.ts similarity index 92% rename from src/views/branchOrTagFolderNode.ts rename to src/views/nodes/branchOrTagFolderNode.ts index 4c8d264..d8b169b 100644 --- a/src/views/branchOrTagFolderNode.ts +++ b/src/views/nodes/branchOrTagFolderNode.ts @@ -1,10 +1,10 @@ 'use strict'; -import { Arrays, Objects } from '../system'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { GitUri } from '../../gitService'; +import { Arrays, Objects } from '../../system'; import { BranchNode } from './branchNode'; -// import { Container } from '../container'; +// import { Container } from '../../container'; import { Explorer, ExplorerNode, ResourceType } from './explorerNode'; -import { GitUri } from '../gitService'; import { TagNode } from './tagNode'; export class BranchOrTagFolderNode extends ExplorerNode { diff --git a/src/views/branchesNode.ts b/src/views/nodes/branchesNode.ts similarity index 91% rename from src/views/branchesNode.ts rename to src/views/nodes/branchesNode.ts index 108365c..1dc04a4 100644 --- a/src/views/branchesNode.ts +++ b/src/views/nodes/branchesNode.ts @@ -1,13 +1,13 @@ 'use strict'; -import { Arrays, Iterables } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { BranchOrTagFolderNode } from './branchOrTagFolderNode'; +import { ExplorerBranchesLayout } from '../../configuration'; +import { Container } from '../../container'; +import { GitUri, Repository } from '../../gitService'; +import { Arrays, Iterables } from '../../system'; +import { GitExplorer } from '../gitExplorer'; import { BranchNode } from './branchNode'; -import { ExplorerBranchesLayout } from '../configuration'; -import { Container } from '../container'; +import { BranchOrTagFolderNode } from './branchOrTagFolderNode'; import { ExplorerNode, ResourceType } from './explorerNode'; -import { GitExplorer } from './gitExplorer'; -import { GitUri, Repository } from '../gitService'; export class BranchesNode extends ExplorerNode { constructor( diff --git a/src/views/commitFileNode.ts b/src/views/nodes/commitFileNode.ts similarity index 97% rename from src/views/commitFileNode.ts rename to src/views/nodes/commitFileNode.ts index e000b51..0a680d8 100644 --- a/src/views/commitFileNode.ts +++ b/src/views/nodes/commitFileNode.ts @@ -1,9 +1,9 @@ 'use strict'; +import * as path from 'path'; import { Command, TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { Commands, DiffWithPreviousCommandArgs } from '../commands'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; -import { Explorer, ExplorerNode, ResourceType } from './explorerNode'; +import { Commands, DiffWithPreviousCommandArgs } from '../../commands'; +import { GlyphChars } from '../../constants'; +import { Container } from '../../container'; import { CommitFormatter, getGitStatusIcon, @@ -13,8 +13,8 @@ import { IGitStatusFile, IStatusFormatOptions, StatusFileFormatter -} from '../gitService'; -import * as path from 'path'; +} from '../../gitService'; +import { Explorer, ExplorerNode, ResourceType } from './explorerNode'; export enum CommitFileNodeDisplayAs { CommitLabel = 1 << 0, diff --git a/src/views/commitNode.ts b/src/views/nodes/commitNode.ts similarity index 92% rename from src/views/commitNode.ts rename to src/views/nodes/commitNode.ts index 3431642..5e80b4c 100644 --- a/src/views/commitNode.ts +++ b/src/views/nodes/commitNode.ts @@ -1,15 +1,15 @@ 'use strict'; -import { Arrays, Iterables, Strings } from '../system'; +import * as path from 'path'; import { Command, TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { Commands, DiffWithPreviousCommandArgs } from '../commands'; +import { Commands, DiffWithPreviousCommandArgs } from '../../commands'; +import { ExplorerFilesLayout } from '../../configuration'; +import { GlyphChars } from '../../constants'; +import { Container } from '../../container'; +import { CommitFormatter, GitBranch, GitLogCommit, ICommitFormatOptions } from '../../gitService'; +import { Arrays, Iterables, Strings } from '../../system'; import { CommitFileNode, CommitFileNodeDisplayAs } from './commitFileNode'; -import { ExplorerFilesLayout } from '../configuration'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; -import { FolderNode, IFileExplorerNode } from './folderNode'; import { Explorer, ExplorerNode, ExplorerRefNode, ResourceType } from './explorerNode'; -import { CommitFormatter, GitBranch, GitLogCommit, ICommitFormatOptions } from '../gitService'; -import * as path from 'path'; +import { FolderNode, IFileExplorerNode } from './folderNode'; export class CommitNode extends ExplorerRefNode { constructor( diff --git a/src/views/commitResultsNode.ts b/src/views/nodes/commitResultsNode.ts similarity index 87% rename from src/views/commitResultsNode.ts rename to src/views/nodes/commitResultsNode.ts index 13434af..9f6e291 100644 --- a/src/views/commitResultsNode.ts +++ b/src/views/nodes/commitResultsNode.ts @@ -1,11 +1,11 @@ 'use strict'; -import { Strings } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { GlyphChars } from '../../constants'; +import { Container } from '../../container'; +import { CommitFormatter, GitLogCommit } from '../../gitService'; +import { Strings } from '../../system'; import { CommitNode } from './commitNode'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; import { Explorer, ExplorerNode, MessageNode, ResourceType } from './explorerNode'; -import { CommitFormatter, GitLogCommit } from '../gitService'; export class CommitResultsNode extends ExplorerNode { constructor( diff --git a/src/views/commitsNode.ts b/src/views/nodes/commitsNode.ts similarity index 92% rename from src/views/commitsNode.ts rename to src/views/nodes/commitsNode.ts index 0d746a4..46e6a94 100644 --- a/src/views/commitsNode.ts +++ b/src/views/nodes/commitsNode.ts @@ -1,9 +1,9 @@ 'use strict'; -import { Iterables } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { GitLog, GitUri } from '../../gitService'; +import { Iterables } from '../../system'; import { CommitNode } from './commitNode'; import { Explorer, ExplorerNode, ResourceType, ShowAllNode } from './explorerNode'; -import { GitLog, GitUri } from '../gitService'; export class CommitsNode extends ExplorerNode { readonly supportsPaging: boolean = true; diff --git a/src/views/commitsResultsNode.ts b/src/views/nodes/commitsResultsNode.ts similarity index 95% rename from src/views/commitsResultsNode.ts rename to src/views/nodes/commitsResultsNode.ts index 8efd8cd..ec0bcf9 100644 --- a/src/views/commitsResultsNode.ts +++ b/src/views/nodes/commitsResultsNode.ts @@ -1,9 +1,9 @@ 'use strict'; -import { Iterables } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { GitLog, GitUri } from '../../gitService'; +import { Iterables } from '../../system'; import { CommitNode } from './commitNode'; import { Explorer, ExplorerNode, ResourceType, ShowAllNode } from './explorerNode'; -import { GitLog, GitUri } from '../gitService'; export class CommitsResultsNode extends ExplorerNode { readonly supportsPaging: boolean = true; diff --git a/src/views/comparisonResultsNode.ts b/src/views/nodes/comparisonResultsNode.ts similarity index 92% rename from src/views/comparisonResultsNode.ts rename to src/views/nodes/comparisonResultsNode.ts index 9bcd215..70042eb 100644 --- a/src/views/comparisonResultsNode.ts +++ b/src/views/nodes/comparisonResultsNode.ts @@ -1,11 +1,11 @@ 'use strict'; -import { Strings } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { GlyphChars } from '../../constants'; +import { Container } from '../../container'; +import { GitLog, GitService, GitUri } from '../../gitService'; +import { Strings } from '../../system'; import { CommitsResultsNode } from './commitsResultsNode'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; import { Explorer, ExplorerNode, NamedRef, ResourceType } from './explorerNode'; -import { GitLog, GitService, GitUri } from '../gitService'; import { StatusFilesResultsNode } from './statusFilesResultsNode'; export class ComparisonResultsNode extends ExplorerNode { diff --git a/src/views/explorerNode.ts b/src/views/nodes/explorerNode.ts similarity index 93% rename from src/views/explorerNode.ts rename to src/views/nodes/explorerNode.ts index 8211864..9f996ec 100644 --- a/src/views/explorerNode.ts +++ b/src/views/nodes/explorerNode.ts @@ -1,12 +1,12 @@ 'use strict'; import { Command, Disposable, TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; -import { RefreshNodeCommandArgs } from './explorerCommands'; -import { GitUri } from '../gitService'; -import { GitExplorer } from './gitExplorer'; -import { HistoryExplorer } from './historyExplorer'; -import { ResultsExplorer } from './resultsExplorer'; +import { GlyphChars } from '../../constants'; +import { Container } from '../../container'; +import { GitUri } from '../../gitService'; +import { RefreshNodeCommandArgs } from '../explorerCommands'; +import { GitExplorer } from '../gitExplorer'; +import { HistoryExplorer } from '../historyExplorer'; +import { ResultsExplorer } from '../resultsExplorer'; export interface NamedRef { label?: string; diff --git a/src/views/fileHistoryNode.ts b/src/views/nodes/fileHistoryNode.ts similarity index 96% rename from src/views/fileHistoryNode.ts rename to src/views/nodes/fileHistoryNode.ts index 2d97928..3a6bf7a 100644 --- a/src/views/fileHistoryNode.ts +++ b/src/views/nodes/fileHistoryNode.ts @@ -1,9 +1,6 @@ 'use strict'; -import { Iterables } from '../system'; import { Disposable, TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { CommitFileNode, CommitFileNodeDisplayAs } from './commitFileNode'; -import { Container } from '../container'; -import { Explorer, ExplorerNode, MessageNode, ResourceType } from './explorerNode'; +import { Container } from '../../container'; import { GitCommitType, GitLogCommit, @@ -13,8 +10,11 @@ import { RepositoryChange, RepositoryChangeEvent, RepositoryFileSystemChangeEvent -} from '../gitService'; -import { Logger } from '../logger'; +} from '../../gitService'; +import { Logger } from '../../logger'; +import { Iterables } from '../../system'; +import { CommitFileNode, CommitFileNodeDisplayAs } from './commitFileNode'; +import { Explorer, ExplorerNode, MessageNode, ResourceType } from './explorerNode'; export class FileHistoryNode extends ExplorerNode { constructor( diff --git a/src/views/folderNode.ts b/src/views/nodes/folderNode.ts similarity index 94% rename from src/views/folderNode.ts rename to src/views/nodes/folderNode.ts index 4f3e70a..79e3236 100644 --- a/src/views/folderNode.ts +++ b/src/views/nodes/folderNode.ts @@ -1,9 +1,9 @@ 'use strict'; -import { Arrays, Objects } from '../system'; import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { ExplorerFilesLayout, IExplorersFilesConfig } from '../configuration'; +import { ExplorerFilesLayout, IExplorersFilesConfig } from '../../configuration'; +import { GitUri } from '../../gitService'; +import { Arrays, Objects } from '../../system'; import { Explorer, ExplorerNode, ResourceType } from './explorerNode'; -import { GitUri } from '../gitService'; export interface IFileExplorerNode extends ExplorerNode { folderName: string; diff --git a/src/views/historyNode.ts b/src/views/nodes/historyNode.ts similarity index 91% rename from src/views/historyNode.ts rename to src/views/nodes/historyNode.ts index 110a916..b33e192 100644 --- a/src/views/historyNode.ts +++ b/src/views/nodes/historyNode.ts @@ -1,9 +1,9 @@ 'use strict'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { Container } from '../container'; +import { Container } from '../../container'; +import { GitUri, Repository } from '../../gitService'; import { Explorer, ExplorerNode, ResourceType } from './explorerNode'; import { FileHistoryNode } from './fileHistoryNode'; -import { GitUri, Repository } from '../gitService'; export class HistoryNode extends ExplorerNode { constructor( diff --git a/src/views/remoteNode.ts b/src/views/nodes/remoteNode.ts similarity index 92% rename from src/views/remoteNode.ts rename to src/views/nodes/remoteNode.ts index 18b5dcd..aea4eee 100644 --- a/src/views/remoteNode.ts +++ b/src/views/nodes/remoteNode.ts @@ -1,14 +1,14 @@ 'use strict'; -import { Arrays, Iterables } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { BranchOrTagFolderNode } from './branchOrTagFolderNode'; +import { ExplorerBranchesLayout } from '../../configuration'; +import { GlyphChars } from '../../constants'; +import { Container } from '../../container'; +import { GitRemote, GitRemoteType, GitUri, Repository } from '../../gitService'; +import { Arrays, Iterables } from '../../system'; +import { GitExplorer } from '../gitExplorer'; import { BranchNode } from './branchNode'; -import { ExplorerBranchesLayout } from '../configuration'; -import { GlyphChars } from '../constants'; +import { BranchOrTagFolderNode } from './branchOrTagFolderNode'; import { ExplorerNode, ResourceType } from './explorerNode'; -import { GitExplorer } from './gitExplorer'; -import { GitRemote, GitRemoteType, GitUri, Repository } from '../gitService'; -import { Container } from '../container'; export class RemoteNode extends ExplorerNode { constructor( diff --git a/src/views/remotesNode.ts b/src/views/nodes/remotesNode.ts similarity index 87% rename from src/views/remotesNode.ts rename to src/views/nodes/remotesNode.ts index bbb1566..fc27945 100644 --- a/src/views/remotesNode.ts +++ b/src/views/nodes/remotesNode.ts @@ -1,10 +1,10 @@ 'use strict'; -import { Iterables } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { Container } from '../container'; +import { Container } from '../../container'; +import { GitUri, Repository } from '../../gitService'; +import { Iterables } from '../../system'; +import { GitExplorer } from '../gitExplorer'; import { ExplorerNode, MessageNode, ResourceType } from './explorerNode'; -import { GitExplorer } from './gitExplorer'; -import { GitUri, Repository } from '../gitService'; import { RemoteNode } from './remoteNode'; export class RemotesNode extends ExplorerNode { diff --git a/src/views/repositoriesNode.ts b/src/views/nodes/repositoriesNode.ts similarity index 92% rename from src/views/repositoriesNode.ts rename to src/views/nodes/repositoriesNode.ts index 9649c2c..3ba4938 100644 --- a/src/views/repositoriesNode.ts +++ b/src/views/nodes/repositoriesNode.ts @@ -1,9 +1,9 @@ 'use strict'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { GitUri, Repository } from '../../gitService'; +import { GitExplorer } from '../gitExplorer'; import { ActiveRepositoryNode } from './activeRepositoryNode'; import { ExplorerNode, ResourceType } from './explorerNode'; -import { GitExplorer } from './gitExplorer'; -import { GitUri, Repository } from '../gitService'; import { RepositoryNode } from './repositoryNode'; export class RepositoriesNode extends ExplorerNode { diff --git a/src/views/repositoryNode.ts b/src/views/nodes/repositoryNode.ts similarity index 95% rename from src/views/repositoryNode.ts rename to src/views/nodes/repositoryNode.ts index a5863ac..8b4ebaf 100644 --- a/src/views/repositoryNode.ts +++ b/src/views/nodes/repositoryNode.ts @@ -1,15 +1,15 @@ 'use strict'; -import { Strings } from '../system'; import { Disposable, TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { GlyphChars } from '../../constants'; +import { GitUri, Repository, RepositoryChange, RepositoryChangeEvent } from '../../gitService'; +import { Logger } from '../../logger'; +import { Strings } from '../../system'; +import { GitExplorer } from '../gitExplorer'; import { BranchesNode } from './branchesNode'; -import { GlyphChars } from '../constants'; import { ExplorerNode, ResourceType } from './explorerNode'; -import { GitExplorer } from './gitExplorer'; -import { GitUri, Repository, RepositoryChange, RepositoryChangeEvent } from '../gitService'; -import { Logger } from '../logger'; import { RemotesNode } from './remotesNode'; -import { StatusNode } from './statusNode'; import { StashesNode } from './stashesNode'; +import { StatusNode } from './statusNode'; import { TagsNode } from './tagsNode'; export class RepositoryNode extends ExplorerNode { diff --git a/src/views/stashFileNode.ts b/src/views/nodes/stashFileNode.ts similarity index 90% rename from src/views/stashFileNode.ts rename to src/views/nodes/stashFileNode.ts index fffb105..7365318 100644 --- a/src/views/stashFileNode.ts +++ b/src/views/nodes/stashFileNode.ts @@ -1,7 +1,7 @@ 'use strict'; +import { GitLogCommit, IGitStatusFile } from '../../gitService'; import { CommitFileNode, CommitFileNodeDisplayAs } from './commitFileNode'; import { Explorer, ResourceType } from './explorerNode'; -import { GitLogCommit, IGitStatusFile } from '../gitService'; export class StashFileNode extends CommitFileNode { constructor(status: IGitStatusFile, commit: GitLogCommit, explorer: Explorer) { diff --git a/src/views/stashNode.ts b/src/views/nodes/stashNode.ts similarity index 95% rename from src/views/stashNode.ts rename to src/views/nodes/stashNode.ts index 088bf7b..376ef00 100644 --- a/src/views/stashNode.ts +++ b/src/views/nodes/stashNode.ts @@ -1,9 +1,9 @@ 'use strict'; -import { Iterables } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { Container } from '../container'; +import { Container } from '../../container'; +import { CommitFormatter, GitStashCommit, ICommitFormatOptions } from '../../gitService'; +import { Iterables } from '../../system'; import { Explorer, ExplorerNode, ExplorerRefNode, ResourceType } from './explorerNode'; -import { CommitFormatter, GitStashCommit, ICommitFormatOptions } from '../gitService'; import { StashFileNode } from './stashFileNode'; export class StashNode extends ExplorerRefNode { diff --git a/src/views/stashesNode.ts b/src/views/nodes/stashesNode.ts similarity index 89% rename from src/views/stashesNode.ts rename to src/views/nodes/stashesNode.ts index d057d59..67b71fc 100644 --- a/src/views/stashesNode.ts +++ b/src/views/nodes/stashesNode.ts @@ -1,9 +1,9 @@ 'use strict'; -import { Iterables } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { Container } from '../container'; +import { Container } from '../../container'; +import { GitUri, Repository } from '../../gitService'; +import { Iterables } from '../../system'; import { Explorer, ExplorerNode, MessageNode, ResourceType } from './explorerNode'; -import { GitUri, Repository } from '../gitService'; import { StashNode } from './stashNode'; export class StashesNode extends ExplorerNode { diff --git a/src/views/statusFileCommitsNode.ts b/src/views/nodes/statusFileCommitsNode.ts similarity index 97% rename from src/views/statusFileCommitsNode.ts rename to src/views/nodes/statusFileCommitsNode.ts index c5882bd..9a06b52 100644 --- a/src/views/statusFileCommitsNode.ts +++ b/src/views/nodes/statusFileCommitsNode.ts @@ -1,9 +1,8 @@ 'use strict'; +import * as path from 'path'; import { Command, TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { Commands, DiffWithPreviousCommandArgs } from '../commands'; -import { CommitFileNode, CommitFileNodeDisplayAs } from './commitFileNode'; -import { Container } from '../container'; -import { Explorer, ExplorerNode, ResourceType } from './explorerNode'; +import { Commands, DiffWithPreviousCommandArgs } from '../../commands'; +import { Container } from '../../container'; import { getGitStatusIcon, GitLogCommit, @@ -12,8 +11,9 @@ import { IGitStatusFileWithCommit, IStatusFormatOptions, StatusFileFormatter -} from '../gitService'; -import * as path from 'path'; +} from '../../gitService'; +import { CommitFileNode, CommitFileNodeDisplayAs } from './commitFileNode'; +import { Explorer, ExplorerNode, ResourceType } from './explorerNode'; export class StatusFileCommitsNode extends ExplorerNode { constructor( diff --git a/src/views/statusFileNode.ts b/src/views/nodes/statusFileNode.ts similarity index 95% rename from src/views/statusFileNode.ts rename to src/views/nodes/statusFileNode.ts index ae339bc..3a4b95a 100644 --- a/src/views/statusFileNode.ts +++ b/src/views/nodes/statusFileNode.ts @@ -1,10 +1,10 @@ 'use strict'; +import * as path from 'path'; import { Command, TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { Commands, DiffWithCommandArgs } from '../commands'; -import { Container } from '../container'; +import { Commands, DiffWithCommandArgs } from '../../commands'; +import { Container } from '../../container'; +import { getGitStatusIcon, GitStatusFile, GitUri, IStatusFormatOptions, StatusFileFormatter } from '../../gitService'; import { Explorer, ExplorerNode, ResourceType } from './explorerNode'; -import { getGitStatusIcon, GitStatusFile, GitUri, IStatusFormatOptions, StatusFileFormatter } from '../gitService'; -import * as path from 'path'; export class StatusFileNode extends ExplorerNode { constructor( diff --git a/src/views/statusFilesNode.ts b/src/views/nodes/statusFilesNode.ts similarity index 97% rename from src/views/statusFilesNode.ts rename to src/views/nodes/statusFilesNode.ts index 3eb6e96..44493c5 100644 --- a/src/views/statusFilesNode.ts +++ b/src/views/nodes/statusFilesNode.ts @@ -1,11 +1,8 @@ 'use strict'; -import { Arrays, Iterables, Objects, Strings } from '../system'; +import * as path from 'path'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { ExplorerFilesLayout } from '../configuration'; -import { Container } from '../container'; -import { ExplorerNode, ResourceType, ShowAllNode } from './explorerNode'; -import { FolderNode, IFileExplorerNode } from './folderNode'; -import { GitExplorer } from './gitExplorer'; +import { ExplorerFilesLayout } from '../../configuration'; +import { Container } from '../../container'; import { GitCommitType, GitLog, @@ -14,9 +11,12 @@ import { GitStatus, GitUri, IGitStatusFileWithCommit -} from '../gitService'; +} from '../../gitService'; +import { Arrays, Iterables, Objects, Strings } from '../../system'; +import { GitExplorer } from '../gitExplorer'; +import { ExplorerNode, ResourceType, ShowAllNode } from './explorerNode'; +import { FolderNode, IFileExplorerNode } from './folderNode'; import { StatusFileCommitsNode } from './statusFileCommitsNode'; -import * as path from 'path'; export class StatusFilesNode extends ExplorerNode { readonly repoPath: string; diff --git a/src/views/statusFilesResultsNode.ts b/src/views/nodes/statusFilesResultsNode.ts similarity index 92% rename from src/views/statusFilesResultsNode.ts rename to src/views/nodes/statusFilesResultsNode.ts index 98f006e..fb03605 100644 --- a/src/views/statusFilesResultsNode.ts +++ b/src/views/nodes/statusFilesResultsNode.ts @@ -1,13 +1,13 @@ 'use strict'; -import { Arrays, Iterables, Strings } from '../system'; +import * as path from 'path'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; -import { ExplorerFilesLayout } from '../configuration'; -import { Container } from '../container'; +import { ExplorerFilesLayout } from '../../configuration'; +import { Container } from '../../container'; +import { GitStatusFile, GitUri } from '../../gitService'; +import { Arrays, Iterables, Strings } from '../../system'; import { Explorer, ExplorerNode, ResourceType } from './explorerNode'; import { FolderNode, IFileExplorerNode } from './folderNode'; -import { GitStatusFile, GitUri } from '../gitService'; import { StatusFileNode } from './statusFileNode'; -import * as path from 'path'; export class StatusFilesResultsNode extends ExplorerNode { readonly supportsPaging: boolean = true; diff --git a/src/views/statusNode.ts b/src/views/nodes/statusNode.ts similarity index 97% rename from src/views/statusNode.ts rename to src/views/nodes/statusNode.ts index 9bec8ef..26c58bb 100644 --- a/src/views/statusNode.ts +++ b/src/views/nodes/statusNode.ts @@ -1,10 +1,10 @@ import { Disposable, TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { GlyphChars } from '../../constants'; +import { Container } from '../../container'; +import { GitBranch, GitUri, Repository, RepositoryFileSystemChangeEvent } from '../../gitService'; +import { GitExplorer } from '../gitExplorer'; import { BranchNode } from './branchNode'; -import { GlyphChars } from '../constants'; -import { Container } from '../container'; import { ExplorerNode, ResourceType } from './explorerNode'; -import { GitExplorer } from './gitExplorer'; -import { GitBranch, GitUri, Repository, RepositoryFileSystemChangeEvent } from '../gitService'; import { StatusFilesNode } from './statusFilesNode'; import { StatusUpstreamNode } from './statusUpstreamNode'; diff --git a/src/views/statusUpstreamNode.ts b/src/views/nodes/statusUpstreamNode.ts similarity index 95% rename from src/views/statusUpstreamNode.ts rename to src/views/nodes/statusUpstreamNode.ts index c8d8b4f..fa88201 100644 --- a/src/views/statusUpstreamNode.ts +++ b/src/views/nodes/statusUpstreamNode.ts @@ -1,10 +1,10 @@ 'use strict'; -import { Iterables } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { Container } from '../../container'; +import { GitStatus, GitUri } from '../../gitService'; +import { Iterables } from '../../system'; import { CommitNode } from './commitNode'; -import { Container } from '../container'; import { Explorer, ExplorerNode, ResourceType } from './explorerNode'; -import { GitStatus, GitUri } from '../gitService'; export class StatusUpstreamNode extends ExplorerNode { constructor( diff --git a/src/views/tagNode.ts b/src/views/nodes/tagNode.ts similarity index 86% rename from src/views/tagNode.ts rename to src/views/nodes/tagNode.ts index 907fe48..2c7e69f 100644 --- a/src/views/tagNode.ts +++ b/src/views/nodes/tagNode.ts @@ -1,12 +1,12 @@ 'use strict'; -import { Iterables } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { ExplorerBranchesLayout } from '../../configuration'; +import { Container } from '../../container'; +import { GitTag, GitUri } from '../../gitService'; +import { Iterables } from '../../system'; +import { GitExplorer } from '../gitExplorer'; import { CommitNode } from './commitNode'; -import { ExplorerBranchesLayout } from '../configuration'; -import { Container } from '../container'; import { ExplorerNode, ExplorerRefNode, MessageNode, ResourceType, ShowAllNode } from './explorerNode'; -import { GitExplorer } from './gitExplorer'; -import { GitTag, GitUri } from '../gitService'; export class TagNode extends ExplorerRefNode { readonly supportsPaging: boolean = true; diff --git a/src/views/tagsNode.ts b/src/views/nodes/tagsNode.ts similarity index 88% rename from src/views/tagsNode.ts rename to src/views/nodes/tagsNode.ts index a050715..aafc849 100644 --- a/src/views/tagsNode.ts +++ b/src/views/nodes/tagsNode.ts @@ -1,12 +1,12 @@ 'use strict'; -import { Arrays } from '../system'; import { TreeItem, TreeItemCollapsibleState } from 'vscode'; +import { ExplorerBranchesLayout } from '../../configuration'; +import { Container } from '../../container'; +import { GitUri, Repository } from '../../gitService'; +import { Arrays } from '../../system'; +import { GitExplorer } from '../gitExplorer'; import { BranchOrTagFolderNode } from './branchOrTagFolderNode'; -import { ExplorerBranchesLayout } from '../configuration'; -import { Container } from '../container'; import { ExplorerNode, MessageNode, ResourceType } from './explorerNode'; -import { GitExplorer } from './gitExplorer'; -import { GitUri, Repository } from '../gitService'; import { TagNode } from './tagNode'; export class TagsNode extends ExplorerNode { diff --git a/src/views/resultsExplorer.ts b/src/views/resultsExplorer.ts index dabe788..ffb59d4 100644 --- a/src/views/resultsExplorer.ts +++ b/src/views/resultsExplorer.ts @@ -1,5 +1,4 @@ 'use strict'; -import { Functions, Strings } from '../system'; import { commands, ConfigurationChangeEvent, @@ -15,6 +14,9 @@ import { import { configuration, ExplorerFilesLayout, IExplorersConfig, IResultsExplorerConfig } from '../configuration'; import { CommandContext, GlyphChars, setCommandContext, WorkspaceState } from '../constants'; import { Container } from '../container'; +import { GitLog, GitLogCommit } from '../gitService'; +import { Logger } from '../logger'; +import { Functions, Strings } from '../system'; import { RefreshNodeCommandArgs } from './explorerCommands'; import { CommitResultsNode, @@ -25,12 +27,10 @@ import { NamedRef, RefreshReason, ResourceType -} from './explorerNodes'; -import { GitLog, GitLogCommit } from '../gitService'; -import { Logger } from '../logger'; -// import { Messages } from '../messages'; +} from './nodes'; +// import { Messages } from './messages'; -export * from './explorerNodes'; +export * from './nodes'; export class ResultsExplorer extends Disposable implements TreeDataProvider { private _disposable: Disposable | undefined; diff --git a/src/webviews/webviewEditor.ts b/src/webviews/webviewEditor.ts index c375cee..760149a 100644 --- a/src/webviews/webviewEditor.ts +++ b/src/webviews/webviewEditor.ts @@ -1,4 +1,5 @@ 'use strict'; +import * as fs from 'fs'; import { ConfigurationChangeEvent, ConfigurationTarget, @@ -12,9 +13,8 @@ import { } from 'vscode'; import { configuration, IConfig } from '../configuration'; import { Container } from '../container'; -import { Message, SettingsChangedMessage } from '../ui/ipc'; import { Logger } from '../logger'; -import * as fs from 'fs'; +import { Message, SettingsChangedMessage } from '../ui/ipc'; export abstract class WebviewEditor extends Disposable { private _disposable: Disposable | undefined; diff --git a/tsconfig.json b/tsconfig.json index 3ed729b..3c419e4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,5 +16,5 @@ "strict": true, "target": "es2017" }, - "exclude": ["node_modules", "rules", "test", ".vscode-test", "src/ui"] + "exclude": ["node_modules", "test", "src/ui"] } diff --git a/tslint.json b/tslint.json index 541f08f..00f211e 100644 --- a/tslint.json +++ b/tslint.json @@ -34,7 +34,7 @@ "ordered-imports": [ true, { - "import-sources-order": "any", + "import-sources-order": "case-insensitive", "named-imports-order": "case-insensitive" } ],