Skip to content

Commit 445cb04

Browse files
committed
Improves perf of revision context
1 parent bd7ceaf commit 445cb04

File tree

2 files changed

+44
-52
lines changed

2 files changed

+44
-52
lines changed

package.json

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5866,21 +5866,21 @@
58665866
"title": "Open Changes with Next Revision",
58675867
"category": "GitLens",
58685868
"icon": "$(gitlens-next-commit)",
5869-
"enablement": "gitlens:activeFileStatus =~ /revision/"
5869+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
58705870
},
58715871
{
58725872
"command": "gitlens.diffWithNextInDiffLeft",
58735873
"title": "Open Changes with Next Revision",
58745874
"category": "GitLens",
58755875
"icon": "$(gitlens-next-commit)",
5876-
"enablement": "gitlens:activeFileStatus =~ /revision/"
5876+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
58775877
},
58785878
{
58795879
"command": "gitlens.diffWithNextInDiffRight",
58805880
"title": "Open Changes with Next Revision",
58815881
"category": "GitLens",
58825882
"icon": "$(gitlens-next-commit)",
5883-
"enablement": "gitlens:activeFileStatus =~ /revision/"
5883+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
58845884
},
58855885
{
58865886
"command": "gitlens.diffWithPrevious",
@@ -6298,21 +6298,21 @@
62986298
"title": "Show Revision Commit",
62996299
"category": "GitLens",
63006300
"icon": "$(gitlens-commit-horizontal)",
6301-
"enablement": "gitlens:activeFileStatus =~ /revision/ && resourceScheme != git"
6301+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/"
63026302
},
63036303
{
63046304
"command": "gitlens.showQuickRevisionDetailsInDiffLeft",
63056305
"title": "Show Revision Commit",
63066306
"category": "GitLens",
63076307
"icon": "$(gitlens-commit-horizontal)",
6308-
"enablement": "gitlens:activeFileStatus =~ /revision/ && resourceScheme != git"
6308+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/"
63096309
},
63106310
{
63116311
"command": "gitlens.showQuickRevisionDetailsInDiffRight",
63126312
"title": "Show Revision Commit",
63136313
"category": "GitLens",
63146314
"icon": "$(gitlens-commit-horizontal)",
6315-
"enablement": "gitlens:activeFileStatus =~ /revision/ && resourceScheme != git"
6315+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/"
63166316
},
63176317
{
63186318
"command": "gitlens.showQuickFileHistory",
@@ -6633,21 +6633,21 @@
66336633
"title": "Open File at Revision",
66346634
"category": "GitLens",
66356635
"icon": "$(gitlens-open-revision)",
6636-
"enablement": "gitlens:activeFileStatus =~ /revision/ && resourceScheme != git"
6636+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/"
66376637
},
66386638
{
66396639
"command": "gitlens.openRevisionFileInDiffLeft",
66406640
"title": "Open File at Revision",
66416641
"category": "GitLens",
66426642
"icon": "$(gitlens-open-revision)",
6643-
"enablement": "gitlens:activeFileStatus =~ /revision/ && resourceScheme != git"
6643+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/"
66446644
},
66456645
{
66466646
"command": "gitlens.openRevisionFileInDiffRight",
66476647
"title": "Open File at Revision",
66486648
"category": "GitLens",
66496649
"icon": "$(gitlens-open-revision)",
6650-
"enablement": "gitlens:activeFileStatus =~ /revision/ && resourceScheme != git"
6650+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/ "
66516651
},
66526652
{
66536653
"command": "gitlens.openWorkingFile",
@@ -6752,28 +6752,28 @@
67526752
"title": "Browse Repository from Revision",
67536753
"category": "GitLens",
67546754
"icon": "$(folder-opened)",
6755-
"enablement": "gitlens:activeFileStatus =~ /revision/ && resourceScheme != git"
6755+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/"
67566756
},
67576757
{
67586758
"command": "gitlens.browseRepoAtRevisionInNewWindow",
67596759
"title": "Browse Repository from Revision in New Window",
67606760
"category": "GitLens",
67616761
"icon": "$(folder-opened)",
6762-
"enablement": "gitlens:activeFileStatus =~ /revision/ && resourceScheme != git"
6762+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/"
67636763
},
67646764
{
67656765
"command": "gitlens.browseRepoBeforeRevision",
67666766
"title": "Browse Repository from Before Revision",
67676767
"category": "GitLens",
67686768
"icon": "$(folder-opened)",
6769-
"enablement": "gitlens:activeFileStatus =~ /revision/ && resourceScheme != git"
6769+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/"
67706770
},
67716771
{
67726772
"command": "gitlens.browseRepoBeforeRevisionInNewWindow",
67736773
"title": "Browse Repository from Before Revision in New Window",
67746774
"category": "GitLens",
67756775
"icon": "$(folder-opened)",
6776-
"enablement": "gitlens:activeFileStatus =~ /revision/ && resourceScheme != git"
6776+
"enablement": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/"
67776777
},
67786778
{
67796779
"command": "gitlens.views.browseRepoAtRevision",
@@ -9807,15 +9807,15 @@
98079807
},
98089808
{
98099809
"command": "gitlens.diffWithNext",
9810-
"when": "gitlens:activeFileStatus =~ /revision/ && !isInDiffEditor"
9810+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && !isInDiffEditor"
98119811
},
98129812
{
98139813
"command": "gitlens.diffWithNextInDiffLeft",
9814-
"when": "gitlens:activeFileStatus =~ /revision/ && isInDiffEditor && !isInDiffRightEditor"
9814+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && isInDiffEditor && !isInDiffRightEditor"
98159815
},
98169816
{
98179817
"command": "gitlens.diffWithNextInDiffRight",
9818-
"when": "gitlens:activeFileStatus =~ /revision/ && isInDiffRightEditor"
9818+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && isInDiffRightEditor"
98199819
},
98209820
{
98219821
"command": "gitlens.diffWithPrevious",
@@ -9851,7 +9851,7 @@
98519851
},
98529852
{
98539853
"command": "gitlens.diffWithWorking",
9854-
"when": "gitlens:activeFileStatus =~ /revision/"
9854+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
98559855
},
98569856
{
98579857
"command": "gitlens.diffWithWorkingInDiffLeft",
@@ -10135,7 +10135,7 @@
1013510135
},
1013610136
{
1013710137
"command": "gitlens.showQuickRevisionDetails",
10138-
"when": "gitlens:activeFileStatus =~ /revision/"
10138+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
1013910139
},
1014010140
{
1014110141
"command": "gitlens.showQuickRevisionDetailsInDiffLeft",
@@ -10363,7 +10363,7 @@
1036310363
},
1036410364
{
1036510365
"command": "gitlens.openRevisionFile",
10366-
"when": "gitlens:activeFileStatus =~ /revision/ && isInDiffEditor"
10366+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && isInDiffEditor"
1036710367
},
1036810368
{
1036910369
"command": "gitlens.openRevisionFileInDiffLeft",
@@ -10375,7 +10375,7 @@
1037510375
},
1037610376
{
1037710377
"command": "gitlens.openWorkingFile",
10378-
"when": "gitlens:activeFileStatus =~ /revision/"
10378+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
1037910379
},
1038010380
{
1038110381
"command": "gitlens.openWorkingFileInDiffLeft",
@@ -10431,19 +10431,19 @@
1043110431
},
1043210432
{
1043310433
"command": "gitlens.browseRepoAtRevision",
10434-
"when": "!gitlens:hasVirtualFolders && gitlens:activeFileStatus =~ /revision/"
10434+
"when": "!gitlens:hasVirtualFolders && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
1043510435
},
1043610436
{
1043710437
"command": "gitlens.browseRepoAtRevisionInNewWindow",
10438-
"when": "!gitlens:hasVirtualFolders && gitlens:activeFileStatus =~ /revision/"
10438+
"when": "!gitlens:hasVirtualFolders && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
1043910439
},
1044010440
{
1044110441
"command": "gitlens.browseRepoBeforeRevision",
10442-
"when": "!gitlens:hasVirtualFolders && gitlens:activeFileStatus =~ /revision/"
10442+
"when": "!gitlens:hasVirtualFolders && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
1044310443
},
1044410444
{
1044510445
"command": "gitlens.browseRepoBeforeRevisionInNewWindow",
10446-
"when": "!gitlens:hasVirtualFolders && gitlens:activeFileStatus =~ /revision/"
10446+
"when": "!gitlens:hasVirtualFolders && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
1044710447
},
1044810448
{
1044910449
"command": "gitlens.views.browseRepoAtRevision",
@@ -12184,47 +12184,47 @@
1218412184
},
1218512185
{
1218612186
"command": "gitlens.diffWithWorking",
12187-
"when": "gitlens:activeFileStatus =~ /revision/ && resourceScheme =~ /^(?!(file|git)$).*$/ && !isInDiffEditor",
12187+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/ && !isInDiffEditor",
1218812188
"group": "navigation@-99"
1218912189
},
1219012190
{
1219112191
"command": "gitlens.diffWithWorkingInDiffLeft",
12192-
"when": "gitlens:activeFileStatus =~ /revision/ && resourceScheme =~ /^(?!(file|git)$).*$/ && isInDiffEditor && !isInDiffRightEditor",
12192+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/ && isInDiffEditor && !isInDiffRightEditor",
1219312193
"group": "navigation@-99"
1219412194
},
1219512195
{
1219612196
"command": "gitlens.diffWithWorkingInDiffRight",
12197-
"when": "gitlens:activeFileStatus =~ /revision/ && resourceScheme =~ /^(?!(file|git)$).*$/ && isInDiffRightEditor",
12197+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/ && isInDiffRightEditor",
1219812198
"group": "navigation@-99"
1219912199
},
1220012200
{
1220112201
"command": "gitlens.openWorkingFile",
12202-
"when": "gitlens:activeFileStatus =~ /revision/ && resourceScheme == git && !isInDiffEditor",
12202+
"when": "gitlens:enabled && resourceScheme == git && !isInDiffEditor",
1220312203
"group": "navigation@-98"
1220412204
},
1220512205
{
1220612206
"command": "gitlens.openWorkingFile",
12207-
"when": "gitlens:activeFileStatus =~ /revision/ && resourceScheme =~ /^(?!(file|git)$).*$/ && !isInDiffEditor",
12207+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/ && !isInDiffEditor",
1220812208
"group": "navigation@-98"
1220912209
},
1221012210
{
1221112211
"command": "gitlens.openWorkingFileInDiffLeft",
12212-
"when": "gitlens:activeFileStatus =~ /revision/ && resourceScheme =~ /^(?!(file|git)$).*$/ && isInDiffEditor && !isInDiffRightEditor",
12212+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/ && isInDiffEditor && !isInDiffRightEditor",
1221312213
"group": "navigation@-98"
1221412214
},
1221512215
{
1221612216
"command": "gitlens.openWorkingFileInDiffRight",
12217-
"when": "gitlens:activeFileStatus =~ /revision/ && resourceScheme =~ /^(?!(file|git)$).*$/ && isInDiffRightEditor",
12217+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/ && isInDiffRightEditor",
1221812218
"group": "navigation@-98"
1221912219
},
1222012220
{
1222112221
"command": "gitlens.openRevisionFileInDiffLeft",
12222-
"when": "gitlens:activeFileStatus =~ /revision/ && resourceScheme =~ /^(?!(file|git)$).*$/ && isInDiffEditor && !isInDiffRightEditor",
12222+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/ && isInDiffEditor && !isInDiffRightEditor",
1222312223
"group": "navigation@-97"
1222412224
},
1222512225
{
1222612226
"command": "gitlens.openRevisionFileInDiffRight",
12227-
"when": "gitlens:activeFileStatus =~ /revision/ && resourceScheme =~ /^(?!(file|git)$).*$/ && isInDiffRightEditor",
12227+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|pr)$/ && isInDiffRightEditor",
1222812228
"group": "navigation@-97"
1222912229
},
1223012230
{
@@ -16042,17 +16042,17 @@
1604216042
},
1604316043
{
1604416044
"command": "gitlens.showQuickRevisionDetails",
16045-
"when": "gitlens:activeFileStatus =~ /revision/ && !isInDiffEditor",
16045+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && !isInDiffEditor",
1604616046
"group": "3_gitlens@2"
1604716047
},
1604816048
{
1604916049
"command": "gitlens.showQuickRevisionDetailsInDiffLeft",
16050-
"when": "gitlens:activeFileStatus =~ /revision/ && isInDiffEditor && !isInDiffRightEditor",
16050+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && isInDiffEditor && !isInDiffRightEditor",
1605116051
"group": "3_gitlens@2"
1605216052
},
1605316053
{
1605416054
"command": "gitlens.showQuickRevisionDetailsInDiffRight",
16055-
"when": "gitlens:activeFileStatus =~ /revision/ && isInDiffRightEditor",
16055+
"when": "gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && isInDiffRightEditor",
1605616056
"group": "3_gitlens@2"
1605716057
}
1605816058
],
@@ -16854,46 +16854,46 @@
1685416854
{
1685516855
"command": "gitlens.diffWithNext",
1685616856
"key": "alt+.",
16857-
"when": "config.gitlens.keymap == alternate && editorTextFocus && gitlens:activeFileStatus =~ /revision/ && !isInDiffEditor"
16857+
"when": "config.gitlens.keymap == alternate && editorTextFocus && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && !isInDiffEditor"
1685816858
},
1685916859
{
1686016860
"command": "gitlens.diffWithNext",
1686116861
"key": "ctrl+shift+g .",
1686216862
"mac": "cmd+alt+g .",
16863-
"when": "config.gitlens.keymap == chorded && editorTextFocus && gitlens:activeFileStatus =~ /revision/ && !isInDiffEditor"
16863+
"when": "config.gitlens.keymap == chorded && editorTextFocus && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && !isInDiffEditor"
1686416864
},
1686516865
{
1686616866
"command": "gitlens.diffWithNextInDiffLeft",
1686716867
"key": "alt+.",
16868-
"when": "config.gitlens.keymap == alternate && editorTextFocus && gitlens:activeFileStatus =~ /revision/ && isInDiffEditor && !isInDiffRightEditor"
16868+
"when": "config.gitlens.keymap == alternate && editorTextFocus && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && isInDiffEditor && !isInDiffRightEditor"
1686916869
},
1687016870
{
1687116871
"command": "gitlens.diffWithNextInDiffLeft",
1687216872
"key": "ctrl+shift+g .",
1687316873
"mac": "cmd+alt+g .",
16874-
"when": "config.gitlens.keymap == chorded && editorTextFocus && gitlens:activeFileStatus =~ /revision/ && isInDiffEditor && !isInDiffRightEditor"
16874+
"when": "config.gitlens.keymap == chorded && editorTextFocus && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && isInDiffEditor && !isInDiffRightEditor"
1687516875
},
1687616876
{
1687716877
"command": "gitlens.diffWithNextInDiffRight",
1687816878
"key": "alt+.",
16879-
"when": "config.gitlens.keymap == alternate && editorTextFocus && gitlens:activeFileStatus =~ /revision/ && isInDiffRightEditor"
16879+
"when": "config.gitlens.keymap == alternate && editorTextFocus && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && isInDiffRightEditor"
1688016880
},
1688116881
{
1688216882
"command": "gitlens.diffWithNextInDiffRight",
1688316883
"key": "ctrl+shift+g .",
1688416884
"mac": "cmd+alt+g .",
16885-
"when": "config.gitlens.keymap == chorded && editorTextFocus && gitlens:activeFileStatus =~ /revision/ && isInDiffRightEditor"
16885+
"when": "config.gitlens.keymap == chorded && editorTextFocus && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/ && isInDiffRightEditor"
1688616886
},
1688716887
{
1688816888
"command": "gitlens.diffWithWorking",
1688916889
"key": "shift+alt+.",
16890-
"when": "config.gitlens.keymap == alternate && editorTextFocus && gitlens:activeFileStatus =~ /revision/"
16890+
"when": "config.gitlens.keymap == alternate && editorTextFocus && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
1689116891
},
1689216892
{
1689316893
"command": "gitlens.diffWithWorking",
1689416894
"key": "ctrl+shift+g shift+.",
1689516895
"mac": "cmd+alt+g shift+.",
16896-
"when": "config.gitlens.keymap == chorded && editorTextFocus && gitlens:activeFileStatus =~ /revision/"
16896+
"when": "config.gitlens.keymap == chorded && editorTextFocus && gitlens:enabled && resourceScheme =~ /^(gitlens|git|pr)$/"
1689716897
},
1689816898
{
1689916899
"command": "gitlens.diffLineWithPrevious",

src/trackers/trackedDocument.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { EventEmitter } from 'vscode';
33
import type { Container } from '../container';
44
import { GitUri } from '../git/gitUri';
55
import type { GitBlame } from '../git/models/blame';
6-
import { deletedOrMissing } from '../git/models/constants';
76
import type { GitDiffFile } from '../git/models/diff';
87
import type { GitLog } from '../git/models/log';
98
import { configuration } from '../system/configuration';
@@ -171,10 +170,6 @@ export class TrackedGitDocument implements Disposable {
171170
return true;
172171
}
173172

174-
get isRevision() {
175-
return this._uri != null ? Boolean(this._uri.sha) && this._uri.sha !== deletedOrMissing : false;
176-
}
177-
178173
private _isTracked: boolean = false;
179174
get isTracked() {
180175
return this._isTracked;
@@ -294,9 +289,6 @@ export class TrackedGitDocument implements Disposable {
294289
if (this.isBlameable) {
295290
status += 'blameable|';
296291
}
297-
if (this.isRevision) {
298-
status += 'revision|';
299-
}
300292
if (this.hasRemotes) {
301293
status += 'remotes|';
302294
}

0 commit comments

Comments
 (0)