Skip to content

Commit

Permalink
Renames showMore to loadMore
Browse files Browse the repository at this point in the history
Renames showAll to loadAll
  • Loading branch information
eamodio committed Sep 11, 2020
1 parent bef246c commit 4e32a62
Show file tree
Hide file tree
Showing 17 changed files with 74 additions and 74 deletions.
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3293,12 +3293,12 @@
"icon": "$(refresh)"
},
{
"command": "gitlens.views.showMoreChildren",
"command": "gitlens.views.loadMoreChildren",
"title": "Load More",
"category": "GitLens"
},
{
"command": "gitlens.views.showAllChildren",
"command": "gitlens.views.loadAllChildren",
"title": "Load All",
"category": "GitLens",
"icon": {
Expand Down Expand Up @@ -4564,11 +4564,11 @@
"when": "false"
},
{
"command": "gitlens.views.showMoreChildren",
"command": "gitlens.views.loadMoreChildren",
"when": "false"
},
{
"command": "gitlens.views.showAllChildren",
"command": "gitlens.views.loadAllChildren",
"when": "false"
},
{
Expand Down Expand Up @@ -6755,12 +6755,12 @@
"group": "9_gitlens@99"
},
{
"command": "gitlens.views.showAllChildren",
"command": "gitlens.views.loadAllChildren",
"when": "viewItem =~ /gitlens:pager\\b/",
"group": "inline@1"
},
{
"command": "gitlens.views.showAllChildren",
"command": "gitlens.views.loadAllChildren",
"when": "viewItem =~ /gitlens:pager\\b/",
"group": "1_gitlens_actions@1"
}
Expand Down
2 changes: 1 addition & 1 deletion src/views/branchesView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ export class BranchesView extends ViewBase<BranchesViewNode, BranchesViewConfig>
}

if (n instanceof BranchNode && branches.includes(n.branch.name)) {
await n.showMore({ until: commit.ref });
await n.loadMore({ until: commit.ref });
return true;
}

