Sfoglia il codice sorgente

Splits views.avatars into separate settings per view

main
Eric Amodio 6 anni fa
parent
commit
fa2e6be104
13 ha cambiato i file con 68 aggiunte e 51 eliminazioni
  1. +3
    -1
      README.md
  2. +18
    -6
      package.json
  3. +12
    -11
      src/extension.ts
  4. +8
    -7
      src/ui/config.ts
  5. +6
    -6
      src/ui/settings/index.html
  6. +3
    -3
      src/views/nodes/branchTrackingStatusNode.ts
  7. +3
    -3
      src/views/nodes/commitNode.ts
  8. +3
    -3
      src/views/nodes/compareResultsNode.ts
  9. +3
    -3
      src/views/nodes/folderNode.ts
  10. +3
    -3
      src/views/nodes/resultsCommitsNode.ts
  11. +3
    -3
      src/views/nodes/resultsFilesNode.ts
  12. +2
    -2
      src/views/nodes/searchResultsCommitsNode.ts
  13. +1
    -0
      src/views/viewBase.ts

+ 3
- 1
README.md Vedi File

@ -752,6 +752,7 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| Name | Description | | Name | Description |
| ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ----------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gitlens.views.repositories.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the _Repositories_ view |
| `gitlens.views.repositories.autoRefresh` | Specifies whether to automatically refresh the _Repositories_ view when the repository or the file system changes | | `gitlens.views.repositories.autoRefresh` | Specifies whether to automatically refresh the _Repositories_ view when the repository or the file system changes |
| `gitlens.views.repositories.autoReveal` | Specifies whether to automatically reveal repositories in the _Repositories_ view when opening files | | `gitlens.views.repositories.autoReveal` | Specifies whether to automatically reveal repositories in the _Repositories_ view when opening files |
| `gitlens.views.repositories.branches.layout` | Specifies how the _Repositories_ view will display branches<br /><br />`list` - displays branches as a list<br />`tree` - displays branches as a tree when branch names contain slashes `/` | | `gitlens.views.repositories.branches.layout` | Specifies how the _Repositories_ view will display branches<br /><br />`list` - displays branches as a list<br />`tree` - displays branches as a tree when branch names contain slashes `/` |
@ -790,6 +791,7 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| Name | Description | | Name | Description |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gitlens.views.search.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the _Search Commits_ view |
| `gitlens.views.search.files.compact` | Specifies whether to compact (flatten) unnecessary file nesting in the _Search Commits_ view<br />Only applies when `gitlens.views.compare.files.layout` is set to `tree` or `auto` | | `gitlens.views.search.files.compact` | Specifies whether to compact (flatten) unnecessary file nesting in the _Search Commits_ view<br />Only applies when `gitlens.views.compare.files.layout` is set to `tree` or `auto` |
| `gitlens.views.search.enabled` | Specifies whether to show the _Search Commits_ view | | `gitlens.views.search.enabled` | Specifies whether to show the _Search Commits_ view |
| `gitlens.views.search.files.layout` | Specifies how the _Search Commits_ view will display files<br />`auto` - automatically switches between displaying files as a `tree` or `list` based on the `gitlens.views.compare.files.threshold` value and the number of files at each nesting level<br />`list` - displays files as a list<br />`tree` - displays files as a tree | | `gitlens.views.search.files.layout` | Specifies how the _Search Commits_ view will display files<br />`auto` - automatically switches between displaying files as a `tree` or `list` based on the `gitlens.views.compare.files.threshold` value and the number of files at each nesting level<br />`list` - displays files as a list<br />`tree` - displays files as a tree |
@ -802,6 +804,7 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| Name | Description | | Name | Description |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `gitlens.views.compare.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the _Compare_ view |
| `gitlens.views.compare.files.compact` | Specifies whether to compact (flatten) unnecessary file nesting in the _Compare_ view. Only applies when `gitlens.views.compare.files.layout` is set to `tree` or `auto` | | `gitlens.views.compare.files.compact` | Specifies whether to compact (flatten) unnecessary file nesting in the _Compare_ view. Only applies when `gitlens.views.compare.files.layout` is set to `tree` or `auto` |
| `gitlens.views.compare.enabled` | Specifies whether to show the _Compare_ view | | `gitlens.views.compare.enabled` | Specifies whether to show the _Compare_ view |
| `gitlens.views.compare.files.layout` | Specifies how the _Compare_ view will display files<br /><br />`auto` - automatically switches between displaying files as a `tree` or `list` based on the `gitlens.views.compare.files.threshold` value and the number of files at each nesting level<br />`list` - displays files as a list<br />`tree` - displays files as a tree | | `gitlens.views.compare.files.layout` | Specifies how the _Compare_ view will display files<br /><br />`auto` - automatically switches between displaying files as a `tree` or `list` based on the `gitlens.views.compare.files.threshold` value and the number of files at each nesting level<br />`list` - displays files as a list<br />`tree` - displays files as a tree |
@ -812,7 +815,6 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| Name | Description | | Name | Description |
| ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gitlens.views.avatars` | Specifies whether to show avatar images instead of commit (or status) icons in the views |
| `gitlens.views.commitFileFormat` | Specifies the format of a committed file in the views<br /><br />Available tokens<br />`${directory}` &mdash; directory name<br />`${file}` &mdash; file name<br />`${filePath}` &mdash; formatted file name and path<br />`${path}` &mdash; full file path | | `gitlens.views.commitFileFormat` | Specifies the format of a committed file in the views<br /><br />Available tokens<br />`${directory}` &mdash; directory name<br />`${file}` &mdash; file name<br />`${filePath}` &mdash; formatted file name and path<br />`${path}` &mdash; full file path |
| `gitlens.views.commitFileDescriptionFormat` | Specifies the description format of a committed file in the views<br /><br />Available tokens<br />`${directory}` &mdash; directory name<br />`${file}` &mdash; file name<br />`${filePath}` &mdash; formatted file name and path<br />`${path}` &mdash; full file path | | `gitlens.views.commitFileDescriptionFormat` | Specifies the description format of a committed file in the views<br /><br />Available tokens<br />`${directory}` &mdash; directory name<br />`${file}` &mdash; file name<br />`${filePath}` &mdash; formatted file name and path<br />`${path}` &mdash; full file path |
| `gitlens.views.commitFormat` | Specifies the format of committed changes in the views. See the [GitLens docs](https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting) for advanced formatting<br /><br />Available tokens<br />`${id}`&mdash; commit id<br />`${author}` &mdash; commit author<br />`${message}`&mdash; commit message<br />`${ago}` &mdash; relative commit date (e.g. 1 day ago)<br />`${date}`&mdash; formatted commit date (format specified by`gitlens.statusBar.dateFormat`)<br />`${agoOrDate}` &mdash; commit date specified by `gitlens.defaultDateStyle`<br />`${authorAgo}`&mdash; commit author, relative commit date<br />`${authorAgoOrDate}` &mdash; commit author, commit date specified by `gitlens.defaultDateStyle` | | `gitlens.views.commitFormat` | Specifies the format of committed changes in the views. See the [GitLens docs](https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting) for advanced formatting<br /><br />Available tokens<br />`${id}`&mdash; commit id<br />`${author}` &mdash; commit author<br />`${message}`&mdash; commit message<br />`${ago}` &mdash; relative commit date (e.g. 1 day ago)<br />`${date}`&mdash; formatted commit date (format specified by`gitlens.statusBar.dateFormat`)<br />`${agoOrDate}` &mdash; commit date specified by `gitlens.defaultDateStyle`<br />`${authorAgo}`&mdash; commit author, relative commit date<br />`${authorAgoOrDate}` &mdash; commit author, commit date specified by `gitlens.defaultDateStyle` |

