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

Renames StatusFileNode to ResultsFileNode

main
Eric Amodio преди 6 години
родител
ревизия
73614cbca3
променени са 7 файла, в които са добавени 114 реда и са изтрити 114 реда
  1. +1
    -1
      README.md
  2. +1
    -1
      package.json
  3. +8
    -8
      src/views/explorerCommands.ts
  4. +1
    -1
      src/views/nodes.ts
  5. +4
    -4
      src/views/nodes/resultsFileNode.ts
  6. +2
    -2
      src/views/nodes/resultsFilesNode.ts

+ 1
- 1
README.md Целия файл

@ -693,7 +693,7 @@ See also [Explorer Settings](#explorer-settings 'Jump to the Explorer settings')
| `gitlens.explorers.defaultItemLimit` | Specifies the default number of items to show in an explorer list. Use 0 to specify no limit |
| `gitlens.explorers.stashFileFormat` | Specifies the format of a stashed file in the _Repositories_ and _Results_ explorers<br />Available tokens<br /> ${directory} - directory name<br /> ${file} - file name<br /> ${filePath} - formatted file name and path<br /> ${path} - full file path |
| `gitlens.explorers.stashFormat` | Specifies the format of stashed changes in the _Repositories_ and _Results_ explorers<br />Available tokens<br /> ${id} - commit id<br /> ${author} - commit author<br /> ${message} - commit message<br /> ${ago} - relative commit date (e.g. 1 day ago)<br /> ${date} - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)<br /> ${agoOrDate} - commit date specified by `gitlens.defaultDateStyle`<br /> ${authorAgo} - commit author, relative commit date<br /> ${authorAgoOrDate} - commit author, commit date specified by `gitlens.defaultDateStyle`<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting |
| `gitlens.explorers.statusFileFormat` | Specifies the format of the status of a working or committed file in the _Repositories_ and _Results_ explorers<br />Available tokens<br /> ${directory} - directory name<br /> ${file} - file name<br /> ${filePath} - formatted file name and path<br /> ${path} - full file path<br />${working} - optional indicator if the file is uncommitted |
| `gitlens.explorers.statusFileFormat` | Specifies the format of the status of a working or committed file in the _Repositories_ explorer<br />Available tokens<br /> ${directory} - directory name<br /> ${file} - file name<br /> ${filePath} - formatted file name and path<br /> ${path} - full file path<br />${working} - optional indicator if the file is uncommitted |
### Code Lens Settings

+ 1
- 1
package.json Целия файл

