Browse Source

Removes view location configuration settings

main
Eric Amodio 4 years ago
parent
commit
b24a7bdf25
24 changed files with 182 additions and 581 deletions
  1. +0
    -5
      README.md
  2. +81
    -235
      package.json
  3. +20
    -19
      src/commands/setViewsLayout.ts
  4. +5
    -29
      src/config.ts
  5. +1
    -24
      src/container.ts
  6. +0
    -10
      src/views/branchesView.ts
  7. +0
    -10
      src/views/commitsView.ts
  8. +3
    -17
      src/views/compareView.ts
  9. +0
    -10
      src/views/contributorsView.ts
  10. +4
    -14
      src/views/fileHistoryView.ts
  11. +4
    -13
      src/views/lineHistoryView.ts
  12. +0
    -10
      src/views/remotesView.ts
  13. +1
    -11
      src/views/repositoriesView.ts
  14. +5
    -19
      src/views/searchView.ts
  15. +0
    -10
      src/views/stashesView.ts
  16. +0
    -10
      src/views/tagsView.ts
  17. +42
    -39
      src/views/viewBase.ts
  18. +0
    -13
      src/webviews/apps/settings/partials/views.compare.html
  19. +0
    -18
      src/webviews/apps/settings/partials/views.file-history.html
  20. +8
    -8
      src/webviews/apps/settings/partials/views.html
  21. +0
    -18
      src/webviews/apps/settings/partials/views.line-history.html
  22. +0
    -18
      src/webviews/apps/settings/partials/views.repositories.html
  23. +0
    -13
      src/webviews/apps/settings/partials/views.search.html
  24. +8
    -8
      src/webviews/apps/welcome/welcome.html

+ 0
- 5
README.md View File