+ 18
- 6
package.json Vedi File

@ -1199,12 +1199,6 @@
"markdownDescription": "Specifies the string to be shown in place of the _authors_ code lens when there are unsaved changes", "markdownDescription": "Specifies the string to be shown in place of the _authors_ code lens when there are unsaved changes",
"scope": "window" "scope": "window"
}, },
"gitlens.views.avatars": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show avatar images instead of commit (or status) icons in the views",
"scope": "window"
},
"gitlens.views.commitFileFormat": { "gitlens.views.commitFileFormat": {
"type": "string", "type": "string",
"default": "${file}", "default": "${file}",
@ -1229,6 +1223,12 @@
"markdownDescription": "Specifies the description format of committed changes in the views. See the [GitLens docs](https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting) for advanced formatting\n- Available tokens\n - `${id}` &mdash; commit id\n - `${author}` &mdash; commit author\n - `${message}` &mdash; commit message\n - `${ago}` &mdash; relative commit date (e.g. 1 day ago)\n - `${date}` &mdash; formatted commit date (format specified by `#gitlens.defaultDateFormat#`)\n - `${agoOrDate}` &mdash; commit date specified by `#gitlens.defaultDateStyle#`\n - `${authorAgo}` &mdash; commit author, relative commit date\n - `${authorAgoOrDate}` &mdash; commit author, commit date specified by `#gitlens.defaultDateStyle#`", "markdownDescription": "Specifies the description format of committed changes in the views. See the [GitLens docs](https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting) for advanced formatting\n- Available tokens\n - `${id}` &mdash; commit id\n - `${author}` &mdash; commit author\n - `${message}` &mdash; commit message\n - `${ago}` &mdash; relative commit date (e.g. 1 day ago)\n - `${date}` &mdash; formatted commit date (format specified by `#gitlens.defaultDateFormat#`)\n - `${agoOrDate}` &mdash; commit date specified by `#gitlens.defaultDateStyle#`\n - `${authorAgo}` &mdash; commit author, relative commit date\n - `${authorAgoOrDate}` &mdash; commit author, commit date specified by `#gitlens.defaultDateStyle#`",
"scope": "window" "scope": "window"
}, },
"gitlens.views.compare.avatars": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show avatar images instead of commit (or status) icons in the _Compare_ view",
"scope": "window"
},
"gitlens.views.compare.enabled": { "gitlens.views.compare.enabled": {
"type": "boolean", "type": "boolean",
"default": true, "default": true,
@ -1353,6 +1353,12 @@
"markdownDescription": "Specifies whether to automatically reveal repositories in the _Repositories_ view when opening files", "markdownDescription": "Specifies whether to automatically reveal repositories in the _Repositories_ view when opening files",
"scope": "window" "scope": "window"
}, },
"gitlens.views.repositories.avatars": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show avatar images instead of commit (or status) icons in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.branches.layout": { "gitlens.views.repositories.branches.layout": {
"type": "string", "type": "string",
"default": "tree", "default": "tree",
@ -1435,6 +1441,12 @@
"markdownDescription": "Specifies whether to show the tracking branch when displaying local branches in the _Repositories_ view", "markdownDescription": "Specifies whether to show the tracking branch when displaying local branches in the _Repositories_ view",
"scope": "window" "scope": "window"
}, },
"gitlens.views.search.avatars": {
"type": "boolean",
"default": true,
"markdownDescription": "Specifies whether to show avatar images instead of commit (or status) icons in the _Search Commits_ view",
"scope": "window"
},
"gitlens.views.search.enabled": { "gitlens.views.search.enabled": {
"type": "boolean", "type": "boolean",
"default": true, "default": true,

+ 12
- 11
src/extension.ts Vedi File

@ -99,7 +99,12 @@ async function migrateSettings(context: ExtensionContext, previousVersion: strin
const previous = Versions.fromString(previousVersion); const previous = Versions.fromString(previousVersion);
try { try {
if (Versions.compare(previous, Versions.from(9, 0, 0)) !== 1) {
if (Versions.compare(previous, Versions.from(9, 2, 2)) !== 1) {
await configuration.migrate('views.avatars', configuration.name('views')('compare')('avatars').value);
await configuration.migrate('views.avatars', configuration.name('views')('repositories')('avatars').value);
await configuration.migrate('views.avatars', configuration.name('views')('search')('avatars').value);
}
else if (Versions.compare(previous, Versions.from(9, 0, 0)) !== 1) {
await configuration.migrate( await configuration.migrate(
'gitExplorer.autoRefresh', 'gitExplorer.autoRefresh',
configuration.name('views')('repositories')('autoRefresh').value configuration.name('views')('repositories')('autoRefresh').value
@ -197,7 +202,12 @@ async function migrateSettings(context: ExtensionContext, previousVersion: strin
configuration.name('views')('search')('location').value configuration.name('views')('search')('location').value
); );
await configuration.migrate('explorers.avatars', configuration.name('views')('avatars').value);
await configuration.migrate('explorers.avatars', configuration.name('views')('compare')('avatars').value);
await configuration.migrate(
'explorers.avatars',
configuration.name('views')('repositories')('avatars').value
);
await configuration.migrate('explorers.avatars', configuration.name('views')('search')('avatars').value);
await configuration.migrate( await configuration.migrate(
'explorers.commitFileFormat', 'explorers.commitFileFormat',
configuration.name('views')('commitFileFormat').value configuration.name('views')('commitFileFormat').value
@ -208,15 +218,6 @@ async function migrateSettings(context: ExtensionContext, previousVersion: strin
configuration.name('views')('defaultItemLimit').value configuration.name('views')('defaultItemLimit').value
); );
await configuration.migrate( await configuration.migrate(
'explorers.files.compact',
configuration.name('views')('files')('compact').value
);
await configuration.migrate('explorers.files.layout', configuration.name('views')('files')('layout').value);
await configuration.migrate(
'explorers.files.threshold',
configuration.name('views')('files')('threshold').value
);
await configuration.migrate(
'explorers.stashFileFormat', 'explorers.stashFileFormat',
configuration.name('views')('stashFileFormat').value configuration.name('views')('stashFileFormat').value
); );

+ 8
- 7
src/ui/config.ts Vedi File

@ -237,6 +237,7 @@ export interface CodeLensLanguageScope {
} }
export interface CompareViewConfig { export interface CompareViewConfig {
avatars: boolean;
enabled: boolean; enabled: boolean;
files: ViewsFilesConfig; files: ViewsFilesConfig;
location: 'explorer' | 'gitlens' | 'scm'; location: 'explorer' | 'gitlens' | 'scm';
@ -248,7 +249,11 @@ export interface FileHistoryViewConfig {
location: 'explorer' | 'gitlens' | 'scm'; location: 'explorer' | 'gitlens' | 'scm';
} }
export interface LineHistoryViewConfig extends FileHistoryViewConfig {}
export interface LineHistoryViewConfig {
avatars: boolean;
enabled: boolean;
location: 'explorer' | 'gitlens' | 'scm';
}
export interface MenuConfig { export interface MenuConfig {
editor: editor:
@ -336,6 +341,7 @@ export interface RemotesUrlsConfig {
export interface RepositoriesViewConfig { export interface RepositoriesViewConfig {
autoRefresh: boolean; autoRefresh: boolean;
autoReveal: boolean; autoReveal: boolean;
avatars: boolean;
branches: { branches: {
layout: ViewBranchesLayout; layout: ViewBranchesLayout;
}; };
@ -348,19 +354,14 @@ export interface RepositoriesViewConfig {
} }
export interface SearchViewConfig { export interface SearchViewConfig {
avatars: boolean;
enabled: boolean; enabled: boolean;
files: ViewsFilesConfig; files: ViewsFilesConfig;
location: 'explorer' | 'gitlens' | 'scm'; location: 'explorer' | 'gitlens' | 'scm';
} }
export interface ViewsConfig { export interface ViewsConfig {
avatars: boolean;
fileHistory: FileHistoryViewConfig; fileHistory: FileHistoryViewConfig;
files: {
layout: ViewFilesLayout;
compact: boolean;
threshold: number;
};
commitFileDescriptionFormat: string; commitFileDescriptionFormat: string;
commitFileFormat: string; commitFileFormat: string;
commitDescriptionFormat: string; commitDescriptionFormat: string;

+ 6
- 6
src/ui/settings/index.html Vedi File

@ -2356,7 +2356,7 @@
<input <input
class="setting" class="setting"
id="views.repositories.avatars" id="views.repositories.avatars"
name="views.avatars"
name="views.repositories.avatars"
type="checkbox" type="checkbox"
disabled disabled
/> />
@ -2420,7 +2420,7 @@
<img <img
class="image__preview--overlay hidden" class="image__preview--overlay hidden"
src="{{root}}/images/settings/view-repositories-avatars.png" src="{{root}}/images/settings/view-repositories-avatars.png"
data-visibility="views.repositories.enabled &amp; views.avatars"
data-visibility="views.repositories.enabled &amp; views.repositories.avatars"
/> />
</div> </div>
<p class="settings-group__hint"> <p class="settings-group__hint">
@ -2680,7 +2680,7 @@
<input <input
class="setting" class="setting"
id="views.search.avatars" id="views.search.avatars"
name="views.avatars"
name="views.search.avatars"
type="checkbox" type="checkbox"
disabled disabled
/> />
@ -2711,7 +2711,7 @@
<img <img
class="image__preview--overlay hidden" class="image__preview--overlay hidden"
src="{{root}}/images/settings/view-search-avatars.png" src="{{root}}/images/settings/view-search-avatars.png"
data-visibility="views.search.enabled &amp; views.avatars"
data-visibility="views.search.enabled &amp; views.search.avatars"
/> />
</div> </div>
<p class="settings-group__hint"> <p class="settings-group__hint">
@ -2814,7 +2814,7 @@
<input <input
class="setting" class="setting"
id="views.compare.avatars" id="views.compare.avatars"
name="views.avatars"
name="views.compare.avatars"
type="checkbox" type="checkbox"
disabled disabled
/> />
@ -2845,7 +2845,7 @@
<img <img
class="image__preview--overlay hidden" class="image__preview--overlay hidden"
src="{{root}}/images/settings/view-compare-avatars.png" src="{{root}}/images/settings/view-compare-avatars.png"
data-visibility="views.compare.enabled &amp; views.avatars"
data-visibility="views.compare.enabled &amp; views.compare.avatars"
/> />
</div> </div>
<p class="settings-group__hint"> <p class="settings-group__hint">

+ 3
- 3
src/views/nodes/branchTrackingStatusNode.ts Vedi File

@ -3,7 +3,7 @@ import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Container } from '../../container'; import { Container } from '../../container';
import { GitTrackingState, GitUri } from '../../git/gitService'; import { GitTrackingState, GitUri } from '../../git/gitService';
import { Iterables, Strings } from '../../system'; import { Iterables, Strings } from '../../system';
import { View } from '../viewBase';
import { ViewWithFiles } from '../viewBase';
import { CommitNode } from './commitNode'; import { CommitNode } from './commitNode';
import { ShowMoreNode } from './common'; import { ShowMoreNode } from './common';
import { insertDateMarkers } from './helpers'; import { insertDateMarkers } from './helpers';
@ -16,12 +16,12 @@ export interface BranchTrackingStatus {
upstream?: string; upstream?: string;
} }
export class BranchTrackingStatusNode extends ViewNode implements PageableViewNode {
export class BranchTrackingStatusNode extends ViewNode<ViewWithFiles> implements PageableViewNode {
readonly supportsPaging: boolean = true; readonly supportsPaging: boolean = true;
maxCount: number | undefined; maxCount: number | undefined;
constructor( constructor(
view: View,
view: ViewWithFiles,
parent: ViewNode, parent: ViewNode,
public readonly status: BranchTrackingStatus, public readonly status: BranchTrackingStatus,
public readonly direction: 'ahead' | 'behind', public readonly direction: 'ahead' | 'behind',

+ 3
- 3
src/views/nodes/commitNode.ts Vedi File

@ -7,14 +7,14 @@ import { GlyphChars } from '../../constants';
import { Container } from '../../container'; import { Container } from '../../container';
import { CommitFormatter, GitBranch, GitLogCommit, ICommitFormatOptions } from '../../git/gitService'; import { CommitFormatter, GitBranch, GitLogCommit, ICommitFormatOptions } from '../../git/gitService';
import { Arrays, Iterables, Strings } from '../../system'; import { Arrays, Iterables, Strings } from '../../system';
import { View } from '../viewBase';
import { ViewWithFiles } from '../viewBase';
import { CommitFileNode, CommitFileNodeDisplayAs } from './commitFileNode'; import { CommitFileNode, CommitFileNodeDisplayAs } from './commitFileNode';
import { FileNode, FolderNode } from './folderNode'; import { FileNode, FolderNode } from './folderNode';
import { ResourceType, ViewNode, ViewRefNode } from './viewNode'; import { ResourceType, ViewNode, ViewRefNode } from './viewNode';
export class CommitNode extends ViewRefNode {
export class CommitNode extends ViewRefNode<ViewWithFiles> {
constructor( constructor(
view: View,
view: ViewWithFiles,
parent: ViewNode, parent: ViewNode,
public readonly commit: GitLogCommit, public readonly commit: GitLogCommit,
public readonly branch?: GitBranch, public readonly branch?: GitBranch,

+ 3
- 3
src/views/nodes/compareResultsNode.ts Vedi File

@ -3,14 +3,14 @@ import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Container } from '../../container'; import { Container } from '../../container';
import { GitService, GitUri } from '../../git/gitService'; import { GitService, GitUri } from '../../git/gitService';
import { Strings } from '../../system'; import { Strings } from '../../system';
import { View } from '../viewBase';
import { ViewWithFiles } from '../viewBase';
import { CommitsQueryResults, ResultsCommitsNode } from './resultsCommitsNode'; import { CommitsQueryResults, ResultsCommitsNode } from './resultsCommitsNode';
import { ResultsFilesNode } from './resultsFilesNode'; import { ResultsFilesNode } from './resultsFilesNode';
import { NamedRef, ResourceType, ViewNode } from './viewNode'; import { NamedRef, ResourceType, ViewNode } from './viewNode';
export class CompareResultsNode extends ViewNode {
export class CompareResultsNode extends ViewNode<ViewWithFiles> {
constructor( constructor(
view: View,
view: ViewWithFiles,
public readonly repoPath: string, public readonly repoPath: string,
ref1: NamedRef, ref1: NamedRef,
ref2: NamedRef ref2: NamedRef

+ 3
- 3
src/views/nodes/folderNode.ts Vedi File

@ -3,7 +3,7 @@ import { ThemeIcon, TreeItem, TreeItemCollapsibleState } from 'vscode';
import { ViewFilesLayout, ViewsFilesConfig } from '../../configuration'; import { ViewFilesLayout, ViewsFilesConfig } from '../../configuration';
import { GitUri } from '../../git/gitService'; import { GitUri } from '../../git/gitService';
import { Arrays, Objects } from '../../system'; import { Arrays, Objects } from '../../system';
import { View } from '../viewBase';
import { ViewWithFiles } from '../viewBase';
import { ResourceType, ViewNode } from './viewNode'; import { ResourceType, ViewNode } from './viewNode';
export interface FileNode extends ViewNode { export interface FileNode extends ViewNode {
@ -14,11 +14,11 @@ export interface FileNode extends ViewNode {
root?: Arrays.IHierarchicalItem<FileNode>; root?: Arrays.IHierarchicalItem<FileNode>;
} }
export class FolderNode extends ViewNode {
export class FolderNode extends ViewNode<ViewWithFiles> {
readonly priority: number = 1; readonly priority: number = 1;
constructor( constructor(
view: View,
view: ViewWithFiles,
parent: ViewNode, parent: ViewNode,
public readonly repoPath: string, public readonly repoPath: string,
public readonly folderName: string, public readonly folderName: string,

+ 3
- 3
src/views/nodes/resultsCommitsNode.ts Vedi File

@ -3,7 +3,7 @@ import { TreeItem, TreeItemCollapsibleState } from 'vscode';
import { Container } from '../../container'; import { Container } from '../../container';
import { GitLog, GitUri } from '../../git/gitService'; import { GitLog, GitUri } from '../../git/gitService';
import { Iterables } from '../../system'; import { Iterables } from '../../system';
import { View } from '../viewBase';
import { ViewWithFiles } from '../viewBase';
import { CommitNode } from './commitNode'; import { CommitNode } from './commitNode';
import { ShowMoreNode } from './common'; import { ShowMoreNode } from './common';
import { getBranchesAndTagTipsFn, insertDateMarkers } from './helpers'; import { getBranchesAndTagTipsFn, insertDateMarkers } from './helpers';
@ -14,12 +14,12 @@ export interface CommitsQueryResults {
log: GitLog | undefined; log: GitLog | undefined;
} }
export class ResultsCommitsNode extends ViewNode implements PageableViewNode {
export class ResultsCommitsNode extends ViewNode<ViewWithFiles> implements PageableViewNode {
readonly supportsPaging: boolean = true; readonly supportsPaging: boolean = true;
maxCount: number | undefined; maxCount: number | undefined;
constructor( constructor(
view: View,
view: ViewWithFiles,
parent: ViewNode, parent: ViewNode,
public readonly repoPath: string, public readonly repoPath: string,
private readonly _commitsQuery: (maxCount: number | undefined) => Promise<CommitsQueryResults> private readonly _commitsQuery: (maxCount: number | undefined) => Promise<CommitsQueryResults>

+ 3
- 3
src/views/nodes/resultsFilesNode.ts Vedi File

@ -5,7 +5,7 @@ import { ViewFilesLayout } from '../../configuration';
import { Container } from '../../container'; import { Container } from '../../container';
import { GitFile, GitUri } from '../../git/gitService'; import { GitFile, GitUri } from '../../git/gitService';
import { Arrays, Iterables, Strings } from '../../system'; import { Arrays, Iterables, Strings } from '../../system';
import { View } from '../viewBase';
import { ViewWithFiles } from '../viewBase';
import { FileNode, FolderNode } from './folderNode'; import { FileNode, FolderNode } from './folderNode';
import { ResultsFileNode } from './resultsFileNode'; import { ResultsFileNode } from './resultsFileNode';
import { ResourceType, ViewNode } from './viewNode'; import { ResourceType, ViewNode } from './viewNode';
@ -15,9 +15,9 @@ export interface FilesQueryResults {
diff: GitFile[] | undefined; diff: GitFile[] | undefined;
} }
export class ResultsFilesNode extends ViewNode {
export class ResultsFilesNode extends ViewNode<ViewWithFiles> {
constructor( constructor(
view: View,
view: ViewWithFiles,
parent: ViewNode, parent: ViewNode,
public readonly repoPath: string, public readonly repoPath: string,
private readonly _ref1: string, private readonly _ref1: string,

+ 2
- 2
src/views/nodes/searchResultsCommitsNode.ts Vedi File

@ -3,13 +3,13 @@ import { TreeItem } from 'vscode';
import { SearchCommitsCommandArgs } from '../../commands'; import { SearchCommitsCommandArgs } from '../../commands';
import { Commands } from '../../commands/common'; import { Commands } from '../../commands/common';
import { GitRepoSearchBy } from '../../git/gitService'; import { GitRepoSearchBy } from '../../git/gitService';
import { View } from '../viewBase';
import { ViewWithFiles } from '../viewBase';
import { CommitsQueryResults, ResultsCommitsNode } from './resultsCommitsNode'; import { CommitsQueryResults, ResultsCommitsNode } from './resultsCommitsNode';
import { ResourceType, ViewNode } from './viewNode'; import { ResourceType, ViewNode } from './viewNode';
export class SearchResultsCommitsNode extends ResultsCommitsNode { export class SearchResultsCommitsNode extends ResultsCommitsNode {
constructor( constructor(
view: View,
view: ViewWithFiles,
parent: ViewNode, parent: ViewNode,
repoPath: string, repoPath: string,
public readonly search: string, public readonly search: string,

+ 1
- 0
src/views/viewBase.ts Vedi File

@ -27,6 +27,7 @@ import { SearchView } from './searchView';
import { RefreshNodeCommandArgs } from './viewCommands'; import { RefreshNodeCommandArgs } from './viewCommands';
export type View = RepositoriesView | FileHistoryView | LineHistoryView | CompareView | SearchView; export type View = RepositoriesView | FileHistoryView | LineHistoryView | CompareView | SearchView;
export type ViewWithFiles = RepositoriesView | CompareView | SearchView;
export interface TreeViewNodeStateChangeEvent<T> extends TreeViewExpansionEvent<T> { export interface TreeViewNodeStateChangeEvent<T> extends TreeViewExpansionEvent<T> {
state: TreeItemCollapsibleState; state: TreeItemCollapsibleState;

Caricamento…
Annulla
Salva