@ -476,7 +476,7 @@
"gitlens.explorers.statusFileFormat": {
"type": "string",
"default": "${working }${filePath}",
"description": "Specifies the format of the status of a working or committed file in the `Repositories` and `Results` explorers\nAvailable tokens\n ${directory} - directory name\n ${file} - file name\n ${filePath} - formatted file name and path\n ${path} - full file path\n ${working} - optional indicator if the file is uncommitted",
"description": "Specifies the format of the status of a working or committed file in the `Repositories` explorer\nAvailable tokens\n ${directory} - directory name\n ${file} - file name\n ${filePath} - formatted file name and path\n ${path} - full file path\n ${working} - optional indicator if the file is uncommitted",
"scope": "window"
},
"gitlens.repositoriesExplorer.autoRefresh": {

+ 8
- 8
src/views/explorerCommands.ts Целия файл

@ -25,10 +25,10 @@ import {
ExplorerRefNode,
RemoteNode,
RepositoryNode,
ResultsFileNode,
StashFileNode,
StashNode,
StatusFileCommitsNode,
StatusFileNode,
StatusUpstreamNode,
TagNode
} from './nodes';
@ -124,7 +124,7 @@ export class ExplorerCommands implements Disposable {
return node.push();
}
private async applyChanges(node: CommitFileNode | StashFileNode | StatusFileNode) {
private async applyChanges(node: CommitFileNode | StashFileNode | ResultsFileNode) {
await this.openFile(node);
if (node.uri.sha !== undefined && node.uri.sha !== 'HEAD') {
@ -220,7 +220,7 @@ export class ExplorerCommands implements Disposable {
void commands.executeCommand(BuiltInCommands.FocusFilesExplorer);
}
private openChanges(node: CommitFileNode | StashFileNode | StatusFileNode) {
private openChanges(node: CommitFileNode | StashFileNode | ResultsFileNode) {
const command = node.getCommand();
if (command === undefined || command.arguments === undefined) return;
@ -229,7 +229,7 @@ export class ExplorerCommands implements Disposable {
return commands.executeCommand(command.command, uri, args);
}
private async openChangesWithWorking(node: CommitFileNode | StashFileNode | StatusFileNode) {
private async openChangesWithWorking(node: CommitFileNode | StashFileNode | ResultsFileNode) {
const args: DiffWithWorkingCommandArgs = {
showOptions: {
preserveFocus: true,
@ -237,7 +237,7 @@ export class ExplorerCommands implements Disposable {
}
};
if (node instanceof StatusFileNode) {
if (node instanceof ResultsFileNode) {
args.commit = await Container.git.getLogCommitForFile(node.repoPath, node.uri.fsPath, {
ref: node.uri.sha,
firstIfNotFound: true,
@ -248,17 +248,17 @@ export class ExplorerCommands implements Disposable {
return commands.executeCommand(Commands.DiffWithWorking, node.uri, args);
}
private openFile(node: CommitFileNode | StashFileNode | StatusFileNode) {
private openFile(node: CommitFileNode | StashFileNode | ResultsFileNode) {
return openEditor(node.uri, { preserveFocus: true, preview: false });
}
private openFileRevision(
node: CommitFileNode | StashFileNode | StatusFileNode,
node: CommitFileNode | StashFileNode | ResultsFileNode,
options: OpenFileRevisionCommandArgs = { showOptions: { preserveFocus: true, preview: false } }
) {
let uri = options.uri;
if (uri == null) {
if (node instanceof StatusFileNode) {
if (node instanceof ResultsFileNode) {
uri = GitUri.toRevisionUri(node.uri);
}
else {

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

@ -21,7 +21,7 @@ export * from './nodes/stashesNode';
export * from './nodes/stashFileNode';
export * from './nodes/stashNode';
export * from './nodes/statusFileCommitsNode';
export * from './nodes/statusFileNode';
export * from './nodes/resultsFileNode';
export * from './nodes/statusFilesNode';
export * from './nodes/resultsFilesNode';
export * from './nodes/statusUpstreamNode';

src/views/nodes/statusFileNode.ts → src/views/nodes/resultsFileNode.ts Целия файл

@ -3,14 +3,14 @@ import * as path from 'path';
import { Command, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Commands, DiffWithCommandArgs } from '../../commands';
import { Container } from '../../container';
import { GitFile, GitStatusFile, GitUri, IStatusFormatOptions, StatusFileFormatter } from '../../git/gitService';
import { GitFile, GitUri, IStatusFormatOptions, StatusFileFormatter } from '../../git/gitService';
import { Explorer } from '../explorer';
import { ExplorerNode, ResourceType } from './explorerNode';
export class StatusFileNode extends ExplorerNode {
export class ResultsFileNode extends ExplorerNode {
constructor(
public readonly repoPath: string,
private readonly _file: GitStatusFile,
private readonly _file: GitFile,
private readonly _ref1: string,
private readonly _ref2: string,
parent: ExplorerNode,
@ -49,7 +49,7 @@ export class StatusFileNode extends ExplorerNode {
private _label: string | undefined;
get label() {
if (this._label === undefined) {
this._label = StatusFileFormatter.fromTemplate(this.explorer.config.statusFileFormat, this._file, {
this._label = StatusFileFormatter.fromTemplate('${filePath}', this._file, {
relativePath: this.relativePath
} as IStatusFormatOptions);
}

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

@ -8,7 +8,7 @@ import { Arrays, Iterables, Strings } from '../../system';
import { Explorer } from '../explorer';
import { ExplorerNode, ResourceType } from './explorerNode';
import { FileExplorerNode, FolderNode } from './folderNode';
import { StatusFileNode } from './statusFileNode';
import { ResultsFileNode } from './resultsFileNode';
export interface FilesQueryResults {
label: string;
@ -33,7 +33,7 @@ export class ResultsFilesNode extends ExplorerNode {
let children: FileExplorerNode[] = [
...Iterables.map(
diff,
s => new StatusFileNode(this.repoPath, s, this._ref1, this._ref2, this, this.explorer)
s => new ResultsFileNode(this.repoPath, s, this._ref1, this._ref2, this, this.explorer)
)
];

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