@ -760,7 +760,6 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| `gitlens.views.repositories.files.layout` | Specifies how the _Repositories_ view will display files<br /><br />`auto` - automatically switches between displaying files as a `tree` or `list` based on the `gitlens.views.repositories.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.repositories.files.threshold` | Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _Repositories_ view. Only applies when `gitlens.views.repositories.files.layout` is set to `auto` |
| `gitlens.views.repositories.includeWorkingTree` | Specifies whether to include working tree file status for each repository in the _Repositories_ view |
| `gitlens.views.repositories.location` | Specifies where to show the _Repositories_ view<br /><br />`gitlens` - adds to the GitLens side bar<br />`explorer` - adds to the Explorer side bar<br />`scm` - adds to the Source Control side bar |
| `gitlens.views.repositories.showBranchComparison` | Specifies whether to show a comparison of a user-selected reference (branch, tag. etc) to the current branch or the working tree in the _Repositories_ view |
| `gitlens.views.repositories.showTrackingBranch` | Specifies whether to show the tracking branch when displaying local branches in the _Repositories_ view |
@ -772,7 +771,6 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gitlens.views.fileHistory.avatars` | Specifies whether to show avatar images instead of status icons in the _File History_ view |
| `gitlens.views.fileHistory.enabled` | Specifies whether to show the _File History_ view |
| `gitlens.views.fileHistory.location` | Specifies where to show the _File History_ view<br /><br />`gitlens` - adds to the GitLens side bar<br />`explorer` - adds to the Explorer side bar<br />`scm` - adds to the Source Control side bar |
### Line History View Settings [#](#line-history-view-settings- 'Line History View Settings')
@ -782,7 +780,6 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| ------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `gitlens.views.lineHistory.avatars` | Specifies whether to show avatar images instead of status icons in the _Line History_ view |
| `gitlens.views.lineHistory.enabled` | Specifies whether to show the _Line History_ view |
| `gitlens.views.lineHistory.location` | Specifies where to show the _Line History_ view<br /><br />`gitlens` - adds to the GitLens side bar<br />`explorer` - adds to the Explorer side bar<br />`scm` - adds to the Source Control side bar |
### Search View Settings [#](#search-view-settings- 'Search View Settings')
@ -795,7 +792,6 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| `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.compare.files.threshold` | Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _Search Commits_ view<br />Only applies when `gitlens.views.compare.files.layout` is set to `auto` |
| `gitlens.views.search.location` | Specifies where to show the _Search Commits_ view<br />`gitlens` - adds to the GitLens side bar<br />`explorer` - adds to the Explorer side bar<br />`scm` - adds to the Source Control side bar |
### Compare View Settings [#](#compare-view-settings- 'Compare View Settings')
@ -808,7 +804,6 @@ See also [View Settings](#view-settings- 'Jump to the View settings')
| `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.threshold` | Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _Compare_ view. Only applies when `gitlens.views.compare.files.layout` is set to `auto` |
| `gitlens.views.compare.location` | Specifies where to show the _Compare_ view<br /><br />`gitlens` - adds to the GitLens side bar<br />`explorer` - adds to the Explorer side bar<br />`scm` - adds to the Source Control side bar |
### Gutter Blame Settings [#](#gutter-blame-settings- 'Gutter Blame Settings')

+ 81
- 235
package.json View File

@ -1659,22 +1659,6 @@
"markdownDescription": "Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _Compare_ view. Only applies when `#gitlens.views.compare.files.layout#` is set to `auto`",
"scope": "window"
},
"gitlens.views.compare.location": {
"type": "string",
"default": "gitlens",
"enum": [
"gitlens",
"explorer",
"scm"
],
"enumDescriptions": [
"Adds to the GitLens side bar",
"Adds to the Explorer side bar",
"Adds to the Source Control side bar"
],
"markdownDescription": "Specifies where to show the _Compare_ view",
"scope": "window"
},
"gitlens.views.contributors.avatars": {
"type": "boolean",
"default": true,
@ -1733,22 +1717,6 @@
"markdownDescription": "Specifies whether to show the _File History_ view",
"scope": "window"
},
"gitlens.views.fileHistory.location": {
"type": "string",
"default": "gitlens",
"enum": [
"gitlens",
"explorer",
"scm"
],
"enumDescriptions": [
"Adds to the GitLens side bar",
"Adds to the Explorer side bar",
"Adds to the Source Control side bar"
],
"markdownDescription": "Specifies where to show the _File History_ view",
"scope": "window"
},
"gitlens.views.lineHistory.avatars": {
"type": "boolean",
"default": true,
@ -1761,22 +1729,6 @@
"markdownDescription": "Specifies whether to show the _Line History_ view",
"scope": "window"
},
"gitlens.views.lineHistory.location": {
"type": "string",
"default": "gitlens",
"enum": [
"gitlens",
"explorer",
"scm"
],
"enumDescriptions": [
"Adds to the GitLens side bar",
"Adds to the Explorer side bar",
"Adds to the Source Control side bar"
],
"markdownDescription": "Specifies where to show the _Line History_ view",
"scope": "window"
},
"gitlens.views.remotes.avatars": {
"type": "boolean",
"default": true,
@ -1909,22 +1861,6 @@
"markdownDescription": "Specifies whether to include working tree file status for each repository in the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.location": {
"type": "string",
"default": "gitlens",
"enum": [
"gitlens",
"explorer",
"scm"
],
"enumDescriptions": [
"Adds to the GitLens side bar",
"Adds to the Explorer side bar",
"Adds to the Source Control side bar"
],
"markdownDescription": "Specifies where to show the _Repositories_ view",
"scope": "window"
},
"gitlens.views.repositories.showBranchComparison": {
"anyOf": [
{
@ -1994,22 +1930,6 @@
"markdownDescription": "Specifies when to switch between displaying files as a `tree` or `list` based on the number of files in a nesting level in the _Search Commits_ view. Only applies when `#gitlens.views.search.files.layout#` is set to `auto`",
"scope": "window"
},
"gitlens.views.search.location": {
"type": "string",
"default": "gitlens",
"enum": [
"gitlens",
"explorer",
"scm"
],
"enumDescriptions": [
"Adds to the GitLens side bar",
"Adds to the Explorer side bar",
"Adds to the Source Control side bar"
],
"markdownDescription": "Specifies where to show the _Search Commits_ view",
"scope": "window"
},
"gitlens.views.showRelativeDateMarkers": {
"type": "boolean",
"default": true,
@ -5392,17 +5312,17 @@
"view/title": [
{
"command": "gitlens.pushRepositories",
"when": "gitlens:hasRemotes && !gitlens:readonly && view =~ /^gitlens\\.views\\.(repositories:|commits)/",
"when": "gitlens:hasRemotes && !gitlens:readonly && view =~ /^gitlens\\.views\\.(repositories|commits)/",
"group": "navigation@10"
},
{
"command": "gitlens.pullRepositories",
"when": "gitlens:hasRemotes && !gitlens:readonly && view =~ /^gitlens\\.views\\.(repositories:|commits)/",
"when": "gitlens:hasRemotes && !gitlens:readonly && view =~ /^gitlens\\.views\\.(repositories|commits)/",
"group": "navigation@11"
},
{
"command": "gitlens.fetchRepositories",
"when": "gitlens:hasRemotes && !gitlens:readonly && view =~ /^gitlens\\.views\\.(repositories:|commits)/",
"when": "gitlens:hasRemotes && !gitlens:readonly && view =~ /^gitlens\\.views\\.(repositories|commits)/",
"group": "navigation@12"
},
{
@ -5412,272 +5332,272 @@
},
{
"command": "gitlens.views.repositories.setFilesLayoutToList",
"when": "view =~ /^gitlens\\.views\\.repositories:/ && config.gitlens.views.repositories.files.layout == auto",
"when": "view =~ /^gitlens\\.views\\.repositories/ && config.gitlens.views.repositories.files.layout == auto",
"group": "navigation@14"
},
{
"command": "gitlens.views.repositories.setFilesLayoutToTree",
"when": "view =~ /^gitlens\\.views\\.repositories:/ && config.gitlens.views.repositories.files.layout == list",
"when": "view =~ /^gitlens\\.views\\.repositories/ && config.gitlens.views.repositories.files.layout == list",
"group": "navigation@14"
},
{
"command": "gitlens.views.repositories.setFilesLayoutToAuto",
"when": "view =~ /^gitlens\\.views\\.repositories:/ && config.gitlens.views.repositories.files.layout == tree",
"when": "view =~ /^gitlens\\.views\\.repositories/ && config.gitlens.views.repositories.files.layout == tree",
"group": "navigation@14"
},
{
"command": "gitlens.views.repositories.refresh",
"when": "view =~ /^gitlens\\.views\\.repositories:/",
"when": "view =~ /^gitlens\\.views\\.repositories/",
"group": "navigation@99"
},
{
"command": "gitlens.views.repositories.setShowAvatarsOn",
"when": "view =~ /^gitlens\\.views\\.repositories:/ && !config.gitlens.views.repositories.avatars",
"when": "view =~ /^gitlens\\.views\\.repositories/ && !config.gitlens.views.repositories.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.repositories.setShowAvatarsOff",
"when": "view =~ /^gitlens\\.views\\.repositories:/ && config.gitlens.views.repositories.avatars",
"when": "view =~ /^gitlens\\.views\\.repositories/ && config.gitlens.views.repositories.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.repositories.setAutoRefreshToOn",
"when": "view =~ /^gitlens\\.views\\.repositories:/ && config.gitlens.views.repositories.autoRefresh && !gitlens:views:repositories:autoRefresh",
"when": "view =~ /^gitlens\\.views\\.repositories/ && config.gitlens.views.repositories.autoRefresh && !gitlens:views:repositories:autoRefresh",
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.repositories.setAutoRefreshToOff",
"when": "view =~ /^gitlens\\.views\\.repositories:/ && config.gitlens.views.repositories.autoRefresh && gitlens:views:repositories:autoRefresh",
"when": "view =~ /^gitlens\\.views\\.repositories/ && config.gitlens.views.repositories.autoRefresh && gitlens:views:repositories:autoRefresh",
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.fileHistory.setEditorFollowingOn",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && !gitlens:views:fileHistory:editorFollowing",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:editorFollowing",
"group": "navigation@10"
},
{
"command": "gitlens.views.fileHistory.setEditorFollowingOff",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && gitlens:views:fileHistory:editorFollowing",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && gitlens:views:fileHistory:editorFollowing",
"group": "navigation@10"
},
{
"command": "gitlens.views.fileHistory.setCursorFollowingOn",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && !gitlens:views:fileHistory:cursorFollowing",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !gitlens:views:fileHistory:cursorFollowing",
"group": "navigation@11"
},
{
"command": "gitlens.views.fileHistory.setCursorFollowingOff",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && gitlens:views:fileHistory:cursorFollowing",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && gitlens:views:fileHistory:cursorFollowing",
"group": "navigation@11"
},
{
"command": "gitlens.views.fileHistory.changeBase",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/",
"when": "view =~ /^gitlens\\.views\\.fileHistory/",
"group": "navigation@12"
},
{
"command": "gitlens.views.fileHistory.refresh",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/",
"when": "view =~ /^gitlens\\.views\\.fileHistory/",
"group": "navigation@99"
},
{
"command": "gitlens.views.fileHistory.setShowAvatarsOn",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && !config.gitlens.views.fileHistory.avatars",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !config.gitlens.views.fileHistory.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.fileHistory.setShowAvatarsOff",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && config.gitlens.views.fileHistory.avatars",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && config.gitlens.views.fileHistory.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.fileHistory.setRenameFollowingOn",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && !config.gitlens.advanced.fileHistoryFollowsRenames && !config.gitlens.advanced.fileHistoryShowAllBranches",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !config.gitlens.advanced.fileHistoryFollowsRenames && !config.gitlens.advanced.fileHistoryShowAllBranches",
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.fileHistory.setRenameFollowingOn",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && config.gitlens.advanced.fileHistoryShowAllBranches",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && config.gitlens.advanced.fileHistoryShowAllBranches",
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.fileHistory.setRenameFollowingOff",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && config.gitlens.advanced.fileHistoryFollowsRenames && !config.gitlens.advanced.fileHistoryShowAllBranches",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && config.gitlens.advanced.fileHistoryFollowsRenames && !config.gitlens.advanced.fileHistoryShowAllBranches",
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.fileHistory.setShowAllBranchesOn",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && !config.gitlens.advanced.fileHistoryShowAllBranches",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && !config.gitlens.advanced.fileHistoryShowAllBranches",
"group": "2_gitlens@1"
},
{
"command": "gitlens.views.fileHistory.setShowAllBranchesOff",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/ && config.gitlens.advanced.fileHistoryShowAllBranches",
"when": "view =~ /^gitlens\\.views\\.fileHistory/ && config.gitlens.advanced.fileHistoryShowAllBranches",
"group": "2_gitlens@1"
},
{
"command": "gitlens.views.lineHistory.setEditorFollowingOn",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && !gitlens:views:lineHistory:editorFollowing",
"when": "view =~ /^gitlens\\.views\\.lineHistory/ && !gitlens:views:lineHistory:editorFollowing",
"group": "navigation@10"
},
{
"command": "gitlens.views.lineHistory.setEditorFollowingOff",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && gitlens:views:lineHistory:editorFollowing",
"when": "view =~ /^gitlens\\.views\\.lineHistory/ && gitlens:views:lineHistory:editorFollowing",
"group": "navigation@10"
},
{
"command": "gitlens.views.lineHistory.changeBase",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/",
"when": "view =~ /^gitlens\\.views\\.lineHistory/",
"group": "navigation@11"
},
{
"command": "gitlens.views.lineHistory.refresh",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/",
"when": "view =~ /^gitlens\\.views\\.lineHistory/",
"group": "navigation@99"
},
{
"command": "gitlens.views.lineHistory.setShowAvatarsOn",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && !config.gitlens.views.lineHistory.avatars",
"when": "view =~ /^gitlens\\.views\\.lineHistory/ && !config.gitlens.views.lineHistory.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.lineHistory.setShowAvatarsOff",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && config.gitlens.views.lineHistory.avatars",
"when": "view =~ /^gitlens\\.views\\.lineHistory/ && config.gitlens.views.lineHistory.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.lineHistory.setRenameFollowingOn",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && !config.gitlens.advanced.fileHistoryFollowsRenames",
"when": "view =~ /^gitlens\\.views\\.lineHistory/ && !config.gitlens.advanced.fileHistoryFollowsRenames",
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.lineHistory.setRenameFollowingOff",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/ && config.gitlens.advanced.fileHistoryFollowsRenames",
"when": "view =~ /^gitlens\\.views\\.lineHistory/ && config.gitlens.advanced.fileHistoryFollowsRenames",
"group": "2_gitlens@0"
},
{
"command": "gitlens.views.compare.selectForCompare",
"when": "view =~ /^gitlens\\.views\\.compare:/",
"when": "view =~ /^gitlens\\.views\\.compare/",
"group": "navigation@10"
},
{
"command": "gitlens.views.compare.setKeepResultsToOn",
"when": "view =~ /^gitlens\\.views\\.compare:/ && !gitlens:views:compare:keepResults",
"when": "view =~ /^gitlens\\.views\\.compare/ && !gitlens:views:compare:keepResults",
"group": "navigation@11"
},
{
"command": "gitlens.views.compare.setKeepResultsToOff",
"when": "view =~ /^gitlens\\.views\\.compare:/ && gitlens:views:compare:keepResults",
"when": "view =~ /^gitlens\\.views\\.compare/ && gitlens:views:compare:keepResults",
"group": "navigation@11"
},
{
"command": "gitlens.views.compare.setFilesLayoutToList",
"when": "view =~ /^gitlens\\.views\\.compare:/ && config.gitlens.views.compare.files.layout == auto",
"when": "view =~ /^gitlens\\.views\\.compare/ && config.gitlens.views.compare.files.layout == auto",
"group": "navigation@12"
},
{
"command": "gitlens.views.compare.setFilesLayoutToTree",
"when": "view =~ /^gitlens\\.views\\.compare:/ && config.gitlens.views.compare.files.layout == list",
"when": "view =~ /^gitlens\\.views\\.compare/ && config.gitlens.views.compare.files.layout == list",
"group": "navigation@12"
},
{
"command": "gitlens.views.compare.setFilesLayoutToAuto",
"when": "view =~ /^gitlens\\.views\\.compare:/ && config.gitlens.views.compare.files.layout == tree",
"when": "view =~ /^gitlens\\.views\\.compare/ && config.gitlens.views.compare.files.layout == tree",
"group": "navigation@12"
},
{
"command": "gitlens.views.compare.clear",
"when": "view =~ /^gitlens\\.views\\.compare:/",
"when": "view =~ /^gitlens\\.views\\.compare/",
"group": "navigation@98"
},
{
"command": "gitlens.views.compare.refresh",
"when": "view =~ /^gitlens\\.views\\.compare:/",
"when": "view =~ /^gitlens\\.views\\.compare/",
"group": "navigation@99"
},
{
"command": "gitlens.views.compare.setShowAvatarsOn",
"when": "view =~ /^gitlens\\.views\\.compare:/ && !config.gitlens.views.compare.avatars",
"when": "view =~ /^gitlens\\.views\\.compare/ && !config.gitlens.views.compare.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.compare.setShowAvatarsOff",
"when": "view =~ /^gitlens\\.views\\.compare:/ && config.gitlens.views.compare.avatars",
"when": "view =~ /^gitlens\\.views\\.compare/ && config.gitlens.views.compare.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.search.searchCommits",
"when": "view =~ /^gitlens\\.views\\.search:/",
"when": "view =~ /^gitlens\\.views\\.search/",
"group": "navigation@10"
},
{
"command": "gitlens.views.search.setKeepResultsToOn",
"when": "view =~ /^gitlens\\.views\\.search:/ && !gitlens:views:search:keepResults",
"when": "view =~ /^gitlens\\.views\\.search/ && !gitlens:views:search:keepResults",
"group": "navigation@11"
},
{
"command": "gitlens.views.search.setKeepResultsToOff",
"when": "view =~ /^gitlens\\.views\\.search:/ && gitlens:views:search:keepResults",
"when": "view =~ /^gitlens\\.views\\.search/ && gitlens:views:search:keepResults",
"group": "navigation@11"
},
{
"command": "gitlens.views.search.setFilesLayoutToList",
"when": "view =~ /^gitlens\\.views\\.search:/ && config.gitlens.views.search.files.layout == auto",
"when": "view =~ /^gitlens\\.views\\.search/ && config.gitlens.views.search.files.layout == auto",
"group": "navigation@12"
},
{
"command": "gitlens.views.search.setFilesLayoutToTree",
"when": "view =~ /^gitlens\\.views\\.search:/ && config.gitlens.views.search.files.layout == list",
"when": "view =~ /^gitlens\\.views\\.search/ && config.gitlens.views.search.files.layout == list",
"group": "navigation@12"
},
{
"command": "gitlens.views.search.setFilesLayoutToAuto",
"when": "view =~ /^gitlens\\.views\\.search:/ && config.gitlens.views.search.files.layout == tree",
"when": "view =~ /^gitlens\\.views\\.search/ && config.gitlens.views.search.files.layout == tree",
"group": "navigation@12"
},
{
"command": "gitlens.views.search.clear",
"when": "view =~ /^gitlens\\.views\\.search:/",
"when": "view =~ /^gitlens\\.views\\.search/",
"group": "navigation@98"
},
{
"command": "gitlens.views.search.refresh",
"when": "view =~ /^gitlens\\.views\\.search:/",
"when": "view =~ /^gitlens\\.views\\.search/",
"group": "navigation@99"
},
{
"command": "gitlens.views.search.setShowAvatarsOn",
"when": "view =~ /^gitlens\\.views\\.search:/ && !config.gitlens.views.search.avatars",
"when": "view =~ /^gitlens\\.views\\.search/ && !config.gitlens.views.search.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.views.search.setShowAvatarsOff",
"when": "view =~ /^gitlens\\.views\\.search:/ && config.gitlens.views.search.avatars",
"when": "view =~ /^gitlens\\.views\\.search/ && config.gitlens.views.search.avatars",
"group": "1_gitlens@0"
},
{
"command": "gitlens.showSettingsPage#repositories-view",
"when": "view =~ /^gitlens\\.views\\.repositories:/",
"when": "view =~ /^gitlens\\.views\\.repositories/",
"group": "9_gitlens@1"
},
{
"command": "gitlens.showSettingsPage#file-history-view",
"when": "view =~ /^gitlens\\.views\\.fileHistory:/",
"when": "view =~ /^gitlens\\.views\\.fileHistory/",
"group": "9_gitlens@1"
},
{
"command": "gitlens.showSettingsPage#line-history-view",
"when": "view =~ /^gitlens\\.views\\.lineHistory:/",
"when": "view =~ /^gitlens\\.views\\.lineHistory/",
"group": "9_gitlens@1"
},
{
"command": "gitlens.showSettingsPage#search-commits-view",
"when": "view =~ /^gitlens\\.views\\.search:/",
"when": "view =~ /^gitlens\\.views\\.search/",
"group": "9_gitlens@1"
},
{
"command": "gitlens.showSettingsPage",
"when": "view =~ /^gitlens\\.views\\.compare:/",
"when": "view =~ /^gitlens\\.views\\.compare/",
"group": "9_gitlens@1"
},
{
@ -7100,110 +7020,31 @@
]
},
"views": {
"gitlens": [
{
"id": "gitlens.views.repositories:gitlens",
"name": "Repositories",
"when": "config.gitlens.views.repositories.enabled && config.gitlens.views.repositories.location == gitlens",
"contextualTitle": "GitLens",
"icon": "images/views/repositories.svg"
},
{
"id": "gitlens.views.fileHistory:gitlens",
"name": "File History",
"when": "config.gitlens.views.fileHistory.enabled && config.gitlens.views.fileHistory.location == gitlens",
"contextualTitle": "GitLens",
"icon": "images/views/history.svg"
},
{
"id": "gitlens.views.lineHistory:gitlens",
"name": "Line History",
"when": "config.gitlens.views.lineHistory.enabled && config.gitlens.views.lineHistory.location == gitlens",
"contextualTitle": "GitLens",
"icon": "images/views/history.svg",
"visibility": "hidden"
},
{
"id": "gitlens.views.search:gitlens",
"name": "Search Commits",
"when": "config.gitlens.views.search.enabled && config.gitlens.views.search.location == gitlens",
"contextualTitle": "GitLens",
"icon": "images/views/search.svg",
"visibility": "collapsed"
},
{
"id": "gitlens.views.compare:gitlens",
"name": "Compare Commits",
"when": "config.gitlens.views.compare.enabled && config.gitlens.views.compare.location == gitlens",
"contextualTitle": "GitLens",
"icon": "images/views/compare.svg",
"visibility": "collapsed"
}
],
"explorer": [
{
"id": "gitlens.views.repositories:explorer",
"name": "Repositories",
"when": "gitlens:enabled && config.gitlens.views.repositories.enabled && config.gitlens.views.repositories.location == explorer",
"contextualTitle": "GitLens",
"icon": "images/views/repositories.svg"
},
{
"id": "gitlens.views.fileHistory:explorer",
"name": "File History",
"when": "gitlens:enabled && config.gitlens.views.fileHistory.enabled && config.gitlens.views.fileHistory.location == explorer",
"contextualTitle": "GitLens",
"icon": "images/views/history.svg"
},
{
"id": "gitlens.views.lineHistory:explorer",
"name": "Line History",
"when": "gitlens:enabled && config.gitlens.views.lineHistory.enabled && config.gitlens.views.lineHistory.location == explorer",
"contextualTitle": "GitLens",
"icon": "images/views/history.svg",
"visibility": "hidden"
},
{
"id": "gitlens.views.compare:explorer",
"name": "Compare Commits",
"when": "gitlens:enabled && config.gitlens.views.compare.enabled && config.gitlens.views.compare.location == explorer",
"contextualTitle": "GitLens",
"icon": "images/views/compare.svg",
"visibility": "collapsed"
},
{
"id": "gitlens.views.search:explorer",
"name": "Search Commits",
"when": "gitlens:enabled && config.gitlens.views.search.enabled && config.gitlens.views.search.location == explorer",
"contextualTitle": "GitLens",
"icon": "images/views/search.svg",
"visibility": "collapsed"
}
],
"scm": [
{
"id": "gitlens.views.repositories:scm",
"id": "gitlens.views.repositories",
"name": "Repositories",
"when": "gitlens:enabled && config.gitlens.views.repositories.enabled && config.gitlens.views.repositories.location == scm",
"when": "gitlens:enabled && config.gitlens.views.repositories.enabled",
"contextualTitle": "GitLens",
"icon": "images/views/repositories.svg"
},
{
"id": "gitlens.views.commits",
"name": "Commits",
"when": "gitlens:enabled",
"contextualTitle": "GitLens"
},
{
"id": "gitlens.views.fileHistory:scm",
"id": "gitlens.views.fileHistory",
"name": "File History",
"when": "gitlens:enabled && config.gitlens.views.fileHistory.enabled && config.gitlens.views.fileHistory.location == scm",
"when": "gitlens:enabled && config.gitlens.views.fileHistory.enabled",
"contextualTitle": "GitLens",
"icon": "images/views/history.svg"
},
{
"id": "gitlens.views.lineHistory:scm",
"id": "gitlens.views.lineHistory",
"name": "Line History",
"when": "gitlens:enabled && config.gitlens.views.lineHistory.enabled && config.gitlens.views.lineHistory.location == scm",
"when": "gitlens:enabled && config.gitlens.views.lineHistory.enabled",
"contextualTitle": "GitLens",
"icon": "images/views/history.svg",
"visibility": "hidden"
@ -7211,46 +7052,51 @@
{
"id": "gitlens.views.branches",
"name": "Branches",
"when": "gitlens:enabled",
"contextualTitle": "GitLens"
},
{
"id": "gitlens.views.remotes",
"name": "Remotes",
"when": "gitlens:enabled",
"contextualTitle": "GitLens",
"visibility": "collapsed"
},
{
"id": "gitlens.views.tags",
"name": "Tags",
"id": "gitlens.views.stashes",
"name": "Stashes",
"when": "gitlens:enabled",
"contextualTitle": "GitLens",
"visibility": "collapsed"
},
{
"id": "gitlens.views.stashes",
"name": "Stashes",
"id": "gitlens.views.tags",
"name": "Tags",
"when": "gitlens:enabled",
"contextualTitle": "GitLens",
"visibility": "collapsed"
},
{
"id": "gitlens.views.contributors",
"name": "Contributors",
"when": "gitlens:enabled",
"contextualTitle": "GitLens",
"visibility": "collapsed"
},
{
"id": "gitlens.views.compare:scm",
"name": "Compare Commits",
"when": "gitlens:enabled && config.gitlens.views.compare.enabled && config.gitlens.views.compare.location == scm",
"id": "gitlens.views.search",
"name": "Search Commits",
"when": "gitlens:enabled && config.gitlens.views.search.enabled",
"contextualTitle": "GitLens",
"icon": "images/views/compare.svg",
"icon": "images/views/search.svg",
"visibility": "collapsed"
},
{
"id": "gitlens.views.search:scm",
"name": "Search Commits",
"when": "gitlens:enabled && config.gitlens.views.search.enabled && config.gitlens.views.search.location == scm",
"id": "gitlens.views.compare",
"name": "Compare Commits",
"when": "gitlens:enabled && config.gitlens.views.compare.enabled",
"contextualTitle": "GitLens",
"icon": "images/views/search.svg",
"icon": "images/views/compare.svg",
"visibility": "collapsed"
}
]

+ 20
- 19
src/commands/setViewsLayout.ts View File

@ -1,11 +1,11 @@
'use strict';
import { commands, ConfigurationTarget, window } from 'vscode';
import { configuration, ViewLocation, viewsWithLocationConfigKeys } from '../configuration';
import { command, Command, Commands } from './common';
import { commands, window } from 'vscode';
import { viewsConfigKeys } from '../configuration';
import { extensionId } from '../constants';
import { command, Command, Commands } from './common';
enum ViewsLayout {
Default = 'default',
GitLens = 'gitlens',
SourceControl = 'scm',
}
@ -28,7 +28,7 @@ export class SetViewsLayoutCommand extends Command {
label: 'GitLens Layout',
description: '(default)',
detail: 'Shows all the views together on the GitLens side bar',
layout: ViewsLayout.Default,
layout: ViewsLayout.GitLens,
},
{
label: 'Source Control Layout',
@ -46,24 +46,25 @@ export class SetViewsLayoutCommand extends Command {
layout = pick.layout;
}
let location;
switch (layout) {
case ViewsLayout.Default:
location = ViewLocation.GitLens;
case ViewsLayout.GitLens:
try {
void (await commands.executeCommand(
'workbench.action.moveViews',
viewsConfigKeys.map(
view => `${extensionId}.views.${view}`,
`workbench.view.extension.${extensionId}`,
),
));
} catch {}
break;
case ViewsLayout.SourceControl:
location = ViewLocation.SourceControl;
break;
default:
return;
}
for (const view of viewsConfigKeys) {
void (await commands.executeCommand(`${extensionId}.views.${view}.resetViewLocation`));
}
for (const view of viewsWithLocationConfigKeys) {
if (configuration.get('views', view, 'location') === location) {
await commands.executeCommand(`${extensionId}.views.${view}:${location}.resetViewLocation`);
} else {
await configuration.update('views', view, 'location', location, ConfigurationTarget.Global);
}
break;
}
}
}

+ 5
- 29
src/config.ts View File

@ -240,12 +240,6 @@ export enum ViewFilesLayout {
Tree = 'tree',
}
export enum ViewLocation {
Explorer = 'explorer',
GitLens = 'gitlens',
SourceControl = 'scm',
}
export enum ViewShowBranchComparison {
Branch = 'branch',
Working = 'working',
@ -445,34 +439,21 @@ interface ViewsConfigs {
export type ViewsConfigKeys = keyof ViewsConfigs;
export const viewsConfigKeys: ViewsConfigKeys[] = [
'branches',
'commits',
'compare',
'contributors',
'repositories',
'fileHistory',
'lineHistory',
'branches',
'remotes',
'repositories',
'search',
'stashes',
'tags',
'contributors',
'search',
'compare',
];
export type ViewsConfig = ViewsCommonConfig & ViewsConfigs;
type ViewsWithLocation = keyof Pick<
ViewsConfigs,
'compare' | 'fileHistory' | 'lineHistory' | 'repositories' | 'search'
>;
export const viewsWithLocationConfigKeys: ViewsWithLocation[] = [
'compare',
'fileHistory',
'lineHistory',
'repositories',
'search',
];
export interface BranchesViewConfig {
avatars: boolean;
branches: {
@ -494,7 +475,6 @@ export interface CompareViewConfig {
avatars: boolean;
enabled: boolean;
files: ViewsFilesConfig;
location: ViewLocation;
}
export interface ContributorsViewConfig {
@ -505,13 +485,11 @@ export interface ContributorsViewConfig {
export interface FileHistoryViewConfig {
avatars: boolean;
enabled: boolean;
location: ViewLocation;
}
export interface LineHistoryViewConfig {
avatars: boolean;
enabled: boolean;
location: ViewLocation;
}
export interface RemotesViewConfig {
@ -534,7 +512,6 @@ export interface RepositoriesViewConfig {
enabled: boolean;
files: ViewsFilesConfig;
includeWorkingTree: boolean;
location: ViewLocation;
showBranchComparison: false | ViewShowBranchComparison;
showTrackingBranch: boolean;
}
@ -543,7 +520,6 @@ export interface SearchViewConfig {
avatars: boolean;
enabled: boolean;
files: ViewsFilesConfig;
location: ViewLocation;
}
export interface StashesViewConfig {

+ 1
- 24
src/container.ts View File

@ -6,14 +6,7 @@ import { LineAnnotationController } from './annotations/lineAnnotationController
import { clearAvatarCache } from './avatars';
import { GitCodeLensController } from './codelens/codeLensController';
import { Commands, ToggleFileAnnotationCommandArgs } from './commands';
import {
AnnotationsToggleMode,
Config,
configuration,
ConfigurationWillChangeEvent,
viewsWithLocationConfigKeys,
} from './configuration';
import { extensionId } from './constants';
import { AnnotationsToggleMode, Config, configuration, ConfigurationWillChangeEvent } from './configuration';
import { GitFileSystemProvider } from './git/fsProvider';
import { GitService } from './git/gitService';
import { LineHoverController } from './hovers/lineHoverController';
@ -148,22 +141,6 @@ export class Container {
clearAvatarCache();
}
for (const view of viewsWithLocationConfigKeys) {
if (configuration.changed(e.change, 'views', view, 'location')) {
setTimeout(
() =>
commands.executeCommand(
`${extensionId}.views.${view}:${configuration.get(
'views',
view,
'location',
)}.resetViewLocation`,
),
0,
);
}
}
if (configuration.changed(e.change, 'mode') || configuration.changed(e.change, 'modes')) {
if (this._applyModeConfigurationTransformBound === undefined) {
this._applyModeConfigurationTransformBound = this.applyModeConfigurationTransform.bind(this);

+ 0
- 10
src/views/branchesView.ts View File

@ -217,16 +217,6 @@ export class BranchesView extends ViewBase
return true;
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (configuration.initializing(e)) {
this.initialize(undefined, { showCollapseAll: true });
}
if (!configuration.initializing(e) && this._root != null) {
void this.refresh(true);
}
}
findBranch(branch: GitBranchReference, token?: CancellationToken) {
const repoNodeId = RepositoryNode.getId(branch.repoPath);

+ 0
- 10
src/views/commitsView.ts View File

@ -232,16 +232,6 @@ export class CommitsView extends ViewBase {
return true;
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (configuration.initializing(e)) {
this.initialize(undefined, { showCollapseAll: true });
}
if (!configuration.initializing(e) && this._root !== undefined) {
void this.refresh(true);
}
}
async findCommit(commit: GitLogCommit | { repoPath: string; ref: string }, token?: CancellationToken) {
const repoNodeId = RepositoryNode.getId(commit.repoPath);

+ 3
- 17
src/views/compareView.ts View File

@ -26,10 +26,6 @@ export class CompareView extends ViewBase {
return new CompareNode(this);
}
protected get location(): string {
return this.config.location;
}
protected registerCommands() {
void Container.viewCommands;
@ -85,29 +81,19 @@ export class CompareView extends ViewBase {
return true;
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (configuration.changed(e, 'views', this.configKey, 'location')) {
this.initialize(this.config.location, { showCollapseAll: true });
}
if (!configuration.initializing(e) && this._root != null) {
void this.refresh(true);
}
}
get keepResults(): boolean {
return Container.context.workspaceState.get<boolean>(WorkspaceState.ViewsCompareKeepResults, false);
}
clear() {
this._root?.clear();
this.root?.clear();
}
dismissNode(node: ViewNode) {
if (this._root == null) return;
if (this.root == null) return;
if (nodeSupportsConditionalDismissal(node) && node.canDismiss() === false) return;
this._root.dismiss(node);
this.root.dismiss(node);
}
compare(repoPath: string, ref1: string | NamedRef, ref2: string | NamedRef) {

+ 0
- 10
src/views/contributorsView.ts View File

@ -172,16 +172,6 @@ export class ContributorsView extends ViewBase
return true;
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (configuration.initializing(e)) {
this.initialize(undefined, { showCollapseAll: true });
}
if (!configuration.initializing(e) && this._root != null) {
void this.refresh(true);
}
}
private setFilesLayout(layout: ViewFilesLayout) {
return configuration.updateEffective('views', this.configKey, 'files', 'layout', layout);
}

+ 4
- 14
src/views/fileHistoryView.ts View File

@ -11,6 +11,7 @@ const pinnedSuffix = ' (pinned)';
export class FileHistoryView extends ViewBase<FileHistoryTrackerNode | LineHistoryTrackerNode, FileHistoryViewConfig> {
protected readonly configKey = 'fileHistory';
protected readonly showCollapseAll = false;
constructor() {
super('gitlens.views.fileHistory', 'File History');
@ -20,10 +21,6 @@ export class FileHistoryView extends ViewBase
return this._followCursor ? new LineHistoryTrackerNode(this) : new FileHistoryTrackerNode(this);
}
protected get location(): string {
return this.config.location;
}
protected registerCommands() {
void Container.viewCommands;
@ -101,13 +98,7 @@ export class FileHistoryView extends ViewBase
void setCommandContext(CommandContext.ViewsFileHistoryCursorFollowing, this._followCursor);
}
if (configuration.changed(e, 'views', this.configKey, 'location')) {
this.initialize(this.config.location);
}
if (!configuration.initializing(e) && this._root != null) {
void this.refresh(true);
}
super.onConfigurationChanged(e);
}
async showHistoryForUri(uri: GitUri, baseRef?: string) {
@ -122,7 +113,7 @@ export class FileHistoryView extends ViewBase
}
private changeBase() {
void this._root?.changeBase();
void this.root?.changeBase();
}
private _followCursor: boolean = false;
@ -131,7 +122,6 @@ export class FileHistoryView extends ViewBase
void setCommandContext(CommandContext.ViewsFileHistoryCursorFollowing, enabled);
this.title = this._followCursor ? 'Line History' : 'File History';
// this.titleContext = this._followCursor ? this.titleContext : undefined;
const root = this.ensureRoot(true);
root.setEditorFollowing(this._followEditor);
@ -143,7 +133,7 @@ export class FileHistoryView extends ViewBase
private setEditorFollowing(enabled: boolean) {
this._followEditor = enabled;
void setCommandContext(CommandContext.ViewsFileHistoryEditorFollowing, enabled);
this._root?.setEditorFollowing(enabled);
this.root?.setEditorFollowing(enabled);
if (this.titleDescription?.endsWith(pinnedSuffix)) {
if (enabled) {

+ 4
- 13
src/views/lineHistoryView.ts View File

@ -10,6 +10,7 @@ const pinnedSuffix = ' (pinned)';
export class LineHistoryView extends ViewBase<LineHistoryTrackerNode, LineHistoryViewConfig> {
protected readonly configKey = 'lineHistory';
protected readonly showCollapseAll = false;
constructor() {
super('gitlens.views.lineHistory', 'Line History');
@ -19,10 +20,6 @@ export class LineHistoryView extends ViewBase
return new LineHistoryTrackerNode(this);
}
protected get location(): string {
return this.config.location;
}
protected registerCommands() {
void Container.viewCommands;
@ -78,22 +75,16 @@ export class LineHistoryView extends ViewBase
void setCommandContext(CommandContext.ViewsLineHistoryEditorFollowing, true);
}
if (configuration.changed(e, 'views', this.configKey, 'location')) {
this.initialize(this.config.location);
}
if (!configuration.initializing(e) && this._root != null) {
void this.refresh(true);
}
super.onConfigurationChanged(e);
}
private changeBase() {
void this._root?.changeBase();
void this.root?.changeBase();
}
private setEditorFollowing(enabled: boolean) {
void setCommandContext(CommandContext.ViewsLineHistoryEditorFollowing, enabled);
this._root?.setEditorFollowing(enabled);
this.root?.setEditorFollowing(enabled);
if (this.titleDescription?.endsWith(pinnedSuffix)) {
if (enabled) {

+ 0
- 10
src/views/remotesView.ts View File

@ -210,16 +210,6 @@ export class RemotesView extends ViewBase {
return true;
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (configuration.initializing(e)) {
this.initialize(undefined, { showCollapseAll: true });
}
if (!configuration.initializing(e) && this._root != null) {
void this.refresh(true);
}
}
findBranch(branch: GitBranchReference, token?: CancellationToken) {
if (!branch.remote) return undefined;

+ 1
- 11
src/views/repositoriesView.ts View File

@ -51,10 +51,6 @@ export class RepositoriesView extends ViewBase
return new RepositoriesNode(this);
}
protected get location(): string {
return this.config.location;
}
protected registerCommands() {
void Container.viewCommands;
@ -124,13 +120,7 @@ export class RepositoriesView extends ViewBase
void this.setAutoRefresh(Container.config.views.repositories.autoRefresh);
}
if (configuration.changed(e, 'views', this.configKey, 'location')) {
this.initialize(this.config.location, { showCollapseAll: true });
}
if (!configuration.initializing(e) && this._root != null) {
void this.refresh(true);
}
super.onConfigurationChanged(e);
}
get autoRefresh() {

+ 5
- 19
src/views/searchView.ts View File

@ -28,10 +28,6 @@ export class SearchView extends ViewBase {
return new SearchNode(this);
}
protected get location(): string {
return this.config.location;
}
protected registerCommands() {
void Container.viewCommands;
@ -82,29 +78,19 @@ export class SearchView extends ViewBase {
return true;
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (configuration.changed(e, 'views', this.configKey, 'location')) {
this.initialize(this.config.location, { showCollapseAll: true });
}
if (!configuration.initializing(e) && this._root != null) {
void this.refresh(true);
}
}
get keepResults(): boolean {
return Container.context.workspaceState.get<boolean>(WorkspaceState.ViewsSearchKeepResults, false);
}
clear() {
this._root?.clear();
this.root?.clear();
}
dismissNode(node: ViewNode) {
if (this._root == null) return;
if (this.root == null) return;
if (nodeSupportsConditionalDismissal(node) && node.canDismiss() === false) return;
this._root.dismiss(node);
this.root.dismiss(node);
}
async search(
@ -142,7 +128,7 @@ export class SearchView extends ViewBase {
return this.addResults(
new SearchResultsCommitsNode(
this,
this._root!,
this.root!,
repoPath,
search,
`Results ${typeof label === 'string' ? label : label.label}`,
@ -197,7 +183,7 @@ export class SearchView extends ViewBase {
);
return this.addResults(
new SearchResultsCommitsNode(this, this._root!, repoPath, search, labelString, searchQueryFn),
new SearchResultsCommitsNode(this, this.root!, repoPath, search, labelString, searchQueryFn),
reveal,
);
}

+ 0
- 10
src/views/stashesView.ts View File

@ -172,16 +172,6 @@ export class StashesView extends ViewBase {
return true;
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (configuration.initializing(e)) {
this.initialize(undefined, { showCollapseAll: true });
}
if (!configuration.initializing(e) && this._root != null) {
void this.refresh(true);
}
}
private setFilesLayout(layout: ViewFilesLayout) {
return configuration.updateEffective('views', this.configKey, 'files', 'layout', layout);
}

+ 0
- 10
src/views/tagsView.ts View File

@ -201,16 +201,6 @@ export class TagsView extends ViewBase {
return true;
}
protected onConfigurationChanged(e: ConfigurationChangeEvent) {
if (configuration.initializing(e)) {
this.initialize(undefined, { showCollapseAll: true });
}
if (!configuration.initializing(e) && this._root != null) {
void this.refresh(true);
}
}
findTag(tag: GitTagReference, token?: CancellationToken) {
const repoNodeId = RepositoryNode.getId(tag.repoPath);

+ 42
- 39
src/views/viewBase.ts View File

@ -108,10 +108,12 @@ export abstract class ViewBase<
return this._onDidChangeNodeState.event;
}
protected _disposable: Disposable | undefined;
protected disposable: Disposable | undefined;
protected root: RootNode | undefined;
protected tree: TreeView<ViewNode> | undefined;
protected readonly showCollapseAll: boolean = true;
private readonly _lastKnownLimits = new Map<string, number | undefined>();
protected _root: RootNode | undefined;
protected _tree: TreeView<ViewNode> | undefined;
constructor(public readonly id: string, public readonly name: string) {
if (Logger.isDebugging) {
@ -143,6 +145,9 @@ export abstract class ViewBase<
this.onConfigurationChanged(e);
}, this),
);
this.initialize({ showCollapseAll: this.showCollapseAll });
setImmediate(() => this.onConfigurationChanged(configuration.initializingChangeEvent));
}
@ -158,7 +163,7 @@ export abstract class ViewBase<
}
dispose() {
this._disposable?.dispose();
this.disposable?.dispose();
}
private _title: string | undefined;
@ -181,7 +186,7 @@ export abstract class ViewBase<
private _updateTitleDebounced: (() => void) | undefined = undefined;
private updateTitle() {
if (this._tree == null) return;
if (this.tree == null) return;
if (this._updateTitleDebounced === undefined) {
this._updateTitleDebounced = Functions.debounce(this.updateTitleCore.bind(this), 100);
@ -191,13 +196,13 @@ export abstract class ViewBase<
}
private updateTitleCore() {
if (this._tree == null) return;
if (this._tree.visible) {
this._tree.title = `${this.title}${
if (this.tree == null) return;
if (this.tree.visible) {
this.tree.title = `${this.title}${
this.titleDescription ? ` ${GlyphChars.Dot} ${this.titleDescription}` : ''
}`;
} else {
this._tree.title = this.title;
this.tree.title = this.title;
}
}
@ -205,39 +210,39 @@ export abstract class ViewBase<
return `${this.id}.${command}`;
}
protected get location(): string | undefined {
return undefined;
}
protected abstract getRoot(): RootNode;
protected abstract registerCommands(): void;
protected abstract onConfigurationChanged(e: ConfigurationChangeEvent): void;
protected onConfigurationChanged(e: ConfigurationChangeEvent): void {
if (!configuration.initializing(e) && this.root != null) {
void this.refresh(true);
}
}
protected initialize(container?: string, options: { showCollapseAll?: boolean } = {}) {
if (this._disposable != null) {
this._disposable.dispose();
protected initialize(options: { showCollapseAll?: boolean } = {}) {
if (this.disposable != null) {
this.disposable.dispose();
this._onDidChangeTreeData = new EventEmitter<ViewNode>();
}
this._tree = window.createTreeView(`${this.id}${container ? `:${container}` : ''}`, {
this.tree = window.createTreeView(this.id, {
...options,
treeDataProvider: this,
});
this._disposable = Disposable.from(
this._tree,
this._tree.onDidChangeVisibility(Functions.debounce(this.onVisibilityChanged, 250), this),
this._tree.onDidCollapseElement(this.onElementCollapsed, this),
this._tree.onDidExpandElement(this.onElementExpanded, this),
this.disposable = Disposable.from(
this.tree,
this.tree.onDidChangeVisibility(Functions.debounce(this.onVisibilityChanged, 250), this),
this.tree.onDidCollapseElement(this.onElementCollapsed, this),
this.tree.onDidExpandElement(this.onElementExpanded, this),
);
this._title = this._tree.title;
this._title = this.tree.title;
}
protected ensureRoot(force: boolean = false) {
if (this._root == null || force) {
this._root = this.getRoot();
if (this.root == null || force) {
this.root = this.getRoot();
}
return this._root;
return this.root;
}
getChildren(node?: ViewNode): ViewNode[] | Promise<ViewNode[]> {
@ -271,13 +276,13 @@ export abstract class ViewBase<
}
get selection(): ViewNode[] {
if (this._tree == null || this._root == null) return [];
if (this.tree == null || this.root == null) return [];
return this._tree.selection;
return this.tree.selection;
}
get visible(): boolean {
return this._tree != null ? this._tree.visible : false;
return this.tree != null ? this.tree.visible : false;
}
async findNode(
@ -327,7 +332,7 @@ export abstract class ViewBase<
const cc = Logger.getCorrelationContext();
// If we have no root (e.g. never been initialized) force it so the tree will load properly
if (this._root == null) {
if (this.root == null) {
await this.show();
}
@ -452,7 +457,7 @@ export abstract class ViewBase<
@debug()
async refresh(reset: boolean = false) {
await this._root?.refresh?.(reset);
await this.root?.refresh?.(reset);
this.triggerNodeChange();
}
@ -478,10 +483,10 @@ export abstract class ViewBase<
expand?: boolean | number;
},
) {
if (this._tree == null) return;
if (this.tree == null) return;
try {
await this._tree.reveal(node, options);
await this.tree.reveal(node, options);
} catch (ex) {
Logger.error(ex);
}
@ -489,10 +494,8 @@ export abstract class ViewBase<
@log()
async show() {
const location = this.location;
try {
void (await commands.executeCommand(`${this.id}${location ? `:${location}` : ''}.focus`));
void (await commands.executeCommand(`${this.id}.focus`));
} catch (ex) {
Logger.error(ex);
@ -509,7 +512,7 @@ export abstract class ViewBase<
if (result === actions[0]) {
await configuration.update(section as any, 'enabled', true, ConfigurationTarget.Global);
void (await commands.executeCommand(`${this.id}${location ? `:${location}` : ''}.focus`));
void (await commands.executeCommand(`${this.id}.focus`));
}
}
}
@ -549,7 +552,7 @@ export abstract class ViewBase<
})
triggerNodeChange(node?: ViewNode) {
// Since the root node won't actually refresh, force everything
this._onDidChangeTreeData.fire(node != null && node !== this._root ? node : undefined);
this._onDidChangeTreeData.fire(node != null && node !== this.root ? node : undefined);
}
protected abstract readonly configKey: ViewsConfigKeys;

+ 0
- 13
src/webviews/apps/settings/partials/views.compare.html View File

@ -23,19 +23,6 @@
<div class="settings settings--fixed ml-1">
<div class="setting" data-enablement="views.compare.enabled">
<div class="setting__input">
<label for="views.compare.location">Show in the</label>
<div class="select-container">
<select id="views.compare.location" name="views.compare.location" data-setting disabled>
<option value="gitlens">GitLens side bar</option>
<option value="explorer">Explorer side bar</option>
<option value="scm">Source Control side bar</option>
</select>
</div>
</div>
</div>
<div class="setting" data-enablement="views.compare.enabled">
<div class="setting__input">
<label for="views.compare.files.layout">Layout files</label>
<div class="select-container">
<select

+ 0
- 18
src/webviews/apps/settings/partials/views.file-history.html View File

@ -23,24 +23,6 @@
<div class="settings settings--fixed ml-1">
<div class="setting" data-enablement="views.fileHistory.enabled">
<div class="setting__input">
<label for="views.fileHistory.location">Show in the</label>
<div class="select-container">
<select
id="views.fileHistory.location"
name="views.fileHistory.location"
data-setting
disabled
>
<option value="gitlens">GitLens side bar</option>
<option value="explorer">Explorer side bar</option>
<option value="scm">Source Control side bar</option>
</select>
</div>
</div>
</div>
<div class="setting" data-enablement="views.fileHistory.enabled">
<div class="setting__input">
<input
id="views.fileHistory.avatars"
name="views.fileHistory.avatars"

+ 8
- 8
src/webviews/apps/settings/partials/views.html View File

@ -24,20 +24,20 @@
<div class="preset">
<a
class="button button--flat"
title="Shows all the views together on the GitLens side bar"
href="command:gitlens.setViewsLayout?%7B%22layout%22%3A%22default%22%7D"
>GitLens Layout (default)</a
title="Shows all the views together on the Source Control side bar"
href="command:gitlens.setViewsLayout?%7B%22layout%22%3A%22scm%22%7D"
>Source Control Layout (default)</a
>
<p>Shows all the views together on the GitLens side bar</p>
<p>Shows all the views together on the Source Control side bar</p>
</div>
<div class="preset">
<a
class="button button--flat"
title="Shows all the views together on the Source Control side bar"
href="command:gitlens.setViewsLayout?%7B%22layout%22%3A%22scm%22%7D"
>Source Control Layout</a
title="Shows all the views together on the GitLens side bar"
href="command:gitlens.setViewsLayout?%7B%22layout%22%3A%22gitlens%22%7D"
>GitLens Layout</a
>
<p>Shows all the views together on the Source Control side bar</p>
<p>Shows all the views together on the GitLens side bar</p>
</div>
</div>

+ 0
- 18
src/webviews/apps/settings/partials/views.line-history.html View File

@ -24,24 +24,6 @@
<div class="settings settings--fixed ml-1">
<div class="setting" data-enablement="views.lineHistory.enabled">
<div class="setting__input">
<label for="views.lineHistory.location">Show in the</label>
<div class="select-container">
<select
id="views.lineHistory.location"
name="views.lineHistory.location"
data-setting
disabled
>
<option value="gitlens">GitLens side bar</option>
<option value="explorer">Explorer side bar</option>
<option value="scm">Source Control side bar</option>
</select>
</div>
</div>
</div>
<div class="setting" data-enablement="views.lineHistory.enabled">
<div class="setting__input">
<input
id="views.lineHistory.avatars"
name="views.lineHistory.avatars"

+ 0
- 18
src/webviews/apps/settings/partials/views.repositories.html View File

@ -23,24 +23,6 @@
<div class="settings settings--fixed ml-1">
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<label for="views.repositories.location">Show in the</label>
<div class="select-container">
<select
id="views.repositories.location"
name="views.repositories.location"
data-setting
disabled
>
<option value="gitlens">GitLens side bar</option>
<option value="explorer">Explorer side bar</option>
<option value="scm">Source Control side bar</option>
</select>
</div>
</div>
</div>
<div class="setting" data-enablement="views.repositories.enabled">
<div class="setting__input">
<input
id="views.repositories.showBranchComparison"
name="views.repositories.showBranchComparison"

+ 0
- 13
src/webviews/apps/settings/partials/views.search.html View File

@ -23,19 +23,6 @@
<div class="settings settings--fixed ml-1">
<div class="setting" data-enablement="views.search.enabled">
<div class="setting__input">
<label for="views.search.location">Show in the</label>
<div class="select-container">
<select id="views.search.location" name="views.search.location" data-setting disabled>
<option value="gitlens">GitLens side bar</option>
<option value="explorer">Explorer side bar</option>
<option value="scm">Source Control side bar</option>
</select>
</div>
</div>
</div>
<div class="setting" data-enablement="views.search.enabled">
<div class="setting__input">
<label for="views.search.files.layout">Layout files</label>
<div class="select-container">
<select

+ 8
- 8
src/webviews/apps/welcome/welcome.html View File

@ -267,20 +267,20 @@
<div class="preset">
<a
class="button button--flat"
title="Shows all the views together on the GitLens side bar"
href="command:gitlens.setViewsLayout?%7B%22layout%22%3A%22default%22%7D"
>GitLens Layout (default)</a
title="Shows all the views together on the Source Control side bar"
href="command:gitlens.setViewsLayout?%7B%22layout%22%3A%22scm%22%7D"
>Source Control Layout (default)</a
>
<p>Shows all the views together on the GitLens side bar</p>
<p>Shows all the views together on the Source Control side bar</p>
</div>
<div class="preset">
<a
class="button button--flat"
title="Shows all the views together on the Source Control side bar"
href="command:gitlens.setViewsLayout?%7B%22layout%22%3A%22scm%22%7D"
>Source Control Layout</a
title="Shows all the views together on the GitLens side bar"
href="command:gitlens.setViewsLayout?%7B%22layout%22%3A%22gitlens%22%7D"
>GitLens Layout</a
>
<p>Shows all the views together on the Source Control side bar</p>
<p>Shows all the views together on the GitLens side bar</p>
</div>
</div>

Loading…
Cancel
Save