Преглед на файлове

Renames ResourceType to ContextValues

main
Eric Amodio преди 4 години
родител
ревизия
84e8d7e474
променени са 37 файла, в които са добавени 95 реда и са изтрити 93 реда
  1. +2
    -2
      src/views/nodes/branchNode.ts
  2. +2
    -2
      src/views/nodes/branchOrTagFolderNode.ts
  3. +4
    -4
      src/views/nodes/branchTrackingStatusNode.ts
  4. +2
    -2
      src/views/nodes/branchesNode.ts
  5. +10
    -10
      src/views/nodes/commitFileNode.ts
  6. +2
    -2
      src/views/nodes/commitNode.ts
  7. +4
    -4
      src/views/nodes/common.ts
  8. +2
    -2
      src/views/nodes/compareBranchNode.ts
  9. +2
    -2
      src/views/nodes/compareNode.ts
  10. +3
    -3
      src/views/nodes/comparePickerNode.ts
  11. +2
    -2
      src/views/nodes/compareResultsNode.ts
  12. +4
    -2
      src/views/nodes/contributorNode.ts
  13. +2
    -2
      src/views/nodes/contributorsNode.ts
  14. +2
    -2
      src/views/nodes/fileHistoryNode.ts
  15. +2
    -2
      src/views/nodes/fileHistoryTrackerNode.ts
  16. +2
    -2
      src/views/nodes/folderNode.ts
  17. +2
    -2
      src/views/nodes/lineHistoryNode.ts
  18. +2
    -2
      src/views/nodes/lineHistoryTrackerNode.ts
  19. +2
    -2
      src/views/nodes/reflogNode.ts
  20. +2
    -2
      src/views/nodes/reflogRecordNode.ts
  21. +4
    -4
      src/views/nodes/remoteNode.ts
  22. +2
    -2
      src/views/nodes/remotesNode.ts
  23. +2
    -2
      src/views/nodes/repositoriesNode.ts
  24. +2
    -2
      src/views/nodes/repositoryNode.ts
  25. +3
    -3
      src/views/nodes/resultsCommitsNode.ts
  26. +2
    -2
      src/views/nodes/resultsFileNode.ts
  27. +2
    -2
      src/views/nodes/resultsFilesNode.ts
  28. +2
    -2
      src/views/nodes/searchNode.ts
  29. +3
    -3
      src/views/nodes/searchResultsCommitsNode.ts
  30. +3
    -3
      src/views/nodes/stashFileNode.ts
  31. +2
    -2
      src/views/nodes/stashNode.ts
  32. +2
    -2
      src/views/nodes/stashesNode.ts
  33. +4
    -4
      src/views/nodes/statusFileNode.ts
  34. +2
    -2
      src/views/nodes/statusFilesNode.ts
  35. +2
    -2
      src/views/nodes/tagNode.ts
  36. +2
    -2
      src/views/nodes/tagsNode.ts
  37. +1
    -1
      src/views/nodes/viewNode.ts

+ 2
- 2
src/views/nodes/branchNode.ts Целия файл