Expand Down
4 changes: 2 additions & 2 deletions src/views/commitsView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ export class CommitsView extends ViewBase<CommitsViewNode, CommitsViewConfig> {
if (node instanceof CommitsRepositoryNode) {
node = await node.getSplattedChild?.();
if (node instanceof BranchNode) {
await node.showMore({ until: commit.ref });
await node.loadMore({ until: commit.ref });
}
}

Expand All @@ -318,7 +318,7 @@ export class CommitsView extends ViewBase<CommitsViewNode, CommitsViewConfig> {
if (n.id.startsWith(repoNodeId)) {
const node = await n.getSplattedChild?.();
if (node instanceof BranchNode) {
await node.showMore({ until: commit.ref });
await node.loadMore({ until: commit.ref });
return true;
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/views/nodes/branchNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { BranchesView } from '../branchesView';
import { BranchTrackingStatusNode } from './branchTrackingStatusNode';
import { CommitNode } from './commitNode';
import { CommitsView } from '../commitsView';
import { MessageNode, ShowMoreNode } from './common';
import { LoadMoreNode, MessageNode } from './common';
import { ViewBranchesLayout } from '../../configuration';
import { GlyphChars } from '../../constants';
import { Container } from '../../container';
Expand Down Expand Up @@ -151,7 +151,7 @@ export class BranchNode
);

if (log.hasMore) {
children.push(new ShowMoreNode(this.view, this, children[children.length - 1]));
children.push(new LoadMoreNode(this.view, this, children[children.length - 1]));
}

this._children = children;
Expand Down Expand Up @@ -297,7 +297,7 @@ export class BranchNode
}

limit: number | undefined = this.view.getNodeLastKnownLimit(this);
async showMore(limit?: number | { until?: any }) {
async loadMore(limit?: number | { until?: any }) {
let log = await this.getLog();
if (log == null || !log.hasMore) return;

Expand Down
6 changes: 3 additions & 3 deletions src/views/nodes/branchTrackingStatusNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { BranchNode } from './branchNode';
import { BranchTrackingStatusFilesNode } from './branchTrackingStatusFilesNode';
import { CommitNode } from './commitNode';
import { ShowMoreNode } from './common';
import { LoadMoreNode } from './common';
import { Container } from '../../container';
import { GitBranch, GitLog, GitRevision, GitTrackingState } from '../../git/git';
import { GitUri } from '../../git/gitUri';
Expand Down Expand Up @@ -94,7 +94,7 @@ export class BranchTrackingStatusNode extends ViewNode<ViewsWithFiles> implement
}

if (log.hasMore) {
children.push(new ShowMoreNode(this.view, this, children[children.length - 1]));
children.push(new LoadMoreNode(this.view, this, children[children.length - 1]));
}

if (!this.isReposView && this.status.upstream && this.upstreamType === 'ahead' && this.status.state.ahead > 0) {
Expand Down Expand Up @@ -232,7 +232,7 @@ export class BranchTrackingStatusNode extends ViewNode<ViewsWithFiles> implement
}

limit: number | undefined = this.view.getNodeLastKnownLimit(this);
async showMore(limit?: number | { until?: any }) {
async loadMore(limit?: number | { until?: any }) {
let log = await this.getLog();
if (log == null || !log.hasMore) return;

Expand Down
24 changes: 12 additions & 12 deletions src/views/nodes/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,22 +140,22 @@ export abstract class PagerNode extends ViewNode {
view: View,
parent: ViewNode & PageableViewNode,
protected readonly message: string,
private readonly _previousNode?: ViewNode,
private readonly _pageSize: number = Container.config.views.pageItemLimit,
protected readonly previousNode?: ViewNode,
protected readonly pageSize: number = Container.config.views.pageItemLimit,
) {
super(unknownGitUri, view, parent);
}

showMore() {
return this.view.showMoreNodeChildren(
this.parent! as ViewNode & PageableViewNode,
this._pageSize,
this._previousNode,
);
loadAll() {
return this.view.loadMoreNodeChildren(this.parent! as ViewNode & PageableViewNode, 0, this.previousNode);
}

showAll() {
return this.view.showMoreNodeChildren(this.parent! as ViewNode & PageableViewNode, 0, this._previousNode);
loadMore() {
return this.view.loadMoreNodeChildren(
this.parent! as ViewNode & PageableViewNode,
this.pageSize,
this.previousNode,
);
}

getChildren(): ViewNode[] | Promise<ViewNode[]> {
Expand All @@ -172,13 +172,13 @@ export abstract class PagerNode extends ViewNode {
getCommand(): Command | undefined {
return {
title: 'Load more',
command: 'gitlens.views.showMoreChildren',
command: 'gitlens.views.loadMoreChildren',
arguments: [this],
};
}
}

export class ShowMoreNode extends PagerNode {
export class LoadMoreNode extends PagerNode {
constructor(view: View, parent: ViewNode & PageableViewNode, previousNode: ViewNode, pageSize?: number) {
super(
view,
Expand Down
6 changes: 3 additions & 3 deletions src/views/nodes/contributorNode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { CommitNode } from './commitNode';
import { MessageNode, ShowMoreNode } from './common';
import { LoadMoreNode, MessageNode } from './common';
import { GlyphChars } from '../../constants';
import { Container } from '../../container';
import { ContributorsView } from '../contributorsView';
Expand Down Expand Up @@ -54,7 +54,7 @@ export class ContributorNode extends ViewNode<ContributorsView | RepositoriesVie
];

if (log.hasMore) {
children.push(new ShowMoreNode(this.view, this, children[children.length - 1]));
children.push(new LoadMoreNode(this.view, this, children[children.length - 1]));
}
return children;
}
Expand Down Expand Up @@ -111,7 +111,7 @@ export class ContributorNode extends ViewNode<ContributorsView | RepositoriesVie
}

limit: number | undefined = this.view.getNodeLastKnownLimit(this);
async showMore(limit?: number | { until?: any }) {
async loadMore(limit?: number | { until?: any }) {
let log = await this.getLog();
if (log == null || !log.hasMore) return;

Expand Down
6 changes: 3 additions & 3 deletions src/views/nodes/fileHistoryNode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
import { Disposable, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { CommitFileNode } from './commitFileNode';
import { MessageNode, ShowMoreNode } from './common';
import { LoadMoreNode, MessageNode } from './common';
import { Container } from '../../container';
import { FileHistoryTrackerNode } from './fileHistoryTrackerNode';
import {
Expand Down Expand Up @@ -82,7 +82,7 @@ export class FileHistoryNode extends SubscribeableViewNode implements PageableVi
);

if (log.hasMore) {
children.push(new ShowMoreNode(this.view, this, children[children.length - 1]));
children.push(new LoadMoreNode(this.view, this, children[children.length - 1]));
}
}

Expand Down Expand Up @@ -174,7 +174,7 @@ export class FileHistoryNode extends SubscribeableViewNode implements PageableVi
}

limit: number | undefined = this.view.getNodeLastKnownLimit(this);
async showMore(limit?: number | { until?: any }) {
async loadMore(limit?: number | { until?: any }) {
let log = await this.getLog();
if (log == null || !log.hasMore) return;

Expand Down
6 changes: 3 additions & 3 deletions src/views/nodes/lineHistoryNode.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
'use strict';
import { Disposable, Selection, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { CommitFileNode } from './commitFileNode';
import { MessageNode, ShowMoreNode } from './common';
import { LoadMoreNode, MessageNode } from './common';
import { Container } from '../../container';
import {
GitCommitType,
Expand Down Expand Up @@ -203,7 +203,7 @@ export class LineHistoryNode extends SubscribeableViewNode implements PageableVi
);

if (log.hasMore) {
children.push(new ShowMoreNode(this.view, this, children[children.length - 1]));
children.push(new LoadMoreNode(this.view, this, children[children.length - 1]));
}
}

Expand Down Expand Up @@ -303,7 +303,7 @@ export class LineHistoryNode extends SubscribeableViewNode implements PageableVi
}

limit: number | undefined = this.view.getNodeLastKnownLimit(this);
async showMore(limit?: number | { until?: any }) {
async loadMore(limit?: number | { until?: any }) {
let log = await this.getLog();
if (log == null || !log.hasMore) return;

Expand Down
12 changes: 6 additions & 6 deletions src/views/nodes/reflogNode.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
'use strict';
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { LoadMoreNode, MessageNode } from './common';
import { Container } from '../../container';
import { GitReflog, Repository } from '../../git/git';
import { GitUri } from '../../git/gitUri';
import { ContextValues, PageableViewNode, ViewNode } from './viewNode';
import { RepositoriesView } from '../repositoriesView';
import { ReflogRecordNode } from './reflogRecordNode';
import { debug, gate } from '../../system';
import { MessageNode, ShowMoreNode } from './common';
import { RepositoriesView } from '../repositoriesView';
import { RepositoryNode } from './repositoryNode';
import { debug, gate } from '../../system';
import { ContextValues, PageableViewNode, ViewNode } from './viewNode';

export class ReflogNode extends ViewNode<RepositoriesView> implements PageableViewNode {
static key = ':reflog';
Expand Down Expand Up @@ -38,7 +38,7 @@ export class ReflogNode extends ViewNode<RepositoriesView> implements PageableVi
children.push(...reflog.records.map(r => new ReflogRecordNode(this.view, this, r)));

if (reflog.hasMore) {
children.push(new ShowMoreNode(this.view, this, children[children.length - 1]));
children.push(new LoadMoreNode(this.view, this, children[children.length - 1]));
}

this._children = children;
Expand Down Expand Up @@ -85,7 +85,7 @@ export class ReflogNode extends ViewNode<RepositoriesView> implements PageableVi
}

limit: number | undefined = this.view.getNodeLastKnownLimit(this);
async showMore(limit?: number) {
async loadMore(limit?: number) {
let reflog = await this.getReflog();
if (reflog === undefined || !reflog.hasMore) return;

Expand Down
12 changes: 6 additions & 6 deletions src/views/nodes/reflogRecordNode.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
'use strict';
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { CommitNode } from './commitNode';
import { LoadMoreNode, MessageNode } from './common';
import { GlyphChars } from '../../constants';
import { Container } from '../../container';
import { GitLog, GitReflogRecord } from '../../git/git';
import { GitUri } from '../../git/gitUri';
import { RepositoryNode } from './repositoryNode';
import { debug, gate, Iterables } from '../../system';
import { ViewsWithFiles } from '../viewBase';
import { CommitNode } from './commitNode';
import { MessageNode, ShowMoreNode } from './common';
import { ContextValues, PageableViewNode, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';

export class ReflogRecordNode extends ViewNode<ViewsWithFiles> implements PageableViewNode {
static key = ':reflog-record';
Expand Down Expand Up @@ -45,12 +45,12 @@ export class ReflogRecordNode extends ViewNode<ViewsWithFiles> implements Pageab
const log = await this.getLog();
if (log === undefined) return [new MessageNode(this.view, this, 'No commits could be found.')];

const children: (CommitNode | ShowMoreNode)[] = [
const children: (CommitNode | LoadMoreNode)[] = [
...Iterables.map(log.commits.values(), c => new CommitNode(this.view, this, c)),
];

if (log.hasMore) {
children.push(new ShowMoreNode(this.view, this, children[children.length - 1]));
children.push(new LoadMoreNode(this.view, this, children[children.length - 1]));
}
return children;
}
Expand Down Expand Up @@ -104,7 +104,7 @@ export class ReflogRecordNode extends ViewNode<ViewsWithFiles> implements Pageab
}

limit: number | undefined = this.view.getNodeLastKnownLimit(this);
async showMore(limit?: number | { until?: any }) {
async loadMore(limit?: number | { until?: any }) {
let log = await this.getLog();
if (log === undefined || !log.hasMore) return;

Expand Down
10 changes: 5 additions & 5 deletions src/views/nodes/resultsCommitsNode.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
'use strict';
import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { CommitNode } from './commitNode';
import { LoadMoreNode } from './common';
import { Container } from '../../container';
import { GitLog } from '../../git/git';
import { GitUri } from '../../git/gitUri';
import { insertDateMarkers } from './helpers';
import { debug, gate, Iterables, Promises } from '../../system';
import { ViewsWithFiles } from '../viewBase';
import { CommitNode } from './commitNode';
import { ShowMoreNode } from './common';
import { insertDateMarkers } from './helpers';
import { ContextValues, PageableViewNode, ViewNode } from './viewNode';

export interface CommitsQueryResults {
Expand Down Expand Up @@ -59,7 +59,7 @@ export class ResultsCommitsNode extends ViewNode<ViewsWithFiles> implements Page
];

if (log.hasMore) {
children.push(new ShowMoreNode(this.view, this, children[children.length - 1]));
children.push(new LoadMoreNode(this.view, this, children[children.length - 1]));
}

return children;
Expand Down Expand Up @@ -128,7 +128,7 @@ export class ResultsCommitsNode extends ViewNode<ViewsWithFiles> implements Page
}

limit: number | undefined = this.view.getNodeLastKnownLimit(this);
async showMore(limit?: number) {
async loadMore(limit?: number) {
const results = await this.getCommitsQueryResults();
if (results === undefined || !results.hasMore) return;

Expand Down

0 comments on commit 4e32a62

Please sign in to comment.