@ -11,7 +11,7 @@ import { BranchTrackingStatusNode } from './branchTrackingStatusNode';
import { CommitNode } from './commitNode';
import { MessageNode, ShowMoreNode } from './common';
import { insertDateMarkers } from './helpers';
import { PageableViewNode, ResourceType, ViewNode, ViewRefNode } from './viewNode';
import { ContextValues, PageableViewNode, ViewNode, ViewRefNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
export class BranchNode extends ViewRefNode<RepositoriesView, GitBranchReference> implements PageableViewNode {
@ -117,7 +117,7 @@ export class BranchNode extends ViewRefNode
let tooltip = `${this.branch.getNameWithoutRemote()}${this.current ? ' (current)' : ''}`;
let iconSuffix = '';
let contextValue: string = ResourceType.Branch;
let contextValue: string = ContextValues.Branch;
if (this.current) {
contextValue += '+current';
}

+ 2
- 2
src/views/nodes/branchOrTagFolderNode.ts Целия файл

@ -5,7 +5,7 @@ import { Arrays } from '../../system';
import { View } from '../viewBase';
import { BranchNode } from './branchNode';
import { TagNode } from './tagNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
export class BranchOrTagFolderNode extends ViewNode {
@ -76,7 +76,7 @@ export class BranchOrTagFolderNode extends ViewNode {
this._expanded ? TreeItemCollapsibleState.Expanded : TreeItemCollapsibleState.Collapsed,
);
item.id = this.id;
item.contextValue = ResourceType.Folder;
item.contextValue = ContextValues.Folder;
item.iconPath = ThemeIcon.Folder;
item.tooltip = this.label;
return item;

+ 4
- 4
src/views/nodes/branchTrackingStatusNode.ts Целия файл

@ -8,7 +8,7 @@ import { ViewWithFiles } from '../viewBase';
import { CommitNode } from './commitNode';
import { ShowMoreNode } from './common';
import { insertDateMarkers } from './helpers';
import { PageableViewNode, ResourceType, ViewNode } from './viewNode';
import { ContextValues, PageableViewNode, ViewNode } from './viewNode';
import { BranchNode } from './branchNode';
export interface BranchTrackingStatus {
@ -106,11 +106,11 @@ export class BranchTrackingStatusNode extends ViewNode implements
const item = new TreeItem(label, TreeItemCollapsibleState.Collapsed);
item.id = this.id;
if (this._root) {
item.contextValue = ahead ? ResourceType.StatusAheadOfUpstream : ResourceType.StatusBehindUpstream;
item.contextValue = ahead ? ContextValues.StatusAheadOfUpstream : ContextValues.StatusBehindUpstream;
} else {
item.contextValue = ahead
? ResourceType.BranchStatusAheadOfUpstream
: ResourceType.BranchStatusBehindUpstream;
? ContextValues.BranchStatusAheadOfUpstream
: ContextValues.BranchStatusBehindUpstream;
}
item.iconPath = new ThemeIcon(ahead ? 'cloud-upload' : 'cloud-download');
item.tooltip = `${label}${ahead ? ' of ' : ' '}${this.status.upstream}`;

+ 2
- 2
src/views/nodes/branchesNode.ts Целия файл

@ -8,7 +8,7 @@ import { Arrays, debug, gate } from '../../system';
import { RepositoriesView } from '../repositoriesView';
import { BranchNode } from './branchNode';
import { BranchOrTagFolderNode } from './branchOrTagFolderNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
import { MessageNode } from './common';
@ -70,7 +70,7 @@ export class BranchesNode extends ViewNode {
async getTreeItem(): Promise<TreeItem> {
const item = new TreeItem('Branches', TreeItemCollapsibleState.Collapsed);
item.contextValue = ResourceType.Branches;
item.contextValue = ContextValues.Branches;
if (await this.repo.hasRemotes()) {
item.contextValue += '+remotes';
}

+ 10
- 10
src/views/nodes/commitFileNode.ts Целия файл

@ -7,7 +7,7 @@ import { Container } from '../../container';
import { CommitFormatter, GitFile, GitLogCommit, GitRevisionReference, StatusFileFormatter } from '../../git/git';
import { GitUri } from '../../git/gitUri';
import { View } from '../viewBase';
import { ResourceType, ViewNode, ViewRefFileNode } from './viewNode';
import { ContextValues, ViewNode, ViewRefFileNode } from './viewNode';
export class CommitFileNode extends ViewRefFileNode {
constructor(
@ -58,7 +58,7 @@ export class CommitFileNode extends ViewRefFileNode {
}
const item = new TreeItem(this.label, TreeItemCollapsibleState.None);
item.contextValue = this.resourceType;
item.contextValue = this.contextValye;
item.description = this.description;
item.tooltip = this.tooltip;
@ -82,6 +82,14 @@ export class CommitFileNode extends ViewRefFileNode {
return item;
}
protected get contextValye(): string {
if (!this.commit.isUncommitted) {
return `${ContextValues.File}+committed${this._options.inFileHistory ? '+history' : ''}`;
}
return this.commit.isUncommittedStaged ? `${ContextValues.File}+staged` : `${ContextValues.File}+unstaged`;
}
private _description: string | undefined;
get description() {
if (this._description === undefined) {
@ -130,14 +138,6 @@ export class CommitFileNode extends ViewRefFileNode {
this._tooltip = undefined;
}
protected get resourceType(): string {
if (!this.commit.isUncommitted) {
return `${ResourceType.File}+committed${this._options.inFileHistory ? '+history' : ''}`;
}
return this.commit.isUncommittedStaged ? `${ResourceType.File}+staged` : `${ResourceType.File}+unstaged`;
}
private _tooltip: string | undefined;
get tooltip() {
if (this._tooltip === undefined) {

+ 2
- 2
src/views/nodes/commitNode.ts Целия файл

@ -10,7 +10,7 @@ import { Arrays, Iterables, Strings } from '../../system';
import { ViewWithFiles } from '../viewBase';
import { CommitFileNode } from './commitFileNode';
import { FileNode, FolderNode } from './folderNode';
import { ResourceType, ViewNode, ViewRefNode } from './viewNode';
import { ContextValues, ViewNode, ViewRefNode } from './viewNode';
export class CommitNode extends ViewRefNode<ViewWithFiles, GitRevisionReference> {
constructor(
@ -67,7 +67,7 @@ export class CommitNode extends ViewRefNode
label,
this._options.expand ? TreeItemCollapsibleState.Expanded : TreeItemCollapsibleState.Collapsed,
);
item.contextValue = ResourceType.Commit;
item.contextValue = ContextValues.Commit;
if (this.branch?.current) {
item.contextValue += '+current';
}

+ 4
- 4
src/views/nodes/common.ts Целия файл

@ -2,7 +2,7 @@ import { Command, ThemeIcon, TreeItem, TreeItemCollapsibleState, Uri } from 'vsc
import { GlyphChars } from '../../constants';
import { Container } from '../../container';
import { View } from '../viewBase';
import { PageableViewNode, ResourceType, unknownGitUri, ViewNode } from './viewNode';
import { ContextValues, PageableViewNode, unknownGitUri, ViewNode } from './viewNode';
export class MessageNode extends ViewNode {
constructor(
@ -29,7 +29,7 @@ export class MessageNode extends ViewNode {
getTreeItem(): TreeItem | Promise<TreeItem> {
const item = new TreeItem(this._message, TreeItemCollapsibleState.None);
item.contextValue = ResourceType.Message;
item.contextValue = ContextValues.Message;
item.description = this._description;
item.tooltip = this._tooltip;
item.iconPath = this._iconPath;
@ -97,7 +97,7 @@ export class UpdateableMessageNode extends ViewNode {
getTreeItem(): TreeItem | Promise<TreeItem> {
const item = new TreeItem(this._message, TreeItemCollapsibleState.None);
item.id = this.id;
item.contextValue = ResourceType.Message;
item.contextValue = ContextValues.Message;
item.tooltip = this._tooltip;
item.iconPath = this._iconPath;
return item;
@ -164,7 +164,7 @@ export abstract class PagerNode extends ViewNode {
getTreeItem(): TreeItem | Promise<TreeItem> {
const item = new TreeItem(this.message, TreeItemCollapsibleState.None);
item.contextValue = ResourceType.Pager;
item.contextValue = ContextValues.Pager;
item.command = this.getCommand();
return item;
}

+ 2
- 2
src/views/nodes/compareBranchNode.ts Целия файл

@ -1,7 +1,7 @@
'use strict';
import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { BranchComparison, BranchComparisons, GlyphChars, WorkspaceState } from '../../constants';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
import { RepositoriesView } from '../repositoriesView';
import { GitBranch, GitRevision } from '../../git/git';
import { GitUri } from '../../git/gitUri';
@ -107,7 +107,7 @@ export class CompareBranchNode extends ViewNode {
command: 'gitlens.views.executeNodeCallback',
arguments: [() => this.compareWith()],
};
item.contextValue = `${ResourceType.CompareBranch}${this._compareWith === undefined ? '' : '+comparing'}+${
item.contextValue = `${ContextValues.CompareBranch}${this._compareWith === undefined ? '' : '+comparing'}+${
this.comparisonNotation === '..' ? 'twodot' : 'threedot'
}+${this.comparisonType}`;
item.description = description;

+ 2
- 2
src/views/nodes/compareNode.ts Целия файл

@ -8,7 +8,7 @@ import { debug, gate, Iterables, log, Promises } from '../../system';
import { CompareView } from '../compareView';
import { MessageNode } from './common';
import { ComparePickerNode } from './comparePickerNode';
import { ResourceType, unknownGitUri, ViewNode } from './viewNode';
import { ContextValues, unknownGitUri, ViewNode } from './viewNode';
interface RepoRef {
label: string;
@ -55,7 +55,7 @@ export class CompareNode extends ViewNode {
getTreeItem(): TreeItem {
const item = new TreeItem('Compare', TreeItemCollapsibleState.Expanded);
item.contextValue = ResourceType.Compare;
item.contextValue = ContextValues.Compare;
return item;
}

+ 3
- 3
src/views/nodes/comparePickerNode.ts Целия файл

@ -4,7 +4,7 @@ import { GlyphChars } from '../../constants';
import { Container } from '../../container';
import { CompareView } from '../compareView';
import { CompareNode } from './compareNode';
import { ResourceType, unknownGitUri, ViewNode } from './viewNode';
import { ContextValues, unknownGitUri, ViewNode } from './viewNode';
export class ComparePickerNode extends ViewNode<CompareView> {
constructor(view: CompareView, protected readonly parent: CompareNode) {
@ -33,7 +33,7 @@ export class ComparePickerNode extends ViewNode {
'Compare <branch, tag, or ref> with <branch, tag, or ref>',
TreeItemCollapsibleState.None,
);
item.contextValue = ResourceType.ComparePicker;
item.contextValue = ContextValues.ComparePicker;
item.description = description;
item.tooltip = `Click to select or enter a reference for compare${GlyphChars.Ellipsis}`;
item.command = {
@ -45,7 +45,7 @@ export class ComparePickerNode extends ViewNode {
`Compare ${selectedRef.label} with <branch, tag, or ref>`,
TreeItemCollapsibleState.None,
);
item.contextValue = ResourceType.ComparePickerWithRef;
item.contextValue = ContextValues.ComparePickerWithRef;
item.description = description;
item.tooltip = `Click to compare ${selectedRef.label} with${GlyphChars.Ellipsis}`;
item.command = {

+ 2
- 2
src/views/nodes/compareResultsNode.ts Целия файл

@ -8,7 +8,7 @@ import { debug, gate, log, Strings } from '../../system';
import { CompareView } from '../compareView';
import { CommitsQueryResults, ResultsCommitsNode } from './resultsCommitsNode';
import { FilesQueryResults, ResultsFilesNode } from './resultsFilesNode';
import { ResourceType, SubscribeableViewNode, ViewNode } from './viewNode';
import { ContextValues, SubscribeableViewNode, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
let instanceId = 0;
@ -80,7 +80,7 @@ export class CompareResultsNode extends SubscribeableViewNode {
}`,
this._state ?? TreeItemCollapsibleState.Collapsed,
);
item.contextValue = `${ResourceType.CompareResults}+${
item.contextValue = `${ContextValues.CompareResults}+${
this.comparisonNotation === '..' ? 'twodot' : 'threedot'
}`;
if (this._pinned) {

+ 4
- 2
src/views/nodes/contributorNode.ts Целия файл

@ -4,7 +4,7 @@ import { GitContributor, GitLog } from '../../git/git';
import { GitUri } from '../../git/gitUri';
import { debug, gate, Iterables, Strings } from '../../system';
import { RepositoriesView } from '../repositoriesView';
import { PageableViewNode, ResourceType, ViewNode } from './viewNode';
import { ContextValues, PageableViewNode, ViewNode } from './viewNode';
import { Container } from '../../container';
import { MessageNode, ShowMoreNode } from './common';
import { insertDateMarkers } from './helpers';
@ -66,7 +66,9 @@ export class ContributorNode extends ViewNode implements Pagea
TreeItemCollapsibleState.Collapsed,
);
item.id = this.id;
item.contextValue = this.contributor.current ? `${ResourceType.Contributor}+current` : ResourceType.Contributor;
item.contextValue = this.contributor.current
? `${ContextValues.Contributor}+current`
: ContextValues.Contributor;
item.description = `${
presence != null && presence.status !== 'offline'
? `${presence.statusText} ${GlyphChars.Space}${GlyphChars.Dot}${GlyphChars.Space} `

+ 2
- 2
src/views/nodes/contributorsNode.ts Целия файл

@ -5,7 +5,7 @@ import { GitUri } from '../../git/gitUri';
import { RepositoriesView } from '../repositoriesView';
import { MessageNode } from './common';
import { ContributorNode } from './contributorNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
import { Container } from '../../container';
import { RepositoryNode } from './repositoryNode';
import { debug, timeout } from '../../system';
@ -38,7 +38,7 @@ export class ContributorsNode extends ViewNode {
getTreeItem(): TreeItem {
const item = new TreeItem('Contributors', TreeItemCollapsibleState.Collapsed);
item.id = this.id;
item.contextValue = ResourceType.Contributors;
item.contextValue = ContextValues.Contributors;
item.iconPath = new ThemeIcon('organization');
return item;
}

+ 2
- 2
src/views/nodes/fileHistoryNode.ts Целия файл

@ -15,7 +15,7 @@ import { View } from '../viewBase';
import { CommitFileNode } from './commitFileNode';
import { MessageNode, ShowMoreNode } from './common';
import { insertDateMarkers } from './helpers';
import { PageableViewNode, ResourceType, SubscribeableViewNode, ViewNode } from './viewNode';
import { ContextValues, PageableViewNode, SubscribeableViewNode, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
export class FileHistoryNode extends SubscribeableViewNode implements PageableViewNode {
@ -90,7 +90,7 @@ export class FileHistoryNode extends SubscribeableViewNode implements PageableVi
}`,
TreeItemCollapsibleState.Expanded,
);
item.contextValue = ResourceType.FileHistory;
item.contextValue = ContextValues.FileHistory;
item.description = this.uri.directory;
item.tooltip = `History of ${this.uri.fileName}\n${this.uri.directory}/${
this.uri.sha == null ? '' : `\n\n${this.uri.sha}`

+ 2
- 2
src/views/nodes/fileHistoryTrackerNode.ts Целия файл

@ -10,7 +10,7 @@ import { GitCommitish, GitUri } from '../../git/gitUri';
import { Logger } from '../../logger';
import { ReferencePicker } from '../../quickpicks';
import { debug, Functions, gate, log } from '../../system';
import { ResourceType, SubscribeableViewNode, unknownGitUri, ViewNode } from './viewNode';
import { ContextValues, SubscribeableViewNode, unknownGitUri, ViewNode } from './viewNode';
export class FileHistoryTrackerNode extends SubscribeableViewNode<FileHistoryView> {
private _base: string | undefined;
@ -58,7 +58,7 @@ export class FileHistoryTrackerNode extends SubscribeableViewNode
getTreeItem(): TreeItem {
const item = new TreeItem('File History', TreeItemCollapsibleState.Expanded);
item.contextValue = ResourceType.ActiveFileHistory;
item.contextValue = ContextValues.ActiveFileHistory;
void this.ensureSubscription();

+ 2
- 2
src/views/nodes/folderNode.ts Целия файл

@ -4,7 +4,7 @@ import { ViewFilesLayout, ViewsFilesConfig } from '../../configuration';
import { GitUri } from '../../git/gitUri';
import { Arrays } from '../../system';
import { ViewWithFiles } from '../viewBase';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
export interface FileNode extends ViewNode {
folderName: string;
@ -84,7 +84,7 @@ export class FolderNode extends ViewNode {
getTreeItem(): TreeItem {
const item = new TreeItem(this.label, TreeItemCollapsibleState.Expanded);
item.contextValue = ResourceType.Folder;
item.contextValue = ContextValues.Folder;
if (this.containsWorkingFiles) {
item.contextValue += '+working';
}

+ 2
- 2
src/views/nodes/lineHistoryNode.ts Целия файл

@ -18,7 +18,7 @@ import { View } from '../viewBase';
import { CommitFileNode } from './commitFileNode';
import { MessageNode, ShowMoreNode } from './common';
import { insertDateMarkers } from './helpers';
import { PageableViewNode, ResourceType, SubscribeableViewNode, ViewNode } from './viewNode';
import { ContextValues, PageableViewNode, SubscribeableViewNode, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
export class LineHistoryNode extends SubscribeableViewNode implements PageableViewNode {
@ -214,7 +214,7 @@ export class LineHistoryNode extends SubscribeableViewNode implements PageableVi
}`,
TreeItemCollapsibleState.Expanded,
);
item.contextValue = ResourceType.LineHistory;
item.contextValue = ContextValues.LineHistory;
item.description = this.uri.directory;
item.tooltip = `History of ${this.uri.fileName}${lines}\n${this.uri.directory}/${
this.uri.sha == null ? '' : `\n\n${this.uri.sha}`

+ 2
- 2
src/views/nodes/lineHistoryTrackerNode.ts Целия файл

@ -12,7 +12,7 @@ import { Logger } from '../../logger';
import { ReferencePicker } from '../../quickpicks';
import { debug, Functions, gate, log } from '../../system';
import { LinesChangeEvent } from '../../trackers/gitLineTracker';
import { ResourceType, SubscribeableViewNode, unknownGitUri, ViewNode } from './viewNode';
import { ContextValues, SubscribeableViewNode, unknownGitUri, ViewNode } from './viewNode';
export class LineHistoryTrackerNode extends SubscribeableViewNode<LineHistoryView | FileHistoryView> {
private _base: string | undefined;
@ -64,7 +64,7 @@ export class LineHistoryTrackerNode extends SubscribeableViewNode
getTreeItem(): TreeItem {
const item = new TreeItem('Line History', TreeItemCollapsibleState.Expanded);
item.contextValue = ResourceType.ActiveLineHistory;
item.contextValue = ContextValues.ActiveLineHistory;
void this.ensureSubscription();

+ 2
- 2
src/views/nodes/reflogNode.ts Целия файл

@ -3,7 +3,7 @@ import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Container } from '../../container';
import { GitReflog, Repository } from '../../git/git';
import { GitUri } from '../../git/gitUri';
import { PageableViewNode, ResourceType, ViewNode } from './viewNode';
import { ContextValues, PageableViewNode, ViewNode } from './viewNode';
import { RepositoriesView } from '../repositoriesView';
import { ReflogRecordNode } from './reflogRecordNode';
import { debug, gate } from '../../system';
@ -49,7 +49,7 @@ export class ReflogNode extends ViewNode implements PageableVi
getTreeItem(): TreeItem {
const item = new TreeItem('Incoming Activity', TreeItemCollapsibleState.Collapsed);
item.id = this.id;
item.contextValue = ResourceType.Reflog;
item.contextValue = ContextValues.Reflog;
item.description = 'experimental';
item.iconPath = {
dark: Container.context.asAbsolutePath('images/dark/icon-activity.svg'),

+ 2
- 2
src/views/nodes/reflogRecordNode.ts Целия файл

@ -8,7 +8,7 @@ import { debug, gate, Iterables } from '../../system';
import { ViewWithFiles } from '../viewBase';
import { CommitNode } from './commitNode';
import { MessageNode, ShowMoreNode } from './common';
import { PageableViewNode, ResourceType, ViewNode } from './viewNode';
import { ContextValues, PageableViewNode, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
export class ReflogRecordNode extends ViewNode<ViewWithFiles> implements PageableViewNode {
@ -66,7 +66,7 @@ export class ReflogRecordNode extends ViewNode implements Pageabl
? ''
: `${this.record.HEAD} ${GlyphChars.Space}${GlyphChars.Dot}${GlyphChars.Space} `
}${this.record.formattedDate}`;
item.contextValue = ResourceType.ReflogRecord;
item.contextValue = ContextValues.ReflogRecord;
item.tooltip = `${this.record.HEAD.length === 0 ? '' : `${this.record.HEAD}\n`}${this.record.command}${
this.record.commandArgs ? ` ${this.record.commandArgs}` : ''
}${

+ 4
- 4
src/views/nodes/remoteNode.ts Целия файл

@ -9,7 +9,7 @@ import { Arrays, log } from '../../system';
import { RepositoriesView } from '../repositoriesView';
import { BranchNode } from './branchNode';
import { BranchOrTagFolderNode } from './branchOrTagFolderNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
import { MessageNode } from './common';
@ -118,12 +118,12 @@ export class RemoteNode extends ViewNode {
if (provider.hasApi()) {
const connected = provider.maybeConnected ?? (await provider.isConnected());
item.contextValue += `${ResourceType.Remote}${connected ? '+connected' : '+disconnected'}`;
item.contextValue += `${ContextValues.Remote}${connected ? '+connected' : '+disconnected'}`;
item.tooltip = `${this.remote.name} (${provider.name} ${GlyphChars.Dash} ${
connected ? 'connected' : 'not connected'
})\n${provider.displayPath}\n`;
} else {
item.contextValue = ResourceType.Remote;
item.contextValue = ContextValues.Remote;
item.tooltip = `${this.remote.name} (${provider.name})\n${provider.displayPath}\n`;
}
} else {
@ -132,7 +132,7 @@ export class RemoteNode extends ViewNode {
? `${this.remote.domain} ${GlyphChars.Space}${GlyphChars.Dot}${GlyphChars.Space} `
: ''
}${this.remote.path}`;
item.contextValue = ResourceType.Remote;
item.contextValue = ContextValues.Remote;
item.iconPath = {
dark: Container.context.asAbsolutePath('images/dark/icon-remote.svg'),
light: Container.context.asAbsolutePath('images/light/icon-remote.svg'),

+ 2
- 2
src/views/nodes/remotesNode.ts Целия файл

@ -6,7 +6,7 @@ import { GitUri } from '../../git/gitUri';
import { RepositoriesView } from '../repositoriesView';
import { MessageNode } from './common';
import { RemoteNode } from './remoteNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
export class RemotesNode extends ViewNode<RepositoriesView> {
@ -35,7 +35,7 @@ export class RemotesNode extends ViewNode {
getTreeItem(): TreeItem {
const item = new TreeItem('Remotes', TreeItemCollapsibleState.Collapsed);
item.id = this.id;
item.contextValue = ResourceType.Remotes;
item.contextValue = ContextValues.Remotes;
item.iconPath = {
dark: Container.context.asAbsolutePath('images/dark/icon-remote.svg'),

+ 2
- 2
src/views/nodes/repositoriesNode.ts Целия файл

@ -7,7 +7,7 @@ import { debug, Functions, gate } from '../../system';
import { RepositoriesView } from '../repositoriesView';
import { MessageNode } from './common';
import { RepositoryNode } from './repositoryNode';
import { ResourceType, SubscribeableViewNode, unknownGitUri, ViewNode } from './viewNode';
import { ContextValues, SubscribeableViewNode, unknownGitUri, ViewNode } from './viewNode';
export class RepositoriesNode extends SubscribeableViewNode<RepositoriesView> {
private _children: (RepositoryNode | MessageNode)[] | undefined;
@ -47,7 +47,7 @@ export class RepositoriesNode extends SubscribeableViewNode {
getTreeItem(): TreeItem {
const item = new TreeItem('Repositories', TreeItemCollapsibleState.Expanded);
item.contextValue = ResourceType.Repositories;
item.contextValue = ContextValues.Repositories;
void this.ensureSubscription();

+ 2
- 2
src/views/nodes/repositoryNode.ts Целия файл

@ -25,7 +25,7 @@ import { RemotesNode } from './remotesNode';
import { StashesNode } from './stashesNode';
import { StatusFilesNode } from './statusFilesNode';
import { TagsNode } from './tagsNode';
import { ResourceType, SubscribeableViewNode, ViewNode } from './viewNode';
import { ContextValues, SubscribeableViewNode, ViewNode } from './viewNode';
const hasTimeRegex = /[hHm]/;
@ -130,7 +130,7 @@ export class RepositoryNode extends SubscribeableViewNode {
let iconSuffix = '';
let workingStatus = '';
let contextValue: string = ResourceType.Repository;
let contextValue: string = ContextValues.Repository;
if (this.repo.starred) {
contextValue += '+starred';
}

+ 3
- 3
src/views/nodes/resultsCommitsNode.ts Целия файл

@ -8,7 +8,7 @@ import { ViewWithFiles } from '../viewBase';
import { CommitNode } from './commitNode';
import { ShowMoreNode } from './common';
import { insertDateMarkers } from './helpers';
import { PageableViewNode, ResourceType, ViewNode } from './viewNode';
import { ContextValues, PageableViewNode, ViewNode } from './viewNode';
export interface CommitsQueryResults {
readonly label: string;
@ -35,8 +35,8 @@ export class ResultsCommitsNode extends ViewNode implements Pagea
return `${this.parent!.id}:results:commits`;
}
get type(): ResourceType {
return ResourceType.ResultsCommits;
get type(): ContextValues {
return ContextValues.ResultsCommits;
}
async getChildren(): Promise<ViewNode[]> {

+ 2
- 2
src/views/nodes/resultsFileNode.ts Целия файл

@ -6,7 +6,7 @@ import { Container } from '../../container';
import { GitFile, GitReference, GitRevisionReference, StatusFileFormatter } from '../../git/git';
import { GitUri } from '../../git/gitUri';
import { View } from '../viewBase';
import { ResourceType, ViewNode, ViewRefFileNode } from './viewNode';
import { ContextValues, ViewNode, ViewRefFileNode } from './viewNode';
export class ResultsFileNode extends ViewRefFileNode {
constructor(
@ -38,7 +38,7 @@ export class ResultsFileNode extends ViewRefFileNode {
getTreeItem(): TreeItem {
const item = new TreeItem(this.label, TreeItemCollapsibleState.None);
item.contextValue = ResourceType.ResultsFile;
item.contextValue = ContextValues.ResultsFile;
item.description = this.description;
item.tooltip = StatusFileFormatter.fromTemplate(
// eslint-disable-next-line no-template-curly-in-string

+ 2
- 2
src/views/nodes/resultsFilesNode.ts Целия файл

@ -8,7 +8,7 @@ import { Arrays, debug, gate, Iterables, Promises, Strings } from '../../system'
import { ViewWithFiles } from '../viewBase';
import { FileNode, FolderNode } from './folderNode';
import { ResultsFileNode } from './resultsFileNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
export interface FilesQueryResults {
label: string;
@ -80,7 +80,7 @@ export class ResultsFilesNode extends ViewNode {
}
const item = new TreeItem(label ?? 'files changed', state);
item.contextValue = ResourceType.ResultsFiles;
item.contextValue = ContextValues.ResultsFiles;
item.id = this.id;
return item;

+ 2
- 2
src/views/nodes/searchNode.ts Целия файл

@ -5,7 +5,7 @@ import { GlyphChars } from '../../constants';
import { debug, gate, Iterables, log, Promises } from '../../system';
import { View } from '../viewBase';
import { CommandMessageNode, MessageNode } from './common';
import { ResourceType, unknownGitUri, ViewNode } from './viewNode';
import { ContextValues, unknownGitUri, ViewNode } from './viewNode';
import { SearchOperators } from '../../git/git';
export class SearchNode extends ViewNode {
@ -93,7 +93,7 @@ export class SearchNode extends ViewNode {
getTreeItem(): TreeItem {
const item = new TreeItem('Search', TreeItemCollapsibleState.Expanded);
item.contextValue = ResourceType.Search;
item.contextValue = ContextValues.Search;
return item;
}

+ 3
- 3
src/views/nodes/searchResultsCommitsNode.ts Целия файл

@ -3,7 +3,7 @@ import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Commands, SearchCommitsCommandArgs } from '../../commands';
import { ViewWithFiles } from '../viewBase';
import { CommitsQueryResults, ResultsCommitsNode } from './resultsCommitsNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
import { SearchPattern } from '../../git/git';
@ -39,8 +39,8 @@ export class SearchResultsCommitsNode extends ResultsCommitsNode {
return SearchResultsCommitsNode.getId(this.repoPath, this.search, this._instanceId);
}
get type(): ResourceType {
return ResourceType.SearchResults;
get type(): ContextValues {
return ContextValues.SearchResults;
}
async getTreeItem(): Promise<TreeItem> {

+ 3
- 3
src/views/nodes/stashFileNode.ts Целия файл

@ -2,15 +2,15 @@
import { GitFile, GitLogCommit } from '../../git/git';
import { View } from '../viewBase';
import { CommitFileNode } from './commitFileNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
export class StashFileNode extends CommitFileNode {
constructor(view: View, parent: ViewNode, file: GitFile, commit: GitLogCommit) {
super(view, parent, file, commit);
}
protected get resourceType(): ResourceType {
return ResourceType.StashFile;
protected get contextValye(): ContextValues {
return ContextValues.StashFile;
}
protected getCommitTemplate() {

+ 2
- 2
src/views/nodes/stashNode.ts Целия файл

@ -6,7 +6,7 @@ import { CommitFormatter, GitStashCommit, GitStashReference } from '../../git/gi
import { Arrays, Iterables, Strings } from '../../system';
import { ViewWithFiles } from '../viewBase';
import { StashFileNode } from './stashFileNode';
import { ResourceType, ViewNode, ViewRefNode } from './viewNode';
import { ContextValues, ViewNode, ViewRefNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
import { FileNode, FolderNode } from '../nodes';
import { ViewFilesLayout } from '../../config';
@ -83,7 +83,7 @@ export class StashNode extends ViewRefNode {
truncateMessageAtNewLine: true,
dateFormat: Container.config.defaultDateFormat,
});
item.contextValue = ResourceType.Stash;
item.contextValue = ContextValues.Stash;
// eslint-disable-next-line no-template-curly-in-string
item.tooltip = CommitFormatter.fromTemplate('${ago} (${date})\n\n${message}', this.commit, {
dateFormat: Container.config.defaultDateFormat,

+ 2
- 2
src/views/nodes/stashesNode.ts Целия файл

@ -7,7 +7,7 @@ import { Iterables } from '../../system';
import { ViewWithFiles } from '../viewBase';
import { MessageNode } from './common';
import { StashNode } from './stashNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
export class StashesNode extends ViewNode<ViewWithFiles> {
@ -34,7 +34,7 @@ export class StashesNode extends ViewNode {
getTreeItem(): TreeItem {
const item = new TreeItem('Stashes', TreeItemCollapsibleState.Collapsed);
item.id = this.id;
item.contextValue = ResourceType.Stashes;
item.contextValue = ContextValues.Stashes;
item.iconPath = {
dark: Container.context.asAbsolutePath('images/dark/icon-stash.svg'),

+ 4
- 4
src/views/nodes/statusFileNode.ts Целия файл

@ -8,7 +8,7 @@ import { GitUri } from '../../git/gitUri';
import { Strings } from '../../system';
import { View } from '../viewBase';
import { CommitFileNode } from './commitFileNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
import { DiffWithCommandArgs } from '../../commands/diffWith';
export class StatusFileNode extends ViewNode {
@ -71,7 +71,7 @@ export class StatusFileNode extends ViewNode {
item.description = this.description;
if ((this._hasStagedChanges || this._hasUnstagedChanges) && this.commits.length === 1) {
item.contextValue = ResourceType.File;
item.contextValue = ContextValues.File;
if (this._hasStagedChanges) {
item.contextValue += '+staged';
item.tooltip = StatusFileFormatter.fromTemplate(
@ -96,7 +96,7 @@ export class StatusFileNode extends ViewNode {
} else {
item.collapsibleState = TreeItemCollapsibleState.Collapsed;
if (this._hasStagedChanges || this._hasUnstagedChanges) {
item.contextValue = ResourceType.File;
item.contextValue = ContextValues.File;
if (this._hasStagedChanges && this._hasUnstagedChanges) {
item.contextValue += '+staged+unstaged';
} else if (this._hasStagedChanges) {
@ -109,7 +109,7 @@ export class StatusFileNode extends ViewNode {
item.resourceUri = GitUri.resolveToUri(this.file.fileName, this.repoPath);
item.iconPath = ThemeIcon.File;
} else {
item.contextValue = ResourceType.StatusFileCommits;
item.contextValue = ContextValues.StatusFileCommits;
const icon = GitFile.getStatusIcon(this.file.status);
item.iconPath = {

+ 2
- 2
src/views/nodes/statusFilesNode.ts Целия файл

@ -17,7 +17,7 @@ import { Arrays, Iterables, Objects, Strings } from '../../system';
import { RepositoriesView } from '../repositoriesView';
import { FileNode, FolderNode } from './folderNode';
import { StatusFileNode } from './statusFileNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
export class StatusFilesNode extends ViewNode<RepositoriesView> {
@ -153,7 +153,7 @@ export class StatusFilesNode extends ViewNode {
const label = `${Strings.pluralize('file', files)} changed`;
const item = new TreeItem(label, TreeItemCollapsibleState.Collapsed);
item.id = this.id;
item.contextValue = ResourceType.StatusFiles;
item.contextValue = ContextValues.StatusFiles;
item.iconPath = {
dark: Container.context.asAbsolutePath('images/dark/icon-diff.svg'),
light: Container.context.asAbsolutePath('images/light/icon-diff.svg'),

+ 2
- 2
src/views/nodes/tagNode.ts Целия файл

@ -9,7 +9,7 @@ import { RepositoriesView } from '../repositoriesView';
import { CommitNode } from './commitNode';
import { MessageNode, ShowMoreNode } from './common';
import { insertDateMarkers } from './helpers';
import { PageableViewNode, ResourceType, ViewNode, ViewRefNode } from './viewNode';
import { ContextValues, PageableViewNode, ViewNode, ViewRefNode } from './viewNode';
import { emojify } from '../../emojis';
import { RepositoryNode } from './repositoryNode';
import { GlyphChars } from '../../constants';
@ -64,7 +64,7 @@ export class TagNode extends ViewRefNode impl
getTreeItem(): TreeItem {
const item = new TreeItem(this.label, TreeItemCollapsibleState.Collapsed);
item.id = this.id;
item.contextValue = ResourceType.Tag;
item.contextValue = ContextValues.Tag;
item.description = `${GitRevision.shorten(this.tag.sha, { force: true })}${Strings.pad(
GlyphChars.Dot,
2,

+ 2
- 2
src/views/nodes/tagsNode.ts Целия файл

@ -8,7 +8,7 @@ import { RepositoriesView } from '../repositoriesView';
import { BranchOrTagFolderNode } from './branchOrTagFolderNode';
import { MessageNode } from './common';
import { TagNode } from './tagNode';
import { ResourceType, ViewNode } from './viewNode';
import { ContextValues, ViewNode } from './viewNode';
import { RepositoryNode } from './repositoryNode';
export class TagsNode extends ViewNode<RepositoriesView> {
@ -56,7 +56,7 @@ export class TagsNode extends ViewNode {
getTreeItem(): TreeItem {
const item = new TreeItem('Tags', TreeItemCollapsibleState.Collapsed);
item.id = this.id;
item.contextValue = ResourceType.Tags;
item.contextValue = ContextValues.Tags;
item.iconPath = new ThemeIcon('tag');
return item;
}

+ 1
- 1
src/views/nodes/viewNode.ts Целия файл

@ -6,7 +6,7 @@ import { Logger } from '../../logger';
import { debug, Functions, gate, logName } from '../../system';
import { TreeViewNodeStateChangeEvent, View } from '../viewBase';
export enum ResourceType {
export enum ContextValues {
ActiveFileHistory = 'gitlens:history:active:file',
ActiveLineHistory = 'gitlens:history:active:line',
Branch = 'gitlens:branch',

Зареждане…
Отказ
Запис