Compare commits
601 Commits
0.0.2
...
v4.4.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3013a03d4 | ||
|
|
323148d9ab | ||
|
|
03fefaad3b | ||
|
|
f11c00ceda | ||
|
|
0e338308c6 | ||
|
|
e39bd5dad3 | ||
|
|
00cdd2e375 | ||
|
|
787e0e6aa1 | ||
|
|
46554e93f3 | ||
|
|
4160234962 | ||
|
|
0bd31099ce | ||
|
|
a272f8f6a4 | ||
|
|
e10d7eb648 | ||
|
|
9d9c3181f7 | ||
|
|
68a42fd0c7 | ||
|
|
28db0bf2f5 | ||
|
|
5f85388db7 | ||
|
|
4d167c3cdd | ||
|
|
4826e99986 | ||
|
|
459a8dce1d | ||
|
|
2650a84105 | ||
|
|
a2cd57cf95 | ||
|
|
62a148c156 | ||
|
|
be682c5def | ||
|
|
12d310bdf1 | ||
|
|
af4f433972 | ||
|
|
52275215fe | ||
|
|
71edb1b99a | ||
|
|
7f3fdb48fd | ||
|
|
81a9092455 | ||
|
|
d288985c26 | ||
|
|
b81d873a34 | ||
|
|
c96a659e9e | ||
|
|
d193676502 | ||
|
|
6410a274d5 | ||
|
|
272bb4db45 | ||
|
|
7fbee675f0 | ||
|
|
bc21272409 | ||
|
|
da450a614d | ||
|
|
0e4664bab1 | ||
|
|
1b4800571d | ||
|
|
c812a56eac | ||
|
|
3081632815 | ||
|
|
3d32d86998 | ||
|
|
0a9559f5a5 | ||
|
|
8693c87523 | ||
|
|
54c077eb8d | ||
|
|
ee124b5325 | ||
|
|
63a0646c8f | ||
|
|
cb360c5a3d | ||
|
|
3bf5f23c66 | ||
|
|
1751987868 | ||
|
|
9179b70875 | ||
|
|
93ea2c7145 | ||
|
|
f9275a8e1a | ||
|
|
ceb9c5e126 | ||
|
|
e42af14b11 | ||
|
|
bcfa2cb4d7 | ||
|
|
16963ee054 | ||
|
|
db1bdaa778 | ||
|
|
ccac13088c | ||
|
|
899a69357c | ||
|
|
c78c3c7525 | ||
|
|
1cbf0b2c73 | ||
|
|
191a158b3b | ||
|
|
f553980146 | ||
|
|
a306ba2b98 | ||
|
|
1cdd94cb46 | ||
|
|
12caa017a9 | ||
|
|
ad790b274b | ||
|
|
55ef004332 | ||
|
|
329d5a496d | ||
|
|
6b4642d8c8 | ||
|
|
45aa9b17ac | ||
|
|
9b908e27ba | ||
|
|
0eb6026a82 | ||
|
|
5823457ea0 | ||
|
|
64b929fd5b | ||
|
|
a618b7efe6 | ||
|
|
a2903ce4a9 | ||
|
|
12debe583c | ||
|
|
0160e064be | ||
|
|
76961d6697 | ||
|
|
cc827f4711 | ||
|
|
6f3441a9e7 | ||
|
|
64ae82075e | ||
|
|
5624567daa | ||
|
|
c1c65127b7 | ||
|
|
ce98f02706 | ||
|
|
7f2ec30164 | ||
|
|
48a1ca704d | ||
|
|
23c7171d7f | ||
|
|
dd0b95498e | ||
|
|
e6316400f0 | ||
|
|
eeff31cf27 | ||
|
|
eb3b9ad6c9 | ||
|
|
10674124c8 | ||
|
|
e0f66247cf | ||
|
|
badd999db1 | ||
|
|
9ae4cc36a1 | ||
|
|
30bb4398a3 | ||
|
|
9c7a971e21 | ||
|
|
ba59fb29ad | ||
|
|
50ba3e1446 | ||
|
|
62e5ef6225 | ||
|
|
ed54d289dd | ||
|
|
2a8dafd9e9 | ||
|
|
016c561ead | ||
|
|
9cf86a41ec | ||
|
|
4eb1c3e36a | ||
|
|
95e0a6c71b | ||
|
|
35ca8106c9 | ||
|
|
948a75de79 | ||
|
|
4b0891b949 | ||
|
|
a9d94868e7 | ||
|
|
3c45c7e049 | ||
|
|
ba0d55d5d4 | ||
|
|
d2dc172042 | ||
|
|
e5e582d300 | ||
|
|
7c9e4b911c | ||
|
|
42fdf9f327 | ||
|
|
547d50fed6 | ||
|
|
6c33686335 | ||
|
|
28355d41b6 | ||
|
|
6e5bb2343e | ||
|
|
d01c592533 | ||
|
|
37e48ded2d | ||
|
|
e3e7605268 | ||
|
|
f16c3857e5 | ||
|
|
5298511bb9 | ||
|
|
4400ab1da9 | ||
|
|
6a9977b954 | ||
|
|
c0d5f55baa | ||
|
|
68f6ae8f3a | ||
|
|
53c691898f | ||
|
|
365af9c54b | ||
|
|
55b1a66ec0 | ||
|
|
522e5a49a2 | ||
|
|
e99febb52d | ||
|
|
2036c8abaf | ||
|
|
021a5b833a | ||
|
|
f1042de9c7 | ||
|
|
efd3d40aa8 | ||
|
|
9c7062020e | ||
|
|
9da80c121b | ||
|
|
5380724323 | ||
|
|
77651701aa | ||
|
|
bb834f2e0a | ||
|
|
535e627048 | ||
|
|
8a74950708 | ||
|
|
3502bdf6c7 | ||
|
|
23db83832c | ||
|
|
807b1f1ea3 | ||
|
|
6232b8087f | ||
|
|
b783bfdf10 | ||
|
|
b8322f19cd | ||
|
|
8623e661ca | ||
|
|
c3bd17edee | ||
|
|
b17640ba57 | ||
|
|
f6a18458df | ||
|
|
e1b1b737d9 | ||
|
|
19e523d6e4 | ||
|
|
ff1597d64f | ||
|
|
49cc681520 | ||
|
|
6d1a1ca346 | ||
|
|
49fa9b5078 | ||
|
|
ec6ca8188c | ||
|
|
034a01c7d1 | ||
|
|
15ebde445d | ||
|
|
f184feda2c | ||
|
|
d35074ecf8 | ||
|
|
4d62e5cdad | ||
|
|
ce5ff1eb47 | ||
|
|
3a38f6ae39 | ||
|
|
3e403a2d5c | ||
|
|
83fff1590d | ||
|
|
27425e3deb | ||
|
|
dbdb77c2c1 | ||
|
|
263bdc728a | ||
|
|
0ef1e509a6 | ||
|
|
9a35fc6b47 | ||
|
|
078f3fd482 | ||
|
|
33ef9687f2 | ||
|
|
361789f859 | ||
|
|
1acc183621 | ||
|
|
ee29596d45 | ||
|
|
90245b1111 | ||
|
|
a69c83f64f | ||
|
|
6f04514a27 | ||
|
|
6eccb2a8da | ||
|
|
d86b18bc7a | ||
|
|
3f5798357e | ||
|
|
23065e1177 | ||
|
|
dba7c2ea52 | ||
|
|
8f40ba8542 | ||
|
|
b477b34278 | ||
|
|
a8b0aaa3e3 | ||
|
|
071bfdb82e | ||
|
|
474741aeb4 | ||
|
|
187f7881ca | ||
|
|
14b9d93807 | ||
|
|
ba346da54b | ||
|
|
564856853a | ||
|
|
3e0ad47698 | ||
|
|
675050d923 | ||
|
|
6af753c0ae | ||
|
|
bb59f2899a | ||
|
|
cfafa8c020 | ||
|
|
f99ba89a4b | ||
|
|
8f2ec85c6b | ||
|
|
b58c48841f | ||
|
|
d3800a1ae8 | ||
|
|
4a379511d5 | ||
|
|
e5a94bb2ff | ||
|
|
224200e32a | ||
|
|
a285fb5505 | ||
|
|
cd5faa1336 | ||
|
|
c09deb54b1 | ||
|
|
bc747e9d5f | ||
|
|
ce0842f41c | ||
|
|
0cf107a817 | ||
|
|
5fc567372c | ||
|
|
0875cc12d5 | ||
|
|
04a6574f16 | ||
|
|
25696ffa94 | ||
|
|
feea0e62fc | ||
|
|
c5993fe145 | ||
|
|
67dfcb6226 | ||
|
|
7c0bc78574 | ||
|
|
8fb61e7ab5 | ||
|
|
b38f357bc2 | ||
|
|
6db6eff6b7 | ||
|
|
c05fcdc1bd | ||
|
|
d7b28e1a56 | ||
|
|
065300be06 | ||
|
|
9afa06c00d | ||
|
|
99aa4ee74b | ||
|
|
89474a2aa6 | ||
|
|
35694303c4 | ||
|
|
a5be6f0533 | ||
|
|
e5653d1c66 | ||
|
|
7643e338c5 | ||
|
|
0854e0bcfb | ||
|
|
2a9b274920 | ||
|
|
82bd510593 | ||
|
|
b334d5ff66 | ||
|
|
9fed706fd2 | ||
|
|
4707b0640d | ||
|
|
3aab904aaf | ||
|
|
0d19224a97 | ||
|
|
a7dc29a9aa | ||
|
|
7cb1b9d0f1 | ||
|
|
b70ffbdeee | ||
|
|
9292fc23a8 | ||
|
|
6a3428e6d2 | ||
|
|
4c4d21741e | ||
|
|
d59f4ef6dc | ||
|
|
0c13050387 | ||
|
|
3b195b6be2 | ||
|
|
b961646c95 | ||
|
|
d3af67b21b | ||
|
|
7ce5a396a1 | ||
|
|
c36bc2692d | ||
|
|
276c24ac24 | ||
|
|
aff8aff011 | ||
|
|
ab2bf893e1 | ||
|
|
d8564c215c | ||
|
|
e3c9fd53ca | ||
|
|
640a11b3cb | ||
|
|
9aadf73407 | ||
|
|
7b63d4f437 | ||
|
|
0686c882c8 | ||
|
|
0dda92cf8d | ||
|
|
dcbf70682e | ||
|
|
2a70e5b4cb | ||
|
|
9945ee6d94 | ||
|
|
19fe22f061 | ||
|
|
8b0748608d | ||
|
|
aa39792843 | ||
|
|
073353dcda | ||
|
|
296e562d9f | ||
|
|
d0b4c2fd5c | ||
|
|
8a0e27b7df | ||
|
|
a724244914 | ||
|
|
851522f593 | ||
|
|
ab417eadbe | ||
|
|
9071b55026 | ||
|
|
6d8a37a10f | ||
|
|
9d176db16a | ||
|
|
e7604ed863 | ||
|
|
e1190d50a4 | ||
|
|
5c2712bcb7 | ||
|
|
61f002420a | ||
|
|
f632829822 | ||
|
|
de8ce58e09 | ||
|
|
46ff70e969 | ||
|
|
758d331e69 | ||
|
|
ace0ac7018 | ||
|
|
81cfec1cac | ||
|
|
29ef718f64 | ||
|
|
4e67a84531 | ||
|
|
291c53cd19 | ||
|
|
e0b3dcd484 | ||
|
|
c500293032 | ||
|
|
e1349bb1c6 | ||
|
|
e33fd00119 | ||
|
|
3856cfd110 | ||
|
|
8b5eed4714 | ||
|
|
c10a79a7ee | ||
|
|
ee40dc6325 | ||
|
|
0aab16357c | ||
|
|
e859f697ec | ||
|
|
e906bfcb9e | ||
|
|
a90d3f98de | ||
|
|
964cf2d5dd | ||
|
|
ea2adcd919 | ||
|
|
0feaf285cd | ||
|
|
4d1cfd6413 | ||
|
|
4f84c03275 | ||
|
|
ba69a19eeb | ||
|
|
5a0a2f3b61 | ||
|
|
0a7a88c302 | ||
|
|
1fb2826f5c | ||
|
|
b9fb4bea56 | ||
|
|
9867e7065d | ||
|
|
43e4337358 | ||
|
|
671f1ca6c1 | ||
|
|
dd0762152f | ||
|
|
823e93080e | ||
|
|
33debb6bb2 | ||
|
|
0c348cdb0f | ||
|
|
2f0a25720a | ||
|
|
4e3ccd9581 | ||
|
|
97f88489a4 | ||
|
|
3e84ec88e2 | ||
|
|
a5d1d74d7b | ||
|
|
d53caa2137 | ||
|
|
49a8896571 | ||
|
|
7a51946eda | ||
|
|
ef74ae0950 | ||
|
|
14eebbba15 | ||
|
|
1c5e627f8e | ||
|
|
343d2f9be1 | ||
|
|
73bbbc1d5f | ||
|
|
164cb2bfe0 | ||
|
|
b51d25829b | ||
|
|
9a0ce83260 | ||
|
|
036f0639aa | ||
|
|
14604435db | ||
|
|
7c01f40b3c | ||
|
|
dad85b3c0a | ||
|
|
332b2c3b91 | ||
|
|
f6bde72baf | ||
|
|
6074a06fc9 | ||
|
|
937c56e554 | ||
|
|
b6ce03b806 | ||
|
|
4898c11eb5 | ||
|
|
9c2269b9f1 | ||
|
|
2ef6c37c89 | ||
|
|
564a0b8f64 | ||
|
|
b61e714110 | ||
|
|
a58d643ca1 | ||
|
|
3656d4e8a4 | ||
|
|
3e815f6bf8 | ||
|
|
487fb5197c | ||
|
|
89a2471736 | ||
|
|
b40ad7eced | ||
|
|
7aefd178c2 | ||
|
|
a2a3f1a81e | ||
|
|
f499bffbc6 | ||
|
|
3435ada188 | ||
|
|
1b21893d72 | ||
|
|
a37a80d704 | ||
|
|
e7fedb3c51 | ||
|
|
762fa545c7 | ||
|
|
df838e883a | ||
|
|
0480477136 | ||
|
|
88c09bec6d | ||
|
|
53da45fe4f | ||
|
|
edcb13aaaa | ||
|
|
eaea44872c | ||
|
|
1c29fa3f33 | ||
|
|
037446f38e | ||
|
|
c05fd0b976 | ||
|
|
f1ec0ec0b2 | ||
|
|
0958c152fe | ||
|
|
9f91f851c9 | ||
|
|
aeab246e0a | ||
|
|
4da21c3cc1 | ||
|
|
a3a4a5bc49 | ||
|
|
c5c1e24c62 | ||
|
|
bddf89bc35 | ||
|
|
1519898dfa | ||
|
|
d389a7b588 | ||
|
|
2e2462dd46 | ||
|
|
cf04a982e4 | ||
|
|
628f0c3cc1 | ||
|
|
d502694ba6 | ||
|
|
098d356652 | ||
|
|
6bff9a8f7b | ||
|
|
796730c22f | ||
|
|
5bdb5a1847 | ||
|
|
f837de7430 | ||
|
|
3caeb2ca9b | ||
|
|
5e19cc6adf | ||
|
|
74845f979b | ||
|
|
a98f400375 | ||
|
|
1a244c6296 | ||
|
|
dfd0f8c365 | ||
|
|
226e98dd04 | ||
|
|
3c8fe9efb8 | ||
|
|
41fd06e491 | ||
|
|
ccd0ad67a3 | ||
|
|
aff36efeca | ||
|
|
0f0a653c4c | ||
|
|
73c58bc923 | ||
|
|
5ffd4753bd | ||
|
|
05ff9804bc | ||
|
|
00e9660227 | ||
|
|
66d11c37e2 | ||
|
|
780423b195 | ||
|
|
a552332234 | ||
|
|
0a4cdd81eb | ||
|
|
bcfb0cd24d | ||
|
|
a2f4c4c953 | ||
|
|
237e464c44 | ||
|
|
7100c8f938 | ||
|
|
85826eb091 | ||
|
|
b530c3d6a2 | ||
|
|
b81f2f2fa0 | ||
|
|
add76fc5fc | ||
|
|
ecaf7cd45c | ||
|
|
7bdeae8d83 | ||
|
|
b637678d34 | ||
|
|
84bc19318d | ||
|
|
9da3d26fc6 | ||
|
|
a6d321590d | ||
|
|
de98e6bef4 | ||
|
|
f21a228ed5 | ||
|
|
7600a8e86e | ||
|
|
1263064150 | ||
|
|
cf8c07f49e | ||
|
|
4a88edd5ca | ||
|
|
fc09e3a700 | ||
|
|
dda00c75c9 | ||
|
|
1062188733 | ||
|
|
dc26d90ebc | ||
|
|
217e349ac1 | ||
|
|
9adb14aec8 | ||
|
|
5eb4a778e8 | ||
|
|
46039dbf24 | ||
|
|
d8d221a624 | ||
|
|
120f5ae6fc | ||
|
|
360c38e536 | ||
|
|
29c16b13bf | ||
|
|
66039e8dbe | ||
|
|
9c74224387 | ||
|
|
c4c8aa3bd3 | ||
|
|
28fced1b80 | ||
|
|
a4d55bcbcc | ||
|
|
ca5845018f | ||
|
|
0147645dc9 | ||
|
|
46e355e02e | ||
|
|
d9e638df01 | ||
|
|
1a47935719 | ||
|
|
9ac9a83fbf | ||
|
|
305674d71a | ||
|
|
afe8d38fdb | ||
|
|
cd581f5c56 | ||
|
|
af5b8b7e09 | ||
|
|
bf176301af | ||
|
|
51ef25f366 | ||
|
|
b17c43ba9a | ||
|
|
4d0c18f330 | ||
|
|
0d7633c78a | ||
|
|
8594a5dd38 | ||
|
|
beb6740120 | ||
|
|
6504b7822c | ||
|
|
25aa1fe3ca | ||
|
|
9b92c48759 | ||
|
|
46f325e9a0 | ||
|
|
48b33d47ca | ||
|
|
5f147f6262 | ||
|
|
d5d0c3a28d | ||
|
|
3ef538b713 | ||
|
|
310a547581 | ||
|
|
6641233284 | ||
|
|
aaa1b78d29 | ||
|
|
f66ba92e3c | ||
|
|
4e9e6000ec | ||
|
|
6d4703affb | ||
|
|
9a8045b6f2 | ||
|
|
b0fbbc718c | ||
|
|
e12ec7093c | ||
|
|
615f55574b | ||
|
|
8111190d84 | ||
|
|
80aa43a84b | ||
|
|
3389024a2a | ||
|
|
62c5094b06 | ||
|
|
e1cf928992 | ||
|
|
f53ecf8a7e | ||
|
|
30248a7f97 | ||
|
|
c259f94d3e | ||
|
|
9a394de681 | ||
|
|
a18eaaaee6 | ||
|
|
d181065d03 | ||
|
|
964cfd363e | ||
|
|
b0257ca040 | ||
|
|
9edf629c3b | ||
|
|
dfacc2bf6e | ||
|
|
589ec6cef3 | ||
|
|
50cf8861cd | ||
|
|
15c81ef36f | ||
|
|
7352a70662 | ||
|
|
79ad799511 | ||
|
|
2b907788dd | ||
|
|
25007f7b69 | ||
|
|
ea375f478f | ||
|
|
6c536e9360 | ||
|
|
ca7f39629d | ||
|
|
6fefab6d64 | ||
|
|
ff8b184bef | ||
|
|
d2ad2b6a0f | ||
|
|
79e5370a13 | ||
|
|
a6f5fa59e4 | ||
|
|
680d31d43d | ||
|
|
567533622c | ||
|
|
a52b0c9b73 | ||
|
|
4e65eb6344 | ||
|
|
72ef5e2902 | ||
|
|
1a208b8691 | ||
|
|
39aa6180ca | ||
|
|
a8ab3a5af4 | ||
|
|
615485cd21 | ||
|
|
a91afffbb2 | ||
|
|
5f0acc2693 | ||
|
|
d3ffabd76b | ||
|
|
5cb0053a05 | ||
|
|
968eb6e7eb | ||
|
|
438dad437f | ||
|
|
60b464ca22 | ||
|
|
354b823d7d | ||
|
|
e9db04f0c7 | ||
|
|
e31a1a3473 | ||
|
|
46e2378779 | ||
|
|
fee9562dd1 | ||
|
|
9c0a38958e | ||
|
|
a3895d27ab | ||
|
|
638a6dc838 | ||
|
|
7ace9cb152 | ||
|
|
f4410be30a | ||
|
|
562afeaaad | ||
|
|
409be335f9 | ||
|
|
8df6b80725 | ||
|
|
d2d72f0d54 | ||
|
|
23b2c679a9 | ||
|
|
157928311e | ||
|
|
b047fbc394 | ||
|
|
7a4dcae8c7 | ||
|
|
a734ffe9ed | ||
|
|
834b4904db | ||
|
|
c4b8637946 | ||
|
|
20df7732be | ||
|
|
30b1fba8d4 | ||
|
|
7b4dd77fbc | ||
|
|
14e9c5b4fa | ||
|
|
69c4d44b49 | ||
|
|
7ebdaa0775 | ||
|
|
ff01054f90 | ||
|
|
c69a160ea5 | ||
|
|
05865d014e | ||
|
|
cb81a823e6 | ||
|
|
7a604191a7 | ||
|
|
b617a90c5b | ||
|
|
2be76ed8a8 | ||
|
|
dcb789f58d | ||
|
|
f34686de36 | ||
|
|
0ee09d9d87 | ||
|
|
7fa0b9d01b | ||
|
|
fba6def3e4 | ||
|
|
dfd17a8f17 | ||
|
|
d70a47201c | ||
|
|
e0cf335811 | ||
|
|
87215850b7 | ||
|
|
a2eee23d7f | ||
|
|
19c0e46729 | ||
|
|
26ce5f7d53 | ||
|
|
67e1a6b78f | ||
|
|
fbcd0a9cd6 | ||
|
|
e929db0106 | ||
|
|
b7920f3c3d | ||
|
|
d04696ac1d | ||
|
|
ebb1085562 | ||
|
|
47ce5c5132 | ||
|
|
f08339335d | ||
|
|
f4d3d1718d | ||
|
|
ea33560f14 | ||
|
|
70cc92ddd6 | ||
|
|
0e064f15c7 | ||
|
|
9964ea691b | ||
|
|
92beca2542 |
8
.vscode/launch.json
vendored
@@ -10,8 +10,8 @@
|
|||||||
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
|
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
|
||||||
"stopOnEntry": false,
|
"stopOnEntry": false,
|
||||||
"sourceMaps": true,
|
"sourceMaps": true,
|
||||||
"outDir": "${workspaceRoot}/out/src",
|
"outFiles": ["${workspaceRoot}/out/src/**/*.js"],
|
||||||
"preLaunchTask": "npm"
|
"preLaunchTask": "compile"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Launch Tests",
|
"name": "Launch Tests",
|
||||||
@@ -21,8 +21,8 @@
|
|||||||
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
|
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
|
||||||
"stopOnEntry": false,
|
"stopOnEntry": false,
|
||||||
"sourceMaps": true,
|
"sourceMaps": true,
|
||||||
"outDir": "${workspaceRoot}/out/test",
|
"outFiles": ["${workspaceRoot}/out/test/**/*.js"],
|
||||||
"preLaunchTask": "npm"
|
"preLaunchTask": "compile"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
12
.vscode/settings.json
vendored
@@ -1,12 +1,14 @@
|
|||||||
// Place your settings in this file to overwrite default and user settings.
|
|
||||||
{
|
{
|
||||||
|
"editor.insertSpaces": true,
|
||||||
"files.exclude": {
|
"files.exclude": {
|
||||||
"out": false, // set this to true to hide the "out" folder with the compiled JS files
|
"**/node_modules": true,
|
||||||
"node_modules": false
|
"**/out": true
|
||||||
},
|
},
|
||||||
|
"files.trimTrailingWhitespace": true,
|
||||||
"search.exclude": {
|
"search.exclude": {
|
||||||
"out": true, // set this to false to include "out" folder in search results
|
"**/node_modules": true,
|
||||||
"node_modules": true
|
"**/out": true
|
||||||
},
|
},
|
||||||
|
"javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
|
||||||
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
|
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
|
||||||
}
|
}
|
||||||
55
.vscode/tasks.json
vendored
@@ -8,23 +8,40 @@
|
|||||||
|
|
||||||
// A task runner that calls a custom npm script that compiles the extension.
|
// A task runner that calls a custom npm script that compiles the extension.
|
||||||
{
|
{
|
||||||
"version": "0.1.0",
|
"version": "2.0.0",
|
||||||
|
"presentation": {
|
||||||
// we want to run npm
|
"echo": true,
|
||||||
"command": "npm",
|
"reveal": "always",
|
||||||
|
"focus": false,
|
||||||
// the command is a shell script
|
"panel": "shared"
|
||||||
"isShellCommand": true,
|
},
|
||||||
|
"tasks": [
|
||||||
// show the output window only if unrecognized errors occur.
|
{
|
||||||
"showOutput": "silent",
|
"label": "compile",
|
||||||
|
"type": "npm",
|
||||||
// we run the custom script "compile" as defined in package.json
|
"script": "compile",
|
||||||
"args": ["run", "compile", "--loglevel", "silent"],
|
"group": "build",
|
||||||
|
"problemMatcher": [
|
||||||
// The tsc compiler is started in watching mode
|
"$tsc",
|
||||||
"isWatching": true,
|
{
|
||||||
|
"base": "$tslint5",
|
||||||
// use the standard tsc in watch mode problem matcher to find compile problems in the output.
|
"fileLocation": "relative"
|
||||||
"problemMatcher": "$tsc-watch"
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "npm",
|
||||||
|
"script": "lint",
|
||||||
|
"problemMatcher": {
|
||||||
|
"base": "$tslint5",
|
||||||
|
"fileLocation": "relative"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "npm",
|
||||||
|
"script": "watch",
|
||||||
|
"isBackground": true,
|
||||||
|
"problemMatcher": "$tsc-watch"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
@@ -1,9 +1,13 @@
|
|||||||
|
!images/dark/**
|
||||||
|
!images/light/**
|
||||||
|
!images/gitlens-icon.png
|
||||||
|
images/**
|
||||||
.vscode/**
|
.vscode/**
|
||||||
typings/**
|
.vscode-test/**
|
||||||
out/test/**
|
out/test/**
|
||||||
test/**
|
test/**
|
||||||
src/**
|
src/**
|
||||||
**/*.map
|
**/*.map
|
||||||
.gitignore
|
.gitignore
|
||||||
tsconfig.json
|
tsconfig.json
|
||||||
vsc-extension-quickstart.md
|
tslint.json
|
||||||
885
CHANGELOG.md
Normal file
@@ -0,0 +1,885 @@
|
|||||||
|
# Change Log
|
||||||
|
|
||||||
|
All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
|
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
|
|
||||||
|
## [4.4.0-beta] - 2017-08-17
|
||||||
|
## Added
|
||||||
|
- Adds a progress indicator to the `Toggle File Blame Annotations` command (`gitlens.toggleFileBlame`) icon -- pulses while annotations are computed
|
||||||
|
- Adds an active state to the `Toggle File Blame Annotations` command (`gitlens.toggleFileBlame`) icon -- turns orange while the annotations are visible
|
||||||
|
- Adds automatic disabling of the current line blame annotations when starting a debug session and will restore them when the debug session ends -- can still be manually toggled via the `Toggle Line Blame Annotations` command (`gitlens.toggleLineBlame`)
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
- Changes chat links from Gitter to [Slack](https://join.slack.com/t/vscode-gitlens/shared_invite/MjIxOTgxNDE3NzM0LTE1MDE2Nzk1MTgtMjkwMmZjMzcxNQ)
|
||||||
|
- Changes the look of the line separators on the gutter blame annotations
|
||||||
|
- Changes the `gitlens.advanced.toggleWhitespace.enabled` configuration setting to default to `false` -- as this should no longer be required
|
||||||
|
|
||||||
|
## Removed
|
||||||
|
- Removes unneeded `gitlens.stashExplorer.enabled` configuration setting since users can add or remove custom views natively now
|
||||||
|
- Removes unneeded `Toggle Git Stashed Explorer` command (`gitlens.stashExplorer.toggle`) since users can add or remove custom views natively now
|
||||||
|
- Removes the `gitlens.theme.annotations.file.hover.separateLines` configuration setting
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- Fixes jumpiness when opening a diff to a certain line
|
||||||
|
|
||||||
|
## [4.3.3] - 2017-07-28
|
||||||
|
## Added
|
||||||
|
- Adds progress indicator for when computing annotations takes a while
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
- Optimizes performance of the providing blame annotations, especially for large files (saw a 3.5x improvement on some files)
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- Fixes [#107](https://github.com/eamodio/vscode-gitlens/issues/107) - Double-byte characters break blame layout (still requires proper font support)
|
||||||
|
|
||||||
|
## [4.3.2] - 2017-07-20
|
||||||
|
## Fixed
|
||||||
|
- Fixes [#118](https://github.com/eamodio/vscode-gitlens/issues/118) - GitLens stopped working on latest insiders build -- thanks to [PR #121](https://github.com/eamodio/vscode-gitlens/pull/121) by Johannes Rieken ([@jrieken](https://github.com/jrieken))
|
||||||
|
|
||||||
|
## [4.3.1] - 2017-07-03
|
||||||
|
## Added
|
||||||
|
- Adds `gitlens.stashExplorer.enabled` setting to specify whether or not to show the `Git Stashes` explorer
|
||||||
|
- Adds `Toggle Git Stashed Explorer` command (`gitlens.stashExplorer.toggle`) - toggles the `Git Stashes` explorer on and off
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
- Hides the `Git Stashes` explorer by default
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
- Fixes [#108](https://github.com/eamodio/vscode-gitlens/issues/108) - Option to remove stash explorer from the main explorer?
|
||||||
|
|
||||||
|
## [4.3.0] - 2017-07-03
|
||||||
|
## Added
|
||||||
|
- Adds `Git Stashes` view to the Explorer activity
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Shows all of the stashed changes in the repository
|
||||||
|
- Provides toolbar buttons to `Stash Changes` and `Refresh`
|
||||||
|
- Provides a context menu with `Apply Stashed Changes` and `Delete Stashed Changes` commands - both require a confirmation
|
||||||
|
- Expand each stash to quickly see the set of files changed, complete with status indicators for adds, changes, renames, and deletes
|
||||||
|
- Provides a context menu with `Open Changes`, `Open File`, `Open Stashed File`, `Open File in Remote`, and `Compare File with Working Tree` commands
|
||||||
|
|
||||||
|
## [4.2.0] - 2017-06-27
|
||||||
|
## Added
|
||||||
|
- Adds `Compare File with Revision...` command (`gitlens.diffWithRevision`) - compare the active file with the selected revision of the same file
|
||||||
|
- Adds `Open Changed Files` command (`gitlens.openChangedFiles`) to the source control group context menu
|
||||||
|
- Adds `Close Unchanged Files` command (`gitlens.closeUnchangedFiles`) to the source control group context menu
|
||||||
|
- Adds `Open File in Remote` command (`gitlens.openFileInRemote`) to the source control resource context menu
|
||||||
|
- Adds `Compare File with Revision...` command (`gitlens.diffWithRevision`) to the source control resource context menu
|
||||||
|
- Adds `Show File History` command (`gitlens.showQuickFileHistory`) to the source control resource context menu
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
- Renames `Compare File with...` command to `Compare File with Branch...`
|
||||||
|
- Renames `Open Line Commit in Remote` command to `Open Commit in Remote`
|
||||||
|
- Renames `Show Line Commit Details` command to `Show Commit File Details`
|
||||||
|
- Updates the description of `gitlens.blame.line.enabled` to be clearer about its behavior
|
||||||
|
- Updates the description of `gitlens.codeLens.enabled` to be clearer about its behavior
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#103](https://github.com/eamodio/vscode-gitlens/issues/103) - Toggle file blame annotations disables line blame annotations if line blame annotations are off by default
|
||||||
|
- Fixes another infinite loop in the `Close Unchanged Files` command
|
||||||
|
|
||||||
|
## [4.1.4] - 2017-06-25
|
||||||
|
## Changed
|
||||||
|
- Optimizes performance of the `Compare with Previous` commands - also avoids trying to focus a line if we don't have one
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes `changes` (diff) hover not showing the correct previous line (for real this time)
|
||||||
|
- Attempts to fix [#99](https://github.com/eamodio/vscode-gitlens/issues/99) - undo/redo spawns too many git processes
|
||||||
|
|
||||||
|
## [4.1.3] - 2017-06-20
|
||||||
|
### Fixed
|
||||||
|
- Fixes `changes` (diff) hover not showing the correct previous line when showing recent changes annotations of the whole-file
|
||||||
|
|
||||||
|
## [4.1.2] - 2017-06-15
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#96](https://github.com/eamodio/vscode-gitlens/issues/96) - External diff command can be unintentionally triggered
|
||||||
|
|
||||||
|
## [4.1.1] - 2017-06-13
|
||||||
|
### Added
|
||||||
|
- Adds an `alt` command to the `Toggle File Blame Annotations` command button, which when you hold down `alt` and click it will execute the `Toggle Recent File Changes Annotations` command instead
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes missing `Toggle File Blame Annotations` command icon
|
||||||
|
|
||||||
|
## [4.1.0] - 2017-06-13
|
||||||
|
### Added
|
||||||
|
- Adds all-new recent changes annotations of the whole-file - annotates and highlights all of lines changed in the most recent commit
|
||||||
|
- Can customize the [layout](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#file-recent-changes-annotation-settings), as well as the [theme](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#theme-settings)
|
||||||
|
- Adds `Toggle Recent File Changes Annotations` command (`gitlens.toggleFileRecentChanges`) - toggles the recent changes annotations on and off
|
||||||
|
- Adds ability to press `Escape` to quickly toggle any whole-file annotations off
|
||||||
|
- Improves performance
|
||||||
|
- Optimized git output parsing to increase speed and dramatically reduce memory usage
|
||||||
|
- Defers diff chunk parsing until it is actually required
|
||||||
|
- Adds `gitlens.defaultDateFormat` setting to specify how all absolute dates will be formatted by default
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes excessive memory usage when parsing diffs
|
||||||
|
- Fixes extra newline in multiline commit messages
|
||||||
|
- Fixes (again) [#33](https://github.com/eamodio/vscode-gitlens/issues/33) - Commit messages can causes markdown formatting in hovers
|
||||||
|
|
||||||
|
## [4.0.1] - 2017-06-09
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#87](https://github.com/eamodio/vscode-gitlens/issues/87) - Can't open files in remote when using git@ urls (ssh)
|
||||||
|
|
||||||
|
## [4.0.0] - 2017-06-09
|
||||||
|
### Added
|
||||||
|
- Adds all-new, beautiful, highly customizable and themeable, file blame annotations
|
||||||
|
- Can now fully customize the [layout and content](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#file-blame-annotation-settings), as well as the [theme](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#theme-settings)
|
||||||
|
- Adds all-new configurability and themeability to the current line blame annotations
|
||||||
|
- Can now fully customize the [layout and content](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#line-blame-annotation-settings), as well as the [theme](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#theme-settings)
|
||||||
|
- Adds all-new configurability to the status bar blame information
|
||||||
|
- Can now fully customize the [layout and content](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#status-bar-settings)
|
||||||
|
- Adds all-new [configurability](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#advanced-settings) over which commands are added to which menus via the `gitlens.advanced.menus` setting
|
||||||
|
- Adds better [configurability](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#code-lens-settings) over where Git code lens will be shown -- both by default and per language
|
||||||
|
- Adds an all-new `changes` (diff) hover annotation to the current line - provides instant access to the line's previous version
|
||||||
|
- Adds `Toggle Line Blame Annotations` command (`gitlens.toggleLineBlame`) - toggles the current line blame annotations on and off
|
||||||
|
- Adds `Show Line Blame Annotations` command (`gitlens.showLineBlame`) - shows the current line blame annotations
|
||||||
|
- Adds `Toggle File Blame Annotations` command (`gitlens.toggleFileBlame`) - toggles the file blame annotations on and off
|
||||||
|
- Adds `Show File Blame Annotations` command (`gitlens.showFileBlame`) - shows the file blame annotations
|
||||||
|
- Adds `Open File in Remote` command (`gitlens.openFileInRemote`) to the `editor/title` context menu
|
||||||
|
- Adds `Open Repo in Remote` command (`gitlens.openRepoInRemote`) to the `editor/title` context menu
|
||||||
|
- Adds `gitlens.strings.*` settings to allow for the customization of certain strings displayed
|
||||||
|
- Adds `gitlens.theme.*` settings to allow for the theming of certain elements
|
||||||
|
- Adds `gitlens.advanced.telemetry.enabled` settings to explicitly opt-in or out of telemetry, but still ultimately honors the `telemetry.enableTelemetry` setting
|
||||||
|
- Adds ability to suppress most warning messages - which can be re-enabled using the `Reset Suppressed Warnings` command (`gitlens.resetSuppressedWarnings`)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- (BREAKING) Almost all of the GitLens settings have either been renamed, removed, or otherwise changed - see the [README](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens#extension-settings)`
|
||||||
|
- Changes the positioning of the Git code lens to try to be at the end of any other code lens on the same line
|
||||||
|
- Changes the position of the `Open File in Remote` command (`gitlens.openFileInRemote`) in the context menus - now in the `navigation` group
|
||||||
|
- Changes the `Toggle Git Code Lens` command (`gitlens.toggleCodeLens`) to always toggle the Git code lens on and off
|
||||||
|
- Changes the default of `gitlens.advanced.toggleWhitespace.enabled` back to `true`, but automatically disables whitespace toggling if whitespace rendering is not on
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Removes the on-demand `trailing` file blame annotations -- didn't work out and just ended up with a ton of visual noise
|
||||||
|
- Removes `Toggle Blame Annotations` command (`gitlens.toggleBlame`) - replaced by the `Toggle File Blame Annotations` command (`gitlens.toggleFileBlame`)
|
||||||
|
- Removes `Show Blame Annotations` command (`gitlens.showBlame`) - replaced by the `Show File Blame Annotations` command (`gitlens.showFileBlame`)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#81](https://github.com/eamodio/vscode-gitlens/issues/81) - Current line annotation feels too sticky
|
||||||
|
- Fixes [#83](https://github.com/eamodio/vscode-gitlens/issues/83) - Calling "close unchanged files" results in no new files being openable
|
||||||
|
- Fixes issues with the zone.js monkey patching done by application insights (telemetry) - disables all the monkey patching
|
||||||
|
- Fixes issue with `Open Branch in Remote` & `Open Repository in Remote` not showing when there are no open editors
|
||||||
|
|
||||||
|
## [3.6.1] - 2017-06-07
|
||||||
|
### Fixed
|
||||||
|
- Fixes issues with the zone.js monkey patching done by application insights (telemetry) - disables all the monkey patching
|
||||||
|
|
||||||
|
## [3.6.0] - 2017-06-02
|
||||||
|
### Added
|
||||||
|
- Adds diff information (the line's previous version) into the active line hover
|
||||||
|
- Adds a `gitlens.diffWithWorking` status bar command option - compares the current line commit with the working tree
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes the behavior of the `Compare File with Working Tree` command (`gitlens.diffWithWorking`) - always does what it says :)
|
||||||
|
- Compares the current file with the working tree -- if the current file *is* the working file, it will show a `File matches the working tree` message
|
||||||
|
- Changes the behavior of the `Compare File with Previous` command (`gitlens.diffWithPrevious`) - always does what it says :)
|
||||||
|
- Compares the current file with the previous commit to that file
|
||||||
|
- Changes the behavior of the `gitlens.diffWithPrevious` status bar command option - compares the current line commit with the previous
|
||||||
|
- Renames `Compare File with Previous Commit` command to `Compare File with Previous`
|
||||||
|
- Renames `Compare Line with Previous Commit` command to `Compare Line Commit with Previous`
|
||||||
|
- Renames `Compare Line with Working Tree` command to `Compare Line Commit with Working Tree`
|
||||||
|
- Renames `Compare with Previous Commit` in quick pick menus to `Compare File with Previous`
|
||||||
|
- Renames `Compare with Working Tree` in quick pick menus to `Compare File with Working Tree`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#79](https://github.com/eamodio/vscode-gitlens/issues/79) - Application insights package breaks GitLens + eslint
|
||||||
|
|
||||||
|
## [3.5.1] - 2017-05-25
|
||||||
|
### Changed
|
||||||
|
- Changes certain code lens actions to be unavailable (unclickable) when the commit referenced is uncommitted - avoids unwanted error messages
|
||||||
|
- Debounces more events when tracking the active line to further reduce lag
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#71](https://github.com/eamodio/vscode-gitlens/issues/71) - Blame information is invalid when a file has changed outside of vscode
|
||||||
|
- Fixes issue with showing the incorrect blame for versioned files (i.e. files on the left of a diff, etc)
|
||||||
|
|
||||||
|
## [3.5.0] - 2017-05-24
|
||||||
|
### Added
|
||||||
|
- Improves performance
|
||||||
|
- Reduces the number of git calls on known "untrackables"
|
||||||
|
- Caches many more git commands to reduce git command roundtrips and parsing
|
||||||
|
- Increases the debounce (delay) on cursor movement to reduce lag when navigating around a file
|
||||||
|
- Adds diff information (the line's previous version) into the active line hover when the current line is uncommitted
|
||||||
|
- Adds `gitlens.statusBar.alignment` settings to control the alignment of the status bar -- thanks to [PR #72](https://github.com/eamodio/vscode-gitlens/pull/72) by Zack Schuster ([@zackschuster](https://github.com/zackschuster))!
|
||||||
|
- Adds `Open Branch in Remote` command (`gitlens.openBranchInRemote`) - opens the current branch commits in the supported remote service
|
||||||
|
- Adds `Open Repository in Remote` command (`gitlens.openRepoInRemote`) - opens the repository in the supported remote service
|
||||||
|
- Adds `Stash Changes` option to stashed changes quick pick menu -- no longer hidden behind the `"gitlens.insiders": true` setting
|
||||||
|
- Adds `Stash Unstaged Changes` option to stashed changes quick pick menu -- no longer hidden behind the `"gitlens.insiders": true` setting
|
||||||
|
- Adds `Apply Stashed Changes` command (`gitlens.stashApply`) to apply the selected stashed changes to the working tree -- no longer hidden behind the `"gitlens.insiders": true` setting
|
||||||
|
- Adds `Stash Changes` command (`gitlens.stashSave`) to stash any working tree changes -- no longer hidden behind the `"gitlens.insiders": true` setting
|
||||||
|
- Adds support to the `Search commits` command (`gitlens.showCommitSearch`) to work without any active editor
|
||||||
|
- Adds commit search pre-population -- if there is an active editor it will use the commit sha of the current line commit, otherwise it will use the current clipboard
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes `Open File in Remote` and `Open Line Commit in Remote` commands to actually work for everyone (part of their implementation was still behind the `gitlens.insiders` setting)
|
||||||
|
- Changes the active line hover to only show at the beginning and end of a line if `gitlens.blame.annotation.activeLine` is `both`
|
||||||
|
- Changes `alt+f` shortcut to `alt+/` for the `Search commits` command (`gitlens.showCommitSearch`)
|
||||||
|
- Changes `alt+right` on commit details quick pick menu to execute the `Compare File with Previous Commit` command (`gitlens.diffWithPrevious`) when a file is selected
|
||||||
|
- Changes `alt+right` on repository status quick pick menu to execute the `Compare File with Previous Commit` command (`gitlens.diffWithPrevious`) when a file is selected
|
||||||
|
- Refactors command argument passing to allow for future inclusion into the SCM menus
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#73](https://github.com/eamodio/vscode-gitlens/issues/73) - GitLens doesn't work with Chinese filenames
|
||||||
|
- Fixes [#40](https://github.com/eamodio/vscode-gitlens/issues/40) - Encoding issues
|
||||||
|
- Given the limitations of the vscode api, I'm unable to fix all the encoding issues, but many of them should now be squashed
|
||||||
|
- `files.encoding` is now honored for the cases where the encoding cannot currently be gleaned
|
||||||
|
- Fixes incorrect file selection from the commit details quick pick menu
|
||||||
|
- Fixes incorrect command execution when using `"gitlens.statusBar.command": "gitlens.showQuickRepoHistory"`
|
||||||
|
- Fixes a bunch of issues that were revealed by enabling Typescript `strict` mode
|
||||||
|
|
||||||
|
## [3.4.9] - 2017-05-03
|
||||||
|
### Added
|
||||||
|
- Adds better support for deleted files when choosing `Open Changed Files` via in quick pick menus - now opens the file revision from the previous commit
|
||||||
|
- Adds better support for deleted files when using `alt+right arrow` shortcut on the commit details quick pick menu - now opens the file revision from the previous commit
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Removes deleted files when choosing `Open Working Changed Files` via in quick pick menus
|
||||||
|
|
||||||
|
## [3.4.8] - 2017-05-02
|
||||||
|
### Changed
|
||||||
|
- Changes display name in the marketplace to `Git Lens` because of the marketplace search ranking algorithm
|
||||||
|
|
||||||
|
## [3.4.6] - 2017-05-01
|
||||||
|
### Added
|
||||||
|
- Adds better support for deleted files when choosing `Open File` via in quick pick menus - now opens the file revision from the previous commit
|
||||||
|
- Adds better support for deleted files when choosing `Open File in Remote` via in quick pick menus - now opens the file revision from the previous commit
|
||||||
|
- Improves performance by caching the git path to avoid lookups on every git command
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Renames `gitlens.advanced.codeLens.debug` setting to `gitlens.codeLens.debug`
|
||||||
|
- Renames `gitlens.advanced.debug` setting to `gitlens.debug`
|
||||||
|
- Renames `gitlens.output.level` setting to `gitlens.outputLevel`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes incorrect file selection when showing commit details quick pick menu
|
||||||
|
- Fixes timing error on startup
|
||||||
|
|
||||||
|
## [3.4.5] - 2017-04-13
|
||||||
|
### Added
|
||||||
|
- Completely overhauls the [GitLens documentation](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens) and messaging -- make sure to check it out to see all the powerful features GitLen provides!
|
||||||
|
- Adds `gitlens.blame.annotation.activeLineDarkColor` & `gitlens.blame.annotation.activeLineLightColor` settings to control the colors of the active line blame annotation
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes `Toggle Git Code Lens` command to work when `gitlens.codeLens.visibility` is set to `auto` (the default)
|
||||||
|
- Renames `Compare with...` command to `Compare File with...`
|
||||||
|
- Renames `Compare with Next Commit` command to `Compare File with Next Commit`
|
||||||
|
- Renames `Compare with Previous Commit` command to `Compare File with Previous Commit`
|
||||||
|
- Renames `Compare with Previous Commit` command to `Compare File with Previous Commit`
|
||||||
|
- Renames `Compare with Working Tree` command to `Compare File with Working Tree`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes issue with `Open Commit in Remote` not working
|
||||||
|
- Fixes issue with many commands missing from the `Command Palette`
|
||||||
|
|
||||||
|
## [3.3.3] - 2017-04-10
|
||||||
|
### Fixed
|
||||||
|
- Fixes issue with newlines in commit messages in the file/branch/stash history quick pick menus (truncates and adds an ellipse icon)
|
||||||
|
|
||||||
|
## [3.3.2] - 2017-04-10
|
||||||
|
### Removed
|
||||||
|
- Removes `gitlens.blame.annotation.characters.*` settings since they were added to deal with unicode bugs in a previous version of vscode
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Closes [#63](https://github.com/eamodio/vscode-gitlens/issues/63) - Switch commit message and author in commit pick list. Also reduces clutter in the commit quick pick menus
|
||||||
|
|
||||||
|
## [3.3.1] - 2017-04-09
|
||||||
|
### Changed
|
||||||
|
- Changes commit search prefixes -- no prefix for message search, `@` for author, `:` for file pattern, `#` for commit id
|
||||||
|
- Changes `sha` terminology to `commit id` in the UI
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes issues with author searching
|
||||||
|
|
||||||
|
## [3.3.0] - 2017-04-09
|
||||||
|
### Added
|
||||||
|
- Adds `Search commits` command (`gitlens.showCommitSearch`) to allow commit searching by message, author, file pattern, or sha
|
||||||
|
- Adds `alt+f` shortcut for the `Search commits` command (`gitlens.showCommitSearch`)
|
||||||
|
- Adds `Show Commit Search` command to the branch history quick pick menu
|
||||||
|
- Adds `Show Stashed Changes` command to the repository status quick pick menu
|
||||||
|
- Adds a `Don't Show Again` option to the GitLen update notification
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes `Open x in Remote` commands to be no longer hidden behind the `gitlens.insiders` setting
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#59](https://github.com/eamodio/vscode-gitlens/issues/59) - Context menu shows gitlens commands even if folder/file is not under git
|
||||||
|
|
||||||
|
## [3.2.1]
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#57](https://github.com/eamodio/vscode-gitlens/issues/57) - No more blank message if `diff.tool` is missing
|
||||||
|
|
||||||
|
## [3.2.0]
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- Adds support for single files opened in vscode -- you are no longer required to open a folder for GitLens to work
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#57](https://github.com/eamodio/vscode-gitlens/issues/57) - Warn on directory compare when there is no diff tool configured
|
||||||
|
- Fixes [#58](https://github.com/eamodio/vscode-gitlens/issues/58) - Work with git sub-modules
|
||||||
|
- Fixes issue with `Open * in Remote` commands with nested repositories and non-git workspace root folder
|
||||||
|
|
||||||
|
## [3.1.0]
|
||||||
|
### Added
|
||||||
|
- Adds `Show Stashed Changes` command (`gitlens.showQuickStashList`) to open a quick pick menu of all the stashed changes
|
||||||
|
- Adds insiders `Stash Changes` option to stashed changes quick pick menu -- enabled via `"gitlens.insiders": true`
|
||||||
|
- Adds insiders `Stash Unstaged Changes` option to stashed changes quick pick menu
|
||||||
|
- Adds insiders `Apply Stashed Changes` command (`gitlens.stashApply`) to apply the selected stashed changes to the working tree
|
||||||
|
- Adds insiders `Stash Changes` command (`gitlens.stashSave`) to stash any working tree changes
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes incorrect counts in upstream status
|
||||||
|
|
||||||
|
## [3.0.5]
|
||||||
|
### Added
|
||||||
|
- Adds additional insiders support for GitLab, Bitbucket, and Visual Studio Team Services to the `Open x in Remote` commands and quick pick menus -- enabled via `"gitlens.insiders": true`
|
||||||
|
- Adds insiders line support to `Open File in Remote` command (`gitlens.openFileInRemote`)
|
||||||
|
- Adds original file name for renamed files to the repository status and commit details quick pick menu
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#56](https://github.com/eamodio/vscode-gitlens/issues/56) - Handle file names with spaces
|
||||||
|
|
||||||
|
## [3.0.4]
|
||||||
|
### Changed
|
||||||
|
- Changes telemetry a bit to reduce noise
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes common telemetry error by switching to non-strict iso dates (since they are only available in later git versions)
|
||||||
|
|
||||||
|
## [3.0.3]
|
||||||
|
### Added
|
||||||
|
- Adds a fallback to work with Git version prior to `2.11.0` -- terribly sorry for the inconvenience :(
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#55](https://github.com/eamodio/vscode-gitlens/issues/55) - reverts Git requirement back to `2.2.0`
|
||||||
|
- Fixes issues with parsing merge commits
|
||||||
|
|
||||||
|
## [3.0.2]
|
||||||
|
### Changed
|
||||||
|
- Changes required Git version to `2.11.0`
|
||||||
|
|
||||||
|
## [3.0.1]
|
||||||
|
### Added
|
||||||
|
- Adds basic telemetry -- honors the vscode telemetry configuration setting
|
||||||
|
|
||||||
|
## [3.0.0]
|
||||||
|
### Added
|
||||||
|
- Adds insiders support for `Open in GitHub` to the relevant quick pick menus -- enabled via `"gitlens.insiders": true`
|
||||||
|
- Adds insiders `Open Line Commit in Remote` command (`gitlens.openCommitInRemote`) to open the current commit in the remote service (currently only GitHub)
|
||||||
|
- Adds insiders `Open File in Remote` command (`gitlens.openFileInRemote`) to open the current file in the remote service (currently only GitHub)
|
||||||
|
- Adds an update notification for feature releases
|
||||||
|
- Adds `Show Branch History` command (`gitlens.showQuickBranchHistory`) to show the history of the selected branch
|
||||||
|
- Adds `Show Last Opened Quick Pick` command (`gitlens.showLastQuickPick`) to re-open the previously opened quick pick menu - helps to get back to previous context
|
||||||
|
- Adds `alt+-` shortcut for the `Show Last Opened Quick Pick` command (`gitlens.showLastQuickPick`)
|
||||||
|
- Adds upstream status information (if available) to the repository status pick pick
|
||||||
|
- Adds file status rollup information to the repository status pick pick
|
||||||
|
- Adds file status rollup information to the commit details quick pick menu
|
||||||
|
- Adds `Compare with...` (`gitlens.diffWithBranch`) command to compare working file to another branch (via branch quick pick menu)
|
||||||
|
- Adds branch quick pick menu to `Directory Compare` (`gitlens.diffDirectory`) command
|
||||||
|
- Adds support for `gitlens.showQuickFileHistory` command execution via code lens to limit results to the code lens block
|
||||||
|
- Adds current branch to branch quick pick menu placeholder
|
||||||
|
- Adds `Show Branch History` command to the branch history quick pick menu when showing only limited commits (e.g. starting at a specified commit)
|
||||||
|
- Adds `Show File History` command to the file history quick pick menu when showing only limited commits (e.g. starting at a specified commit)
|
||||||
|
- Adds `Don't Show Again` option to the unsupported git version notification
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes `Show Repository History` command to `Show Current Branch History`
|
||||||
|
- Changes `Repository History` terminology to `Branch History`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes issue with `gitlens.diffWithPrevious` command execution via code lens when the code lens was not at the document/file level
|
||||||
|
- Fixes issue where full shas were displayed on the file/blame history explorers
|
||||||
|
- Fixes [#30](https://github.com/eamodio/vscode-gitlens/issues/30) - Diff with Working Tree fails from repo/commit quickpick list if file was renamed (and the commit was before the rename)
|
||||||
|
- Fixes various other quick pick menu command issues when a file was renamed
|
||||||
|
- Fixes various issues when caching is disabled
|
||||||
|
- Fixes issues with parsing commits history
|
||||||
|
- Fixes various issues with merge commits
|
||||||
|
|
||||||
|
## [2.12.2]
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#50](https://github.com/eamodio/vscode-gitlens/issues/50) - excludes container-level code lens from `html` and `vue` language files
|
||||||
|
|
||||||
|
## [2.12.1]
|
||||||
|
### Added
|
||||||
|
- Adds `gitlens.advanced.codeLens.debug` setting to control whether or not to show debug information in code lens
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes issue where `gitlens.showQuickRepoHistory` command fails to open when there is no active editor
|
||||||
|
|
||||||
|
## [2.12.0]
|
||||||
|
### Added
|
||||||
|
- Adds progress indicator for the `gitlens.showQuickFileHistory` & `gitlens.showQuickRepoHistory` quick pick menus
|
||||||
|
- Adds paging support to the `gitlens.showQuickFileHistory` & `gitlens.showQuickRepoHistory` quick pick menus
|
||||||
|
- Adds `Show Previous Commits` command
|
||||||
|
- Adds `Show Next Commits` command
|
||||||
|
- Adds keyboard page navigation via `alt+,` (previous) & `alt+.` (next) on the `gitlens.showQuickFileHistory` & `gitlens.showQuickRepoHistory` quick pick menus
|
||||||
|
- Adds keyboard commit navigation via `alt+,` (previous) & `alt+.` (next) on the `gitlens.showQuickCommitDetails` & `gitlens.showQuickCommitFileDetails` quick pick menus
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes behavior of `gitlens.showQuickFileHistory` & `gitlens.showFileHistory` to no longer show merge commits
|
||||||
|
- Changes `gitlens.copyShaToClipboard` to copy the full sha, rather than short sha
|
||||||
|
- Changes internal tracking to use full sha (rather than short sha)
|
||||||
|
|
||||||
|
## [2.11.2]
|
||||||
|
### Added
|
||||||
|
- Adds `gitlens.diffWithNext` command to open a diff with the next commit
|
||||||
|
- Adds `alt+.` shortcut for the `gitlens.diffWithNext` command
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes `shift+alt+p` shortcut to `alt+,` for the `gitlens.diffWithPrevious` command
|
||||||
|
- Changes `alt+p` shortcut to `shift+alt+,` for the `gitlens.diffLineWithPrevious` command
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Removes `gitlens.toggleCodeLens` from Command Palette when not available
|
||||||
|
- Removes `gitlens.toggleCodeLens` shortcut key when not available
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes (#45)[https://github.com/eamodio/vscode-gitlens/issues/45] - Keyboard Shortcut collision with Project Manager
|
||||||
|
|
||||||
|
## [2.11.1]
|
||||||
|
### Added
|
||||||
|
- Adds blame and active line annotation support to git diff split view (right side)
|
||||||
|
- Adds command (compare, copy sha/message, etc) support to git diff split view (right side)
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes intermittent issues when toggling whitespace for blame annotations
|
||||||
|
|
||||||
|
## [2.11.0]
|
||||||
|
### Added
|
||||||
|
- Adds `gitlens.showQuickCommitFileDetails` command to show a quick pick menu of details for a file commit
|
||||||
|
- Adds `gitlens.showQuickCommitFileDetails` command to code lens
|
||||||
|
- Adds `gitlens.showQuickCommitFileDetails` command to the status bar
|
||||||
|
- Adds `gitlens.closeUnchangedFiles` command to close any editors that don't have uncommitted changes
|
||||||
|
- Adds `gitlens.openChangedFiles` command to open all files that have uncommitted changes
|
||||||
|
- Adds `Directory Compare` (`gitlens.diffDirectory`) command to open the configured git difftool to compare directory versions
|
||||||
|
- Adds `Directory Compare with Previous Commit` command on the `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Adds `Directory Compare with Working Tree` command on the `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Adds a `Changed Files` grouping on the `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Adds a `Close Unchanged Files` command on the `gitlens.showQuickRepoStatus` quick pick menu
|
||||||
|
- Adds a contextual description to the `go back` command in quick pick menus
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes layout of the `gitlens.showQuickRepoStatus` quick pick menu for better clarity
|
||||||
|
- Changes behavior of `gitlens.showQuickCommitDetails` to show commit a quick pick menu of details for a commit
|
||||||
|
- Changes default of `gitlens.codeLens.recentChange.command` to be `gitlens.showQuickCommitFileDetails` (though there is no visible behavior change)
|
||||||
|
- Renames `Open Files` to `Open Changed Files` on the `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Renames `Open Working Files` to `Open Changed Working Files` on the `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Renames `Show Changed Files` to `Show Commit Details` on the `gitlens.showQuickCommitFileDetails` quick pick menu
|
||||||
|
- Renames `Open Files` to `Open Changed Files` on the `gitlens.showQuickRepoStatus` quick pick menu
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#44](https://github.com/eamodio/vscode-gitlens/issues/43) by adding a warning message about Git version requirements
|
||||||
|
- Fixes intermittent errors when adding active line annotations
|
||||||
|
- Fixes intermittent errors when opening multiple files via quick pick menus
|
||||||
|
|
||||||
|
## [2.10.1]
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#43](https://github.com/eamodio/vscode-gitlens/issues/43) - File-level code lens isn't using the blame of the whole file as it should
|
||||||
|
- Fixes issue with single quotes (') in annotations
|
||||||
|
- Fixes output channel logging (also adds more debug information to code lens -- when enabled)
|
||||||
|
|
||||||
|
## [2.10.0]
|
||||||
|
### Added
|
||||||
|
- Adds blame and active line annotation support to git diff split view
|
||||||
|
- Adds command (compare, copy sha/message, etc) support to git diff split view
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes startup failure if caching was disabled
|
||||||
|
- Fixes missing `Compare Line with Previous Commit` context menu item
|
||||||
|
- Fixes [#41](https://github.com/eamodio/vscode-gitlens/issues/41) - Toggle Blame annotations on compare files page
|
||||||
|
- Fixes issue with undo (to a saved state) not causing annotations to reappear properly
|
||||||
|
- Attempts to fix [#42](https://github.com/eamodio/vscode-gitlens/issues/42) - Cursor on Uncommitted message
|
||||||
|
|
||||||
|
## [2.9.0]
|
||||||
|
### Changed
|
||||||
|
- To accomodate the realization that blame information is invalid when a file has unsaved changes, the following behavior changes have been made
|
||||||
|
- Status bar blame information will hide
|
||||||
|
- Code lens change to a `Cannot determine...` message and become unclickable
|
||||||
|
- Many menu choices and commands will hide
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#38](https://github.com/eamodio/vscode-gitlens/issues/38) - Toggle Blame Annotation button shows even when it isn't valid
|
||||||
|
- Fixes [#36](https://github.com/eamodio/vscode-gitlens/issues/36) - Blame information is invalid when a file has unsaved changes
|
||||||
|
|
||||||
|
## [2.8.2]
|
||||||
|
### Added
|
||||||
|
- Adds `gitlens.blame.annotation.dateFormat` to specify how absolute commit dates will be shown in the blame annotations
|
||||||
|
- Adds `gitlens.statusBar.date` to specify whether and how the commit date will be shown in the blame status bar
|
||||||
|
- Adds `gitlens.statusBar.dateFormat` to specify how absolute commit dates will be shown in the blame status bar
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#39](https://github.com/eamodio/vscode-gitlens/issues/39) - Add date format options for status bar blame
|
||||||
|
|
||||||
|
## [2.8.1]
|
||||||
|
### Fixed
|
||||||
|
- Fixes issue where `Compare with *` commands fail to open when there is no active editor
|
||||||
|
|
||||||
|
## [2.8.0]
|
||||||
|
### Added
|
||||||
|
- Adds new `Open File` command on the `gitlens.showQuickCommitDetails` quick pick menu to open the commit version of the file
|
||||||
|
- Adds new `Open File` command on the `gitlens.showQuickCommitDetails` quick pick menu to open the commit version of the files
|
||||||
|
- Adds `alt+left` keyboard shortcut in quick pick menus to `go back`
|
||||||
|
- Adds `alt+right` keyboard shortcut in quick pick menus to execute the currently selected item while keeping the quick pick menu open (in most cases)
|
||||||
|
- `alt+right` keyboard shortcut on commit details file name, will open the commit version of the file
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Indents the file statuses on the `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Renames `Open File` to `Open Working File` on the `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Renames `Open File` and `Open Working Files` on the `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Reorders some quick pick menus
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#34](https://github.com/eamodio/vscode-gitlens/issues/34) - Open file should open the selected version of the file
|
||||||
|
- Fixes some issue where some editors opened by the quickpick would not be opened in preview tabs
|
||||||
|
- Fixes issue where copy to clipboard commands would fail if there was no active editor
|
||||||
|
- Fixes issue where active line annotations would show for opened versioned files
|
||||||
|
- Fixes issue where code lens compare commands on opened versioned files would fail
|
||||||
|
|
||||||
|
## [2.7.1]
|
||||||
|
### Added
|
||||||
|
- Adds proper support for multi-line commit messages
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#33](https://github.com/eamodio/vscode-gitlens/issues/33) - Commit message styled as title in popup, when message starts with hash symbol
|
||||||
|
|
||||||
|
## [2.7.0]
|
||||||
|
### Added
|
||||||
|
- Adds file status icons (added, modified, deleted, etc) to the `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Adds `Copy Commit Sha to Clipboard` command to commit files quick pick menu
|
||||||
|
- Adds `Copy Commit Message to Clipboard` command to commit files quick pick menu
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes `Show Commit History` to `Show File History` on the `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Changes `Show Previous Commit History` to `Show Previous File History` on the `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes issue with repository status when there are no changes
|
||||||
|
- Fixes issue with `.` showing in the path of quick pick menus
|
||||||
|
- Fixes logging to clean up on extension deactivate
|
||||||
|
|
||||||
|
## [2.6.0]
|
||||||
|
### Added
|
||||||
|
- Adds `gitlens.showQuickRepoStatus` command to show a quick pick menu of files changed including status icons (added, modified, deleted, etc)
|
||||||
|
- Adds `alt+s` shortcut for the `gitlens.showQuickRepoStatus` command
|
||||||
|
|
||||||
|
## [2.5.6]
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#32](https://github.com/eamodio/vscode-gitlens/issues/32) - 00000000 Uncommitted changes distracting
|
||||||
|
|
||||||
|
## [2.5.5]
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#25](https://github.com/eamodio/vscode-gitlens/issues/25) - Blame information isn't updated after git operations (commit, reset, etc)
|
||||||
|
|
||||||
|
## [2.5.4]
|
||||||
|
### Fixed
|
||||||
|
- Fixes extra spacing in annotations
|
||||||
|
|
||||||
|
## [2.5.3]
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#27](https://github.com/eamodio/vscode-gitlens/issues/27) - Annotations are broken in vscode insider build
|
||||||
|
|
||||||
|
## [2.5.2]
|
||||||
|
### Added
|
||||||
|
- Adds `Open File` command to `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Adds `Open Files` command to `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Improves performance of git-log operations in `gitlens.diffWithPrevious` and `gitlens.diffWithWorking` commands
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes `Not Committed Yet` author for uncommitted changes to `Uncommitted`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes showing `gitlens.showQuickCommitDetails` quick pick menu for uncommitted changes -- now shows the previous commit details
|
||||||
|
|
||||||
|
## [2.5.1]
|
||||||
|
### Added
|
||||||
|
- Adds `gitlens.copyMessageToClipboard` command to copy commit message to the clipboard
|
||||||
|
- Adds `gitlens.copyMessageToClipboard` to the editor content menu
|
||||||
|
- Adds `Copy Commit Message to Clipboard` command to `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes behavior of `gitlens.copyShaToClipboard` to copy the sha of the most recent commit to the repository if there is no active editor
|
||||||
|
- Changes behavior of `gitlens.showQuickFileHistory` to execute `gitlens.showQuickRepoHistory` if there is no active editor
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes issue where shortcut keys weren't disabled if GitLens was disabled
|
||||||
|
|
||||||
|
## [2.5.0]
|
||||||
|
### Added
|
||||||
|
- Overhauls the `gitlens.showQuickRepoHistory`, `gitlens.showQuickFileHistory`, and `gitlens.showQuickCommitDetails` quick pick menus
|
||||||
|
- Adds `Show Repository History` command to `gitlens.showQuickFileHistory` quick pick menu
|
||||||
|
- Adds `Show Previous Commits History` command to `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Adds `Show Commits History` command to `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Adds `Copy Commit Sha to Clipboard` command to `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Adds `Show Changed Files` command to `gitlens.showQuickCommitDetails` quick pick menu
|
||||||
|
- Adds more robust `go back` navigation in quick pick menus
|
||||||
|
- Adds commit message to placeholder text of many quick pick menus
|
||||||
|
- Adds icons for some commands
|
||||||
|
- Adds `gitlens.diffWithPrevious` command to the editor content menu
|
||||||
|
- Adds `gitlens.diffWithWorking` command to the editor content menu
|
||||||
|
- Adds `gitlens.showQuickRepoHistory` and `gitlens.showQuickCommitDetails` commands to code lens
|
||||||
|
- Adds `gitlens.showQuickRepoHistory` and `gitlens.showQuickCommitDetails` commands to the status bar
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes the default command of `gitlens.codeLens.recentChange.command` to `gitlens.showQuickCommitDetails`
|
||||||
|
- Changes the default command of `gitlens.statusBar.command` to `gitlens.showQuickCommitDetails`
|
||||||
|
- Changes behavior of `gitlens.showQuickCommitDetails` to show commit commands rather than file set (use `Show Changed Files` command to get to the file set)
|
||||||
|
- Changes `gitlens.diffWithPrevious` command to behave as `gitlens.diffWithWorking` if the file has uncommitted changes
|
||||||
|
- Renames `gitlens.diffWithPrevious` command from `Diff Commit with Previous` to `Compare with Previous Commit`
|
||||||
|
- Renames `gitlens.diffLineWithPrevious` command from `Diff Commit (line) with Previous` to `Compare Line with Previous Commit`
|
||||||
|
- Renames `gitlens.diffWithWorking` command from `Diff Commit with Working Tree` to `Compare with Working Tree`
|
||||||
|
- Renames `gitlens.diffLineWithWorking` command from `Diff Commit (line) with Working Tree` to `Compare Line with Working Tree`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes issues with certain git commands not working on Windows
|
||||||
|
- Fixes [#31](https://github.com/eamodio/vscode-gitlens/issues/31) - Disable gitlens if the project does not have `.git` folder
|
||||||
|
- Fixes issue where quick pick menus could fail if there was no active editor
|
||||||
|
- Fixes code lens not updating in response to configuration changes
|
||||||
|
|
||||||
|
## [2.1.1]
|
||||||
|
### Fixed
|
||||||
|
- Fixes overzealous active line annotation updating on document changes
|
||||||
|
|
||||||
|
## [2.1.0]
|
||||||
|
### Added
|
||||||
|
- Adds a new GitLens logo and changes all images to svg
|
||||||
|
- Adds `alt+p` shortcut for the `gitlens.diffLineWithPrevious` command
|
||||||
|
- Adds `shift+alt+p` shortcut for the `gitlens.diffWithPrevious` command
|
||||||
|
- Adds `alt+w` shortcut for the `gitlens.diffLineWithWorking` command
|
||||||
|
- Adds `shift+alt+w` shortcut for the `gitlens.diffWithWorking` command
|
||||||
|
- Adds `gitlens.copyShaToClipboard` command to copy commit sha to the clipboard ([#28](https://github.com/eamodio/vscode-gitlens/issues/28))
|
||||||
|
- Adds `gitlens.showQuickCommitDetails` command to show a quick pick menu of details for a commit
|
||||||
|
- Adds `go back` choice to `gitlens.showQuickCommitDetails`, `gitlens.showQuickFileHistory`, and `gitlens.showQuickRepoHistory` quick pick menus
|
||||||
|
- Adds `gitlens.blame.annotation.highlight` to specify whether and how to highlight blame annotations ([#24](https://github.com/eamodio/vscode-gitlens/issues/24))
|
||||||
|
- Greatly improves performance of line navigation when either active line annotations or status bar blame is enabled
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#29](https://github.com/eamodio/vscode-gitlens/issues/29) - Commit info tooltip duplicated for current line when blame is enabled
|
||||||
|
- Fixes issue where sometimes the commit history shown wasn't complete
|
||||||
|
- Fixes issues with `gitlens.diffLineWithPrevious` and `gitlens.diffWithPrevious` not following renames properly
|
||||||
|
- Fixes issues with `gitlens.diffLineWithPrevious` and `gitlens.diffWithPrevious` not always grabbing the correct commit
|
||||||
|
|
||||||
|
## [2.0.2]
|
||||||
|
### Added
|
||||||
|
- Adds auto-enable of whitespace toggling when using font-ligatures because of [vscode issue](https://github.com/Microsoft/vscode/issues/11485)
|
||||||
|
- Adds `gitlens.blame.annotation.characters.*` settings to provide some control over how annotations are displayed
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#22](https://github.com/eamodio/vscode-gitlens/issues/22) - Cannot read property 'sha' of undefined
|
||||||
|
|
||||||
|
## [2.0.1]
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#26](https://github.com/eamodio/vscode-gitlens/issues/26) - Active line annotation doesn't disappear properly after delete
|
||||||
|
|
||||||
|
## [2.0.0]
|
||||||
|
### Added
|
||||||
|
- Adds `gitlens.blame.annotation.activeLine` to specify whether and how to show blame annotations on the active line
|
||||||
|
- Adds full commit message (rather than just summary) to active line hover if `gitlens.blame.annotation.activeLine` is not `off`
|
||||||
|
- Adds new `trailing` blame annotation style -- adds annotations after the code lines rather than before
|
||||||
|
- Adds `gitlens.blame.annotation.message` to show the commit message in `expanded` and `trailing` blame annotation styles
|
||||||
|
- Adds support for relative dates in blame annotations. Use `gitlens.blame.annotation.date`
|
||||||
|
- Re-adds context menu for `gitlens.diffLineWithPrevious` -- since [vscode issue](https://github.com/Microsoft/vscode/issues/15395)
|
||||||
|
- Re-adds context menu for `gitlens.diffLineWithWorking` -- since [vscode issue](https://github.com/Microsoft/vscode/issues/15395)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes the design of hover annotations -- much cleaner now
|
||||||
|
- Disables automatic whitespace toggling by default as it is seemingly no longer needed as [vscode issue](https://github.com/Microsoft/vscode/issues/11485) seems fixed. It can be re-enabled with `gitlens.advanced.toggleWhitespace.enabled`
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes issue where the status bar blame would get stuck switching between editors
|
||||||
|
- Fixes issue where code lens aren't updated properly after a file is saved
|
||||||
|
|
||||||
|
## [1.4.3]
|
||||||
|
### Added
|
||||||
|
- Adds some logging to hopefully trap [#22](https://github.com/eamodio/vscode-gitlens/issues/22) - Cannot read property 'sha' of undefined
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes issue with the latest insiders build (1.9.0-insider f67f87c5498d9361c0b29781c341fd032815314b) where there is a collision of document schemes
|
||||||
|
|
||||||
|
## [1.4.2]
|
||||||
|
### Fixed
|
||||||
|
- Fixes issue where file history wouldn't compare correctly to working tree if the filename had changed
|
||||||
|
|
||||||
|
## [1.4.1]
|
||||||
|
### Added
|
||||||
|
- Adds `gitlens.advanced.gitignore.enabled` to enable/disable .gitignore parsing. Addresses [#20](https://github.com/eamodio/vscode-gitlens/issues/20) - Nested .gitignore files can cause blame to fail with a repo within another repo
|
||||||
|
|
||||||
|
## [1.4.0]
|
||||||
|
### Added
|
||||||
|
- Adds `alt+h` shortcut for the `gitlens.showQuickFileHistory` command
|
||||||
|
- Adds `shift+alt+h` shortcut for the `gitlens.showQuickRepoHistory` command
|
||||||
|
- Adds `gitlens.advanced.maxQuickHistory` to limit the number of quick history entries to show (for better performance); Defaults to 200
|
||||||
|
- Adds `gitlens.diffLineWithPrevious` as `alt` context menu item for `gitlens.diffWithPrevious`
|
||||||
|
- Adds `gitlens.diffLineWithWorking` as `alt` context menu item for `gitlens.diffWithWorking`
|
||||||
|
- Adds `gitlens.showFileHistory` as `alt` context menu item for `gitlens.showQuickFileHistory`
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Removes context menu for `gitlens.diffLineWithPrevious` -- since it is now the `alt` of `gitlens.diffWithPrevious`
|
||||||
|
- Removes context menu for `gitlens.diffLineWithWorking` -- since it is now the `alt` of `gitlens.diffWithWorking`
|
||||||
|
- Replaces `gitlens.menus.fileDiff.enabled` and `gitlens.menus.lineDiff.enabled` with `gitlens.menus.diff.enabled` -- since the switch between file and line diff is now controlled by the `alt` key
|
||||||
|
|
||||||
|
## [1.3.1]
|
||||||
|
### Added
|
||||||
|
- Adds `Diff Commit with Working Tree` to the explorer context menu (assuming `gitlens.menus.fileDiff.enabled` is `true`)
|
||||||
|
- Adds `Diff Commit with Working Tree` & `Diff Commit with Previous` to the editor title context menu (assuming `gitlens.menus.fileDiff.enabled` is `true`)
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Renames `Diff` commands for better clarity
|
||||||
|
- Removes `Git` from the commands as it feels unnecessary
|
||||||
|
- Reorders the context menu commands
|
||||||
|
|
||||||
|
## [1.3.0]
|
||||||
|
### Added
|
||||||
|
- Adds support for blame and history (log) on files opened via compare commands -- allows for deep navigation through git history
|
||||||
|
|
||||||
|
## [1.2.0]
|
||||||
|
### Added
|
||||||
|
- Adds compare (working vs previous) options to repository history
|
||||||
|
- Adds compare (working vs previous) options to file history
|
||||||
|
### Fixed
|
||||||
|
- Fixes issue with repository history compare with commits with multiple files
|
||||||
|
|
||||||
|
## [1.1.1]
|
||||||
|
### Added
|
||||||
|
- Adds logging for tracking [#18](https://github.com/eamodio/vscode-gitlens/issues/18) - GitLens only displayed for some files
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes `gitlens.showQuickRepoHistory` command to run without an open editor (falls back to the folder repository)
|
||||||
|
|
||||||
|
## [1.1.0]
|
||||||
|
### Added
|
||||||
|
- Adds new `gitlens.showQuickFileHistory` command to show the file history in a quick-pick list (palette)
|
||||||
|
- Adds new `gitlens.showQuickRepoHistory` command to show the repository history in a quick-pick list (palette)
|
||||||
|
- Adds `gitlens.showQuickFileHistory` option to the `gitlens.codeLens.recentChange.command`, `gitlens.codeLens.authors.command`, and `gitlens.statusBar.command` settings
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Changes the `gitlens.statusBar.command` settings default to `gitlens.showQuickFileHistory` instead of `gitlens.toggleBlame`
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Removes `git.viewFileHistory` option from the `gitlens.codeLens.recentChange.command`, `gitlens.codeLens.authors.command`, and `gitlens.statusBar.command` settings
|
||||||
|
|
||||||
|
## [1.0.2]
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#16](https://github.com/eamodio/vscode-gitlens/issues/16) - incorrect 'Unable to find Git' message
|
||||||
|
|
||||||
|
## [1.0.0]
|
||||||
|
### Added
|
||||||
|
- Adds support for git history (log)!
|
||||||
|
- Adds support for blame annotations and git commands on file revisions
|
||||||
|
- Adds ability to show multiple blame annotation at the same time (one per vscode editor)
|
||||||
|
- Adds new `gitlens.showFileHistory` command to open the history explorer
|
||||||
|
- Adds new `gitlens.showFileHistory` option to the `gitlens.codeLens.recentChange.command`, `gitlens.codeLens.authors.command`, and `gitlens.statusBar.command` settings
|
||||||
|
- Adds per-language code lens location customization using the `gitlens.codeLens.languageLocations` setting
|
||||||
|
- Adds new `gitlens.diffLineWithPrevious` command for line sensitive diffs
|
||||||
|
- Adds new `gitlens.diffLineWithWorking` command for line sensitive diffs
|
||||||
|
- Adds `gitlens.diffWithPrevious` command to the explorer context menu
|
||||||
|
- Adds output channel logging, controlled by the `gitlens.advanced.output.level` setting
|
||||||
|
- Improves performance of the code lens support
|
||||||
|
- Improves performance (significantly) when only showing code lens at the document level
|
||||||
|
- Improves performance of status bar blame support
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Switches on-demand code lens to be a global toggle (rather than per file)
|
||||||
|
- Complete rewrite of the blame annotation provider to reduce overhead and provide better performance
|
||||||
|
- Changes `gitlens.diffWithPrevious` command to always be file sensitive diffs
|
||||||
|
- Changes `gitlens.diffWithWorking` command to always be file sensitive diffs
|
||||||
|
- Removes all debug logging, unless the `gitlens.advanced.debug` settings it on
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes many (most?) issues with whitespace toggling (required because of https://github.com/Microsoft/vscode/issues/11485)
|
||||||
|
- Fixes issue where blame annotations would not be cleared properly when switching between open files
|
||||||
|
|
||||||
|
## [0.5.5]
|
||||||
|
### Fixed
|
||||||
|
- Fixes another off-by-one issue when diffing with caching
|
||||||
|
|
||||||
|
## [0.5.4]
|
||||||
|
### Fixed
|
||||||
|
- Fixes off-by-one issues with blame annotations without caching and when diffing with a previous version
|
||||||
|
|
||||||
|
## [0.5.3]
|
||||||
|
### Added
|
||||||
|
- Adds better uncommitted hover message in blame annotations
|
||||||
|
- Adds more protection for dealing with uncommitted lines
|
||||||
|
|
||||||
|
## [0.5.2]
|
||||||
|
### Fixed
|
||||||
|
- Fixes loading issue on Linux
|
||||||
|
|
||||||
|
## [0.5.1]
|
||||||
|
### Added
|
||||||
|
- Adds blame information in the status bar
|
||||||
|
- Add new status bar settings -- see **Extension Settings** for details
|
||||||
|
- Adds new `gitlens.diffWithPrevious` option to the `gitlens.codeLens.recentChange.command` & `gitlens.codeLens.authors.command` settings
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
- Renames the `gitlens.codeLens.recentChange.command` & `gitlens.codeLens.authors.command` settings options (to align with command names)
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- Removes `gitlens.blame.annotation.useCodeActions` setting and behavior
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes Diff with Previous when the selection is uncommitted
|
||||||
|
|
||||||
|
## [0.3.3]
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#7](https://github.com/eamodio/vscode-gitlens/issues/7) - missing spawn-rx dependency (argh!)
|
||||||
|
|
||||||
|
## [0.3.2]
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#7](https://github.com/eamodio/vscode-gitlens/issues/7) - missing lodash dependency
|
||||||
|
|
||||||
|
## [0.3.1]
|
||||||
|
### Added
|
||||||
|
- Adds new code lens visibility & location settings -- see **Extension Settings** for details
|
||||||
|
- Adds new command to toggle code lens on and off when `gitlens.codeLens.visibility` is set to `ondemand`
|
||||||
|
|
||||||
|
## [0.2.0]
|
||||||
|
### Changed
|
||||||
|
- Replaces blame regex parsing with a more robust parser
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#1](https://github.com/eamodio/vscode-gitlens/issues/1) - Support blame on files outside the workspace repository
|
||||||
|
- Fixes failures with Diff with Previous command
|
||||||
|
- Fixes issues with blame explorer code lens when dealing with previous commits
|
||||||
|
- Fixes display issues with compact blame annotations (now skips blank lines)
|
||||||
|
|
||||||
|
## [0.1.3]
|
||||||
|
### Added
|
||||||
|
- Improved blame annotations, now with sha and author by default
|
||||||
|
- Add new blame annotation styles -- compact and expanded (default)
|
||||||
|
- Adds many new configuration settings; see **Extension Settings** for details
|
||||||
|
|
||||||
|
## [0.0.7]
|
||||||
|
### Added
|
||||||
|
- Adds .gitignore checks to reduce the number of blame calls
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#4](https://github.com/eamodio/vscode-gitlens/issues/4) - Absolute paths fail on Windows due to backslash (Really!)
|
||||||
|
- Fixes [#5](https://github.com/eamodio/vscode-gitlens/issues/5) - Finding first non-white-space fails sometimes
|
||||||
|
|
||||||
|
## [0.0.6]
|
||||||
|
### Added
|
||||||
|
- Adds attempt to scroll to the correct position when opening a diff
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes [#2](https://github.com/eamodio/vscode-gitlens/issues/2) - [request] Provide some debug info when things fail
|
||||||
|
- Fixes [#4](https://github.com/eamodio/vscode-gitlens/issues/4) - Absolute paths fail on Windows due to backslash
|
||||||
|
|
||||||
|
## [0.0.5]
|
||||||
|
### Changed
|
||||||
|
- Removes code lens from fields and single-line properties to reduce visual noise
|
||||||
|
- Automatically turns off blame only when required now
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Fixes issues where filename changes in history would cause diffs to fails
|
||||||
|
- Fixes some issues with uncommitted blames
|
||||||
|
|
||||||
|
## [0.0.4]
|
||||||
|
### Added
|
||||||
|
- Candidate for preview release on the vscode marketplace.
|
||||||
|
|
||||||
|
## [0.0.1]
|
||||||
|
### Added
|
||||||
|
- Initial release but still heavily a work in progress.
|
||||||
12
ISSUE_TEMPLATE.md
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<!--
|
||||||
|
If you are encountering an issue that says `See output channel for more details`, please enable output channel logging by setting `"gitlens.outputLevel": "verbose"` in your settings.json. This will enable logging to the GitLens channel in the Output pane. Once enabled, please attempt to reproduce the issue (if possible) and attach the relevant log lines from the GitLens channel.
|
||||||
|
-->
|
||||||
|
|
||||||
|
- GitLens Version:
|
||||||
|
- VSCode Version:
|
||||||
|
- OS Version:
|
||||||
|
|
||||||
|
Steps to Reproduce:
|
||||||
|
|
||||||
|
1.
|
||||||
|
2.
|
||||||
2
LICENSE
@@ -1,6 +1,6 @@
|
|||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2016 Eric Amodio
|
Copyright (c) 2016-2017 Eric Amodio
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
|||||||
394
README.md
@@ -1,31 +1,363 @@
|
|||||||
# GitLens
|
[](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)
|
||||||
|
[](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)
|
||||||
Provides Git blame (and history eventually) CodeLens for many supported Visual Studio Code languages (in theory -- the language must support symbol searching).
|
[](https://marketplace.visualstudio.com/items?itemName=eamodio.gitlens)
|
||||||
|
[](https://join.slack.com/t/vscode-gitlens/shared_invite/MjIxOTgxNDE3NzM0LTE1MDE2Nzk1MTgtMjkwMmZjMzcxNQ)
|
||||||
## Features
|
|
||||||
|
# GitLens
|
||||||
Provides CodeLens with the author and date of the last check-in.
|
|
||||||
|
GitLens **supercharges** the built-in Visual Studio Code Git capabilities. It helps you to **visualize code authorship** at a glance via Git blame annotations and code lens, **seamlessly navigate and explore** the history of a file or branch, **gain valuable insights** via powerful comparison commands, and so much more.
|
||||||
> 
|
|
||||||
|
GitLens provides an unobtrusive blame annotation at the end of the current line, a status bar item showing the commit information (author and date, by default) of the current line, code lens showing the most recent commit and # of authors of the file and/or code block, and many commands for exploring commits and histories, comparing and navigating revisions, stash access, repository status, and more. GitLens is also [highly customizable](#extension-settings) to meet your specific needs — find code lens intrusive or the current line blame annotation distracting — no problem, it is easy to [turn them off or change how they behave](#extension-settings).
|
||||||
Clicking on a CodeLens opens a blame "explorer" with the commits and changed lines in the right pane and the commit (file) contents on the left.
|
|
||||||
|
### Preview — featuring blame annotations, code lens, status bar details, quick pick menus for navigation and exploration, compare with previous, and more
|
||||||
> 
|

|
||||||
|
|
||||||
## Requirements
|
## Features
|
||||||
|
|
||||||
Must be using Git and it must be in your path.
|
### Git Blame Annotations
|
||||||
|
|
||||||
## Extension Settings
|
- Adds an unobtrusive, highly [customizable](#line-blame-annotation-settings) and [themeable](#theme-settings), **Git blame annotation** to the end of the current line ([optional](#line-blame-annotation-settings), on by default)
|
||||||
|
|
||||||
None yet.
|

|
||||||
|
- Contains the author, date, and message of the line's most recent commit, by [default](#line-blame-annotation-settings)
|
||||||
## Known Issues
|
- Adds a `details` hover annotation to the current line annotation, which provides more commit details ([optional](#line-blame-annotation-settings), on by default)
|
||||||
|
- Adds a `changes` (diff) hover annotation to the current line annotation, which provides **instant** access to the line's previous version ([optional](#line-blame-annotation-settings), on by default)
|
||||||
Too many to count -- this is still very much a work in progress.
|
|
||||||
|

|
||||||
## Release Notes
|
|
||||||
|
- Adds on-demand, beautiful, highly [customizable](#file-blame-annotation-settings) and [themeable](#theme-settings), **Git blame annotations** of the whole file
|
||||||
### 0.0.1
|
|
||||||
|

|
||||||
Initial release but still heavily a work in progress.
|
- Choose between `gutter` (default) and `hover` [annotation styles](#file-blame-annotation-settings)
|
||||||
|
- Contains the commit message and date, by [default](#file-blame-annotation-settings)
|
||||||
|
- Adds a `details` hover annotation to the line's annotation, which provides more commit details ([optional](#file-blame-annotation-settings), on by default)
|
||||||
|
- Adds a `heatmap` (age) indicator to the gutter annotations (on right edge by [default](#file-blame-annotation-settings)), which provides an easy, at-a-glance way to tell the age of a line ([optional](#file-blame-annotation-settings), on by default)
|
||||||
|
- Indicator ranges from bright yellow (newer) to dark brown (older)
|
||||||
|
- Press `Escape` to quickly toggle the annotations off
|
||||||
|
|
||||||
|
- Adds [customizable](#status-bar-settings) **blame information** about the current line to the **status bar** ([optional](#status-bar-settings), on by default)
|
||||||
|
|
||||||
|

|
||||||
|
- Contains the commit author and date, by [default](#status-bar-settings)
|
||||||
|
- Clicking the status bar item will, by [default](#status-bar-settings), show a **commit details quick pick menu** with commands for comparing, navigating and exploring commits, and more
|
||||||
|
- Provides [customizable](#status-bar-settings) click behavior — choose between one of the following
|
||||||
|
- Toggle file blame annotations on and off
|
||||||
|
- Toggle code lens on and off
|
||||||
|
- Compare the line commit with the previous commit
|
||||||
|
- Compare the line commit with the working tree
|
||||||
|
- Show a quick pick menu with details and commands for the commit (default)
|
||||||
|
- Show a quick pick menu with file details and commands for the commit
|
||||||
|
- Show a quick pick menu with the commit history of the file
|
||||||
|
- Show a quick pick menu with the commit history of the current branch
|
||||||
|
|
||||||
|
- Adds a `Toggle File Blame Annotations` command (`gitlens.toggleFileBlame`) with a shortcut of `alt+b` to toggle the file blame annotations on and off
|
||||||
|
- Also adds a `Show File Blame Annotations` command (`gitlens.showFileBlame`)
|
||||||
|
|
||||||
|
- Adds a `Toggle Line Blame Annotations` command (`gitlens.toggleLineBlame`) to toggle the current line blame annotations on and off
|
||||||
|
- Also adds a `Show Line Blame Annotations` command (`gitlens.showLineBlame`)
|
||||||
|
|
||||||
|
### Git Recent Changes Annotations
|
||||||
|
|
||||||
|
- Adds on-demand, [customizable](#file-recent-changes-annotation-settings) and [themeable](#theme-settings), **recent changes annotations** of the whole file
|
||||||
|
- Highlights all of lines changed in the most recent commit
|
||||||
|
- Adds a `details` hover annotation to each line, which provides more commit details ([optional](#file-blame-annotation-settings), on by default)
|
||||||
|
- Adds a `changes` (diff) hover annotation to each line, which provides **instant** access to the line's previous version ([optional](#file-recent-changes-annotation-settings), on by default)
|
||||||
|
- Press `Escape` to quickly toggle the annotations off
|
||||||
|
|
||||||
|
- Adds `Toggle Recent File Changes Annotations` command (`gitlens.toggleFileRecentChanges`) to toggle the recent changes annotations on and off
|
||||||
|
|
||||||
|
### Git Code Lens
|
||||||
|
|
||||||
|
- Adds **code lens** to the top of the file and on code blocks ([optional](#code-lens-settings), on by default)
|
||||||
|
|
||||||
|

|
||||||
|
- **Recent Change** — author and date of the most recent commit for the file or code block
|
||||||
|
- Clicking the code lens will, by [default](#code-lens-settings), show a **commit file details quick pick menu** with commands for comparing, navigating and exploring commits, and more
|
||||||
|
- **Authors** — number of authors of the file or code block and the most prominent author (if there is more than one)
|
||||||
|
- Clicking the code lens will, by [default](#code-lens-settings), toggle the file Git blame annotations on and off of the whole file
|
||||||
|
- Will be hidden if the author of the most recent commit is also the only author of the file or block, to avoid duplicate information and reduce visual noise
|
||||||
|
|
||||||
|
- Provides [customizable](#code-lens-settings) click behavior for each code lens — choose between one of the following
|
||||||
|
- Toggle file blame annotations on and off
|
||||||
|
- Compare the commit with the previous commit
|
||||||
|
- Show a quick pick menu with details and commands for the commit
|
||||||
|
- Show a quick pick menu with file details and commands for the commit
|
||||||
|
- Show a quick pick menu with the commit history of the file
|
||||||
|
- Show a quick pick menu with the commit history of the current branch
|
||||||
|
|
||||||
|
- Adds a `Toggle Git Code Lens` command (`gitlens.toggleCodeLens`) with a shortcut of `shift+alt+b` to toggle the code lens on and off
|
||||||
|
|
||||||
|
### Powerful Comparison Tools
|
||||||
|
|
||||||
|
- Effortlessly navigate between comparisons via the `alt+,` and `alt+.` shortcut keys to go back and forth through a file's revisions
|
||||||
|
|
||||||
|
- Provides easy access to the following comparison commands via the `Command Palette` as well as in context via the many provided quick pick menus
|
||||||
|
|
||||||
|
- Adds a `Directory Compare` command (`gitlens.diffDirectory`) to open the configured Git difftool to compare directories between branches
|
||||||
|
|
||||||
|
- Adds a `Compare File with Branch...` command (`gitlens.diffWithBranch`) to compare the active file with the same file on the selected branch
|
||||||
|
|
||||||
|
- Adds a `Compare File with Next Commit` command (`gitlens.diffWithNext`) with a shortcut of `alt+.` to compare the active file/diff with the next commit revision
|
||||||
|
|
||||||
|
- Adds a `Compare File with Previous` command (`gitlens.diffWithPrevious`) with a shortcut of `alt+,` to compare the active file/diff with the previous commit revision
|
||||||
|
|
||||||
|
- Adds a `Compare Line Commit with Previous` command (`gitlens.diffLineWithPrevious`) with a shortcut of `shift+alt+,` to compare the active file/diff with the previous line commit revision
|
||||||
|
|
||||||
|
- Adds a `Compare File with Revision...` command (`gitlens.diffWithRevision`) to compare the active file with the selected revision of the same file
|
||||||
|
|
||||||
|
- Adds a `Compare File with Working Tree` command (`gitlens.diffWithWorking`) with a shortcut of `shift+alt+w` to compare the most recent commit revision of the active file/diff with the working tree
|
||||||
|
|
||||||
|
- Adds a `Compare Line Commit with Working Tree` command (`gitlens.diffLineWithWorking`) with a shortcut of `alt+w` to compare the commit revision of the active line with the working tree
|
||||||
|
|
||||||
|
### Navigate and Explore
|
||||||
|
|
||||||
|
- Adds a `Git Stashes` explorer to the Explorer activity ([optional](#git-stashes-explorer-settings), off by default)
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Shows all of the stashed changes in the repository
|
||||||
|
- Provides toolbar buttons to `Stash Changes` and `Refresh`
|
||||||
|
- Provides a context menu with `Apply Stashed Changes` and `Delete Stashed Changes` commands — both require a confirmation
|
||||||
|
- Expand each stash to quickly see the set of files changed, complete with status indicators for adds, changes, renames, and deletes
|
||||||
|
- Provides a context menu with `Open Changes`, `Open File`, `Open Stashed File`, `Open File in Remote`, and `Compare File with Working Tree` commands
|
||||||
|
|
||||||
|
- Adds a `Search Commits` command (`gitlens.showCommitSearch`) with a shortcut of `alt+/` to search for commits by message, author, file(s), or commit id
|
||||||
|
|
||||||
|
- Adds commands to open files, commits, branches, and the repository in the supported remote services, currently **BitBucket, GitHub, GitLab, and Visual Studio Team Services** — only available if a Git upstream service is configured in the repository
|
||||||
|
- `Open Branch in Remote` command (`gitlens.openBranchInRemote`) — opens the current branch commits in the supported remote service
|
||||||
|
- `Open Commit in Remote` command (`gitlens.openCommitInRemote`) — opens the commit revision of the active line in the supported remote service
|
||||||
|
- `Open File in Remote` command (`gitlens.openFileInRemote`) — opens the active file/revision in the supported remote service
|
||||||
|
- `Open Repository in Remote` command (`gitlens.openRepoInRemote`) — opens the repository in the supported remote service
|
||||||
|
|
||||||
|
- Adds a `Show Current Branch History` command (`gitlens.showQuickRepoHistory`) with a shortcut of `shift+alt+h` to show a paged **branch history quick pick menu** of the current branch for exploring its commit history
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Provides entries to `Show Commit Search` and `Open Branch in <remote-service>` when available
|
||||||
|
- Navigate back to the previous quick pick menu via `alt+left arrow`, if available
|
||||||
|
- Navigate pages via `alt+,` and `alt+.` to go backward and forward respectively
|
||||||
|
|
||||||
|
- Adds a `Show Branch History` command (`gitlens.showQuickBranchHistory`) to show a paged **branch history quick pick menu** of the selected branch for exploring its commit history
|
||||||
|
- Provides the same features as `Show Current Branch History` above
|
||||||
|
|
||||||
|
- Adds a `Show File History` command (`gitlens.showQuickFileHistory`) to show a paged **file history quick pick menu** of the active file for exploring its commit history
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Provides entries to `Show Branch History` and `Open File in <remote-service>` when available
|
||||||
|
- Navigate back to the previous quick pick menu via `alt+left arrow`, if available
|
||||||
|
- Navigate pages via `alt+,` and `alt+.` to go backward and forward respectively
|
||||||
|
|
||||||
|
- Adds a `Show Commit Details` command (`gitlens.showQuickCommitDetails`) to show a **commit details quick pick menu** of the most recent commit of the active file
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Quickly see the set of files changed in the commit, complete with status indicators for adds, changes, renames, and deletes
|
||||||
|
- Provides entries to `Copy to Clipboard`, `Directory Compare`, `Open Changed Files`, `Open File in <remote-service>` when available, and more
|
||||||
|
- Navigate back to the previous quick pick menu via `alt+left arrow`, if available
|
||||||
|
- Use the `alt+right arrow` shortcut on an entry to execute it without closing the quick pick menu, if possible — commands that open windows outside of VS Code will still close the quick pick menu unless [`"gitlens.advanced.quickPick.closeOnFocusOut": false`](#extension-settings) is set
|
||||||
|
- Use the `alt+right arrow` shortcut on a file entry in the `Changed Files` section to preview the comparison of the current revision with the previous one
|
||||||
|
|
||||||
|
- Adds a `Show Commit File Details` command (`gitlens.showQuickCommitFileDetails`) with a shortcut of `alt+c` to show a **file commit details quick pick menu** of the most recent commit of the active file
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Provides entries to `Show Commit Details`, `Show File History`, `Compare File with...`, `Copy to Clipboard`, `Open File`, `Open File in <remote-service>` when available, and more
|
||||||
|
- Navigate back to the previous quick pick menu via `alt+left arrow`, if available
|
||||||
|
- Use the `alt+right arrow` shortcut on an entry to execute it without closing the quick pick menu, if possible — commands that open windows outside of VS Code will still close the quick pick menu unless [`"gitlens.advanced.quickPick.closeOnFocusOut": false`](#extension-settings) is set
|
||||||
|
|
||||||
|
- Adds a `Show Repository Status` command (`gitlens.showQuickRepoStatus`) with a shortcut of `alt+s` to show a **repository status quick pick menu** for visualizing the current repository status
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Quickly see upstream status (if an Git upstream is configured) — complete with ahead and behind information
|
||||||
|
- If you are ahead of the upstream, an entry will be shown with the number of commits ahead. Choosing it will show a limited **branch history quick pick menu** containing just the commits ahead of the upstream
|
||||||
|
- If you are behind the upstream, an entry will be shown with the number of commits behind. Choosing it will show a limited **branch history quick pick menu** containing just the commits behind the upstream
|
||||||
|
- Quickly see all working changes, both staged and unstaged, complete with status indicators for adds, changes, renames, and deletes
|
||||||
|
- Provides entries to `Show Stashed Changes`, `Open Changed Files`, and `Close Unchanged Files`
|
||||||
|
- Use the `alt+right arrow` shortcut on an entry to execute it without closing the quick pick menu, if possible — commands that open windows outside of VS Code will still close the quick pick menu unless [`"gitlens.advanced.quickPick.closeOnFocusOut": false`](#extension-settings) is set
|
||||||
|
- Use the `alt+right arrow` shortcut on a file entry in the `Staged Files` or `Unstaged Files` sections to preview the comparison of the working file with the previous revision
|
||||||
|
|
||||||
|
- Adds a `Show Stashed Changes` command (`gitlens.showQuickStashList`) to show a **stashed changes quick pick menu** for exploring your repository stash history
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Provides entries to `Stash Changes`
|
||||||
|
- Navigate back to the previous quick pick menu via `alt+left arrow`, if available
|
||||||
|
|
||||||
|
- Choosing a stash entry shows a **stash details quick pick menu** which is very similar to the **commit details quick pick menu** above
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
- Quickly see the set of files changed in the stash, complete with status indicators for adds, changes, renames, and deletes
|
||||||
|
- Provides entries to `Copy Message to Clipboard`, `Directory Compare`, and `Open Changed Files`
|
||||||
|
- Provides entries to `Apply Stashed Changes` and `Delete Stashed Changes` — both require a confirmation
|
||||||
|
- Navigate back to the previous quick pick menu via `alt+left arrow`, if available
|
||||||
|
- Use the `alt+right arrow` shortcut on an entry to execute it without closing the quick pick menu, if possible — commands that open windows outside of VS Code will still close the quick pick menu unless [`"gitlens.advanced.quickPick.closeOnFocusOut": false`](#extension-settings) is set
|
||||||
|
- Use the `alt+right arrow` shortcut on a file entry in the `Changed Files` section to preview the comparison of the current revision with the previous one
|
||||||
|
|
||||||
|
- Adds a `Show Last Opened Quick Pick` command (`gitlens.showLastQuickPick`) with a shortcut of `alt+-` to quickly get back to where you were when the last GitLens quick pick menu closed
|
||||||
|
|
||||||
|
- Adds a `Open File History Explorer` command (`gitlens.showFileHistory`) to show a **file history explorer** (peek style) to visualize the history of a file
|
||||||
|
- Likely to be deprecated in a future release, add your voice to [#66](https://github.com/eamodio/vscode-gitlens/issues/66) if you feel it should not be removed
|
||||||
|
|
||||||
|
- Adds a `Open Blame History Explorer` command (`gitlens.showBlameHistory`) to show a **blame history explorer** (peek style) to visualize the blame history of a file or code block
|
||||||
|
- Likely to be deprecated in a future release, add your voice to [#66](https://github.com/eamodio/vscode-gitlens/issues/66) if you feel it should not be removed
|
||||||
|
|
||||||
|
### And More
|
||||||
|
|
||||||
|
- Adds a `Copy Commit ID to Clipboard` command (`gitlens.copyShaToClipboard`) to copy the commit id (sha) of the active line to the clipboard or from the most recent commit to the current branch, if there is no active editor
|
||||||
|
|
||||||
|
- Adds a `Copy Commit Message to Clipboard` command (`gitlens.copyMessageToClipboard`) to copy the commit message of the active line to the clipboard or from the most recent commit to the current branch, if there is no active editor
|
||||||
|
|
||||||
|
- Adds a `Open Changed Files` command (`gitlens.openChangedFiles`) to open any files with working tree changes
|
||||||
|
|
||||||
|
- Adds a `Close Unchanged Files` command (`gitlens.closeUnchangedFiles`) to close any files without working tree changes
|
||||||
|
|
||||||
|
- Adds a `Apply Stashed Changes` command (`gitlens.stashApply`) to chose a stash entry to apply to the working tree from a quick pick menu
|
||||||
|
|
||||||
|
- Adds a `Stash Changes` command (`gitlens.stashSave`) to save any working tree changes to the stash — can optionally provide a stash message
|
||||||
|
|
||||||
|
## Insiders
|
||||||
|
|
||||||
|
Add [`"gitlens.insiders": true`](#general-extension-settings) to your settings to join the insiders channel and get early access to upcoming features. Be aware that because this provides early access expect there to be issues.
|
||||||
|
|
||||||
|
## Extension Settings
|
||||||
|
|
||||||
|
GitLens is highly customizable and provides many configuration settings to allow the personalization of almost all features
|
||||||
|
|
||||||
|
### General Settings
|
||||||
|
|
||||||
|
|Name | Description
|
||||||
|
|-----|------------
|
||||||
|
|`gitlens.defaultDateFormat`|Specifies how all absolute dates will be formatted by default\nSee https://momentjs.com/docs/#/displaying/format/ for valid formats
|
||||||
|
|`gitlens.insiders`|Opts into the insiders channel -- provides access to upcoming features
|
||||||
|
|`gitlens.outputLevel`|Specifies how much (if any) output will be sent to the GitLens output channel
|
||||||
|
|
||||||
|
### Blame Annotation Settings
|
||||||
|
|
||||||
|
#### File Blame Annotation Settings
|
||||||
|
|
||||||
|
|Name | Description
|
||||||
|
|-----|------------
|
||||||
|
|`gitlens.blame.file.annotationType`|Specifies the type of blame annotations that will be shown for the current file<br />`gutter` - adds an annotation to the beginning of each line<br />`hover` - shows annotations when hovering over each line
|
||||||
|
|`gitlens.blame.file.lineHighlight.enabled`|Specifies whether or not to highlight lines associated with the current line
|
||||||
|
|`gitlens.blame.file.lineHighlight.locations`|Specifies where the associated line highlights will be shown<br />`gutter` - adds a gutter glyph<br />`line` - adds a full-line highlight background color<br />`overviewRuler` - adds a decoration to the overviewRuler (scroll bar)
|
||||||
|
|`gitlens.annotations.file.gutter.format`|Specifies the format of the gutter blame annotations<br />Available tokens<br />`${id}` - commit id<br />`${author}` - commit author<br />`${message}` - commit message<br />`${ago}` - relative commit date (e.g. 1 day ago)<br />`${date}` - formatted commit date (format specified by `gitlens.annotations.file.gutter.dateFormat`)<br />`${authorAgo}` - commit author, relative commit date<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting
|
||||||
|
|`gitlens.annotations.file.gutter.dateFormat`|Specifies how to format absolute dates (using the `${date}` token) in gutter blame annotations<br />See https://momentjs.com/docs/#/displaying/format/ for valid formats
|
||||||
|
|`gitlens.annotations.file.gutter.compact`|Specifies whether or not to compact (deduplicate) matching adjacent gutter blame annotations
|
||||||
|
|`gitlens.annotations.file.gutter.heatmap.enabled`|Specifies whether or not to provide a heatmap indicator in the gutter blame annotations
|
||||||
|
|`gitlens.annotations.file.gutter.heatmap.location`|Specifies where the heatmap indicators will be shown in the gutter blame annotations<br />`left` - adds a heatmap indicator on the left edge of the gutter blame annotations<br />`right` - adds a heatmap indicator on the right edge of the gutter blame annotations
|
||||||
|
|`gitlens.annotations.file.gutter.hover.details`|Specifies whether or not to provide a commit details hover annotation over the gutter blame annotations
|
||||||
|
|`gitlens.annotations.file.gutter.hover.wholeLine`|Specifies whether or not to trigger hover annotations over the whole line
|
||||||
|
|`gitlens.annotations.file.hover.heatmap.enabled`|Specifies whether or not to provide heatmap indicators on the left edge of each line
|
||||||
|
|`gitlens.annotations.file.hover.wholeLine`|Specifies whether or not to trigger hover annotations over the whole line
|
||||||
|
|
||||||
|
#### Line Blame Annotation Settings
|
||||||
|
|
||||||
|
|Name | Description
|
||||||
|
|-----|------------
|
||||||
|
|`gitlens.blame.line.enabled`|Specifies whether or not to provide a blame annotation for the current line, by default<br />Use the `gitlens.toggleLineBlame` command to toggle the annotations on and off for the current session
|
||||||
|
|`gitlens.blame.line.annotationType`|Specifies the type of blame annotations that will be shown for the current line<br />`trailing` - adds an annotation to the end of the current line<br />`hover` - shows annotations when hovering over the current line
|
||||||
|
|`gitlens.annotations.line.trailing.format`|Specifies the format of the trailing blame annotations<br />Available tokens<br />`${id}` - commit id<br />`${author}` - commit author<br />`${message}` - commit message<br />`${ago}` - relative commit date (e.g. 1 day ago)<br />`${date}` - formatted commit date (format specified by `gitlens.annotations.line.trailing.dateFormat`)<br />`${authorAgo}` - commit author, relative commit date<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting
|
||||||
|
|`gitlens.annotations.line.trailing.dateFormat`|Specifies how to format absolute dates (using the `${date}` token) in trailing blame annotations<br />See https://momentjs.com/docs/#/displaying/format/ for valid formats
|
||||||
|
|`gitlens.annotations.line.trailing.hover.details`|Specifies whether or not to provide a commit details hover annotation over the trailing blame annotations
|
||||||
|
|`gitlens.annotations.line.trailing.hover.changes`|Specifies whether or not to provide a changes (diff) hover annotation over the trailing blame annotations
|
||||||
|
|`gitlens.annotations.line.trailing.hover.wholeLine`|Specifies whether or not to trigger hover annotations over the whole line
|
||||||
|
|`gitlens.annotations.line.hover.details`|Specifies whether or not to provide a commit details hover annotation for the current line
|
||||||
|
|`gitlens.annotations.line.hover.changes`|Specifies whether or not to provide a changes (diff) hover annotation for the current line
|
||||||
|
|
||||||
|
### File Recent Changes Annotation Settings
|
||||||
|
|
||||||
|
|Name | Description
|
||||||
|
|-----|------------
|
||||||
|
|`gitlens.recentChanges.file.lineHighlight.locations`|Specifies where the highlights of the recently changed lines will be shown<br />`gutter` - adds a gutter glyph<br />`line` - adds a full-line highlight background color<br />`overviewRuler` - adds a decoration to the overviewRuler (scroll bar)
|
||||||
|
|`gitlens.annotations.file.recentChanges.hover.details`|Specifies whether or not to provide a commit details hover annotation
|
||||||
|
|`gitlens.annotations.file.recentChanges.hover.changes`|Specifies whether or not to provide a changes (diff) hover annotation
|
||||||
|
|`gitlens.annotations.file.recentChanges.hover.wholeLine`|Specifies whether or not to trigger hover annotations over the whole line
|
||||||
|
|
||||||
|
### Code Lens Settings
|
||||||
|
|
||||||
|
|Name | Description
|
||||||
|
|-----|------------
|
||||||
|
|`gitlens.codeLens.enabled`|Specifies whether or not to provide any Git code lens, by default<br />Use the `gitlens.toggleCodeLens` command to toggle the Git code lens on and off for the current session
|
||||||
|
|`gitlens.codeLens.recentChange.enabled`|Specifies whether or not to show a `recent change` code lens showing the author and date of the most recent commit for the file or code block
|
||||||
|
|`gitlens.codeLens.recentChange.command`|Specifies the command to be executed when the `recent change` code lens is clicked<br />`gitlens.toggleFileBlame` - toggles file blame annotations<br />`gitlens.showBlameHistory` - opens the blame history explorer<br />`gitlens.showFileHistory` - opens the file history explorer<br />`gitlens.diffWithPrevious` - compares the current committed file with the previous commit<br />`gitlens.showQuickCommitDetails` - shows a commit details quick pick<br />`gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick<br />`gitlens.showQuickFileHistory` - shows a file history quick pick<br />`gitlens.showQuickRepoHistory` - shows a branch history quick pick
|
||||||
|
|`gitlens.codeLens.authors.enabled`|Specifies whether or not to show an `authors` code lens showing number of authors of the file or code block and the most prominent author (if there is more than one)
|
||||||
|
|`gitlens.codeLens.authors.command`|Specifies the command to be executed when the `authors` code lens is clicked<br />`gitlens.toggleFileBlame` - toggles file blame annotations<br />`gitlens.showBlameHistory` - opens the blame history explorer<br />`gitlens.showFileHistory` - opens the file history explorer<br />`gitlens.diffWithPrevious` - compares the current committed file with the previous commit<br />`gitlens.showQuickCommitDetails` - shows a commit details quick pick<br />`gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick<br />`gitlens.showQuickFileHistory` - shows a file history quick pick<br />`gitlens.showQuickRepoHistory` - shows a branch history quick pick
|
||||||
|
|`gitlens.codeLens.locations`|Specifies where Git code lens will be shown in the document<br />`document` - adds code lens at the top of the document<br />`containers` - adds code lens at the start of container-like symbols (modules, classes, interfaces, etc)<br />`blocks` - adds code lens at the start of block-like symbols (functions, methods, properties, etc) lines<br />`custom` - adds code lens at the start of symbols contained in `gitlens.codeLens.locationCustomSymbols`
|
||||||
|
|`gitlens.codeLens.customLocationSymbols`|Specifies the set of document symbols where Git code lens will be shown in the document
|
||||||
|
|`gitlens.codeLens.perLanguageLocations`|Specifies where Git code lens will be shown in the document for the specified languages
|
||||||
|
|
||||||
|
### Git Stashes Explorer Settings
|
||||||
|
|
||||||
|
|Name | Description
|
||||||
|
|-----|------------
|
||||||
|
|`gitlens.stashExplorer.stashFormat`|Specifies the format of stashed changes in the `Git Stashes` explorer <br />Available tokens<br /> ${id} - commit id<br /> ${author} - commit author<br /> ${message} - commit message<br /> ${ago} - relative commit date (e.g. 1 day ago)<br /> ${date} - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)<br /> ${authorAgo} - commit author, relative commit date<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting
|
||||||
|
|`gitlens.stashExplorer.stashFileFormat`|Specifies the format of a stashed file in the `Git Stashes` explorer <br />Available tokens<br /> ${file} - file name<br /> ${path} - file path
|
||||||
|
|
||||||
|
### Status Bar Settings
|
||||||
|
|
||||||
|
|Name | Description
|
||||||
|
|-----|------------
|
||||||
|
|`gitlens.statusBar.enabled`|Specifies whether or not to provide blame information on the status bar
|
||||||
|
|`gitlens.statusBar.alignment`|Specifies the blame alignment in the status bar<br />`left` - align to the left, `right` - align to the right
|
||||||
|
|`gitlens.statusBar.command`|Specifies the command to be executed when the blame status bar item is clicked<br />`gitlens.toggleFileBlame` - toggles file blame annotations<br />`gitlens.showBlameHistory` - opens the blame history explorer<br />`gitlens.showFileHistory` - opens the file history explorer<br />`gitlens.diffWithPrevious` - compares the current line commit with the previous<br />`gitlens.diffWithWorking` - compares the current line commit with the working tree<br />`gitlens.toggleCodeLens` - toggles Git code lens<br />`gitlens.showQuickCommitDetails` - shows a commit details quick pick<br />`gitlens.showQuickCommitFileDetails` - shows a commit file details quick pick<br />`gitlens.showQuickFileHistory` - shows a file history quick pick<br />`gitlens.showQuickRepoHistory` - shows a branch history quick pick
|
||||||
|
|`gitlens.statusBar.format`|Specifies the format of the blame information on the status bar<br />Available tokens<br />`${id}` - commit id<br />`${author}` - commit author<br />`${message}` - commit message<br />`${ago}` - relative commit date (e.g. 1 day ago)<br />`${date}` - formatted commit date (format specified by `gitlens.statusBar.dateFormat`)<br />See https://github.com/eamodio/vscode-gitlens/wiki/Advanced-Formatting for advanced formatting
|
||||||
|
|`gitlens.statusBar.dateFormat`|Specifies the date format of absolute dates shown in the blame information on the status bar<br />See https://momentjs.com/docs/#/displaying/format/ for valid formats
|
||||||
|
|
||||||
|
### Strings Settings
|
||||||
|
|
||||||
|
|Name | Description
|
||||||
|
|-----|------------
|
||||||
|
|`gitlens.strings.codeLens.unsavedChanges.recentChangeAndAuthors`|Specifies the string to be shown in place of both the `recent change` and `authors` code lens when there are unsaved changes
|
||||||
|
|`gitlens.strings.codeLens.unsavedChanges.recentChangeOnly`|Specifies the string to be shown in place of the `recent change` code lens when there are unsaved changes
|
||||||
|
|`gitlens.strings.codeLens.unsavedChanges.authorsOnly`|Specifies the string to be shown in place of the `authors` code lens when there are unsaved changes
|
||||||
|
|
||||||
|
### Theme Settings
|
||||||
|
|
||||||
|
|Name | Description
|
||||||
|
|-----|------------
|
||||||
|
|`gitlens.theme.annotations.file.gutter.separateLines`|Specifies whether or not gutter blame annotations will have line separators
|
||||||
|
|`gitlens.theme.annotations.file.gutter.dark.backgroundColor`|Specifies the dark theme background color of the gutter blame annotations
|
||||||
|
|`gitlens.theme.annotations.file.gutter.light.backgroundColor`|Specifies the light theme background color of the gutter blame annotations
|
||||||
|
|`gitlens.theme.annotations.file.gutter.dark.foregroundColor`|Specifies the dark theme foreground color of the gutter blame annotations
|
||||||
|
|`gitlens.theme.annotations.file.gutter.light.foregroundColor`|Specifies the light theme foreground color of the gutter blame annotations
|
||||||
|
|`gitlens.theme.annotations.file.gutter.dark.uncommittedForegroundColor`|Specifies the dark theme foreground color of an uncommitted line in the gutter blame annotations
|
||||||
|
|`gitlens.theme.annotations.file.gutter.light.uncommittedForegroundColor`|Specifies the light theme foreground color of an uncommitted line in the gutter blame annotations
|
||||||
|
|`gitlens.theme.annotations.line.trailing.dark.backgroundColor`|Specifies the dark theme background color of the trailing blame annotation
|
||||||
|
|`gitlens.theme.annotations.line.trailing.light.backgroundColor`|Specifies the light theme background color of the trailing blame annotation
|
||||||
|
|`gitlens.theme.annotations.line.trailing.dark.foregroundColor`|Specifies the dark theme foreground color of the trailing blame annotation
|
||||||
|
|`gitlens.theme.annotations.line.trailing.light.foregroundColor`|Specifies the light theme foreground color of the trailing blame annotation
|
||||||
|
|`gitlens.theme.lineHighlight.dark.backgroundColor`|Specifies the dark theme background color of the associated line highlights in blame annotations. Must be a valid css color
|
||||||
|
|`gitlens.theme.lineHighlight.light.backgroundColor`|Specifies the light theme background color of the associated line highlights in blame annotations. Must be a valid css color
|
||||||
|
|`gitlens.theme.lineHighlight.dark.overviewRulerColor`|Specifies the dark theme overview ruler color of the associated line highlights in blame annotations
|
||||||
|
|`gitlens.theme.lineHighlight.light.overviewRulerColor`|Specifies the light theme overview ruler color of the associated line highlights in blame annotations
|
||||||
|
|
||||||
|
### Advanced Settings
|
||||||
|
|
||||||
|
|Name | Description
|
||||||
|
|-----|------------
|
||||||
|
|`gitlens.advanced.toggleWhitespace.enabled`|Specifies whether or not to toggle whitespace off then showing blame annotations (*may* be required by certain fonts/themes)
|
||||||
|
|`gitlens.advanced.telemetry.enabled`|Specifies whether or not to enable GitLens telemetry (even if enabled still abides by the overall `telemetry.enableTelemetry` setting
|
||||||
|
|`gitlens.advanced.menus`|Specifies which commands will be added to which menus
|
||||||
|
|`gitlens.advanced.caching.enabled`|Specifies whether git output will be cached
|
||||||
|
|`gitlens.advanced.caching.maxLines`|Specifies the threshold for caching larger documents
|
||||||
|
|`gitlens.advanced.git`|Specifies the git path to use
|
||||||
|
|`gitlens.advanced.gitignore.enabled`|Specifies whether or not to parse the root .gitignore file for better performance (i.e. avoids blaming excluded files)
|
||||||
|
|`gitlens.advanced.maxQuickHistory`|Specifies the maximum number of QuickPick history entries to show
|
||||||
|
|`gitlens.advanced.quickPick.closeOnFocusOut`|Specifies whether or not to close the QuickPick menu when focus is lost
|
||||||
|
|
||||||
|
## Known Issues
|
||||||
|
|
||||||
|
- If the `Copy to * clipboard` commands don't work on Linux -- `xclip` needs to be installed. You can install it via `sudo apt-get install xclip`
|
||||||
|
- Visible whitespace causes issues ([vscode issue #11485](https://github.com/Microsoft/vscode/issues/11485)) with the `expanded` and `compact` blame annotation styles when using a non-monospace font -- set `"gitlens.advanced.toggleWhitespace.enabled": true` if you are using a non-monospace font
|
||||||
|
|
||||||
|
## Contributors
|
||||||
|
|
||||||
|
A big thanks to the people that have contributed to this project:
|
||||||
|
|
||||||
|
- Peng Lyu ([@rebornix](https://github.com/rebornix)) — [contributions](https://github.com/eamodio/vscode-gitlens/commits?author=rebornix))
|
||||||
|
- Aurelio Ogliari ([@nobitagit](https://github.com/nobitagit)) — [contributions](https://github.com/eamodio/vscode-gitlens/commits?author=nobitagit)
|
||||||
|
- Johannes Rieken ([@jrieken](https://github.com/jrieken)) — [contributions](https://github.com/eamodio/vscode-gitlens/commits?author=jrieken))
|
||||||
|
- Zack Schuster ([@zackschuster](https://github.com/zackschuster)) — [contributions](https://github.com/eamodio/vscode-gitlens/commits?author=zackschuster)
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 24 KiB |
BIN
images/chat-badge.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
88
images/chat-badge.svg
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||||
|
width="92" height="20" xml:space="preserve">
|
||||||
|
<style type="text/css">
|
||||||
|
.white{fill:#FFF;}
|
||||||
|
.shadow{fill:#2e840e;}
|
||||||
|
</style>
|
||||||
|
<linearGradient id="b" x2="0" y2="100%">
|
||||||
|
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
|
||||||
|
<stop offset="1" stop-opacity=".1"/>
|
||||||
|
</linearGradient>
|
||||||
|
<clipPath id="a">
|
||||||
|
<rect width="92" height="20" rx="3" fill="#fff"/>
|
||||||
|
</clipPath>
|
||||||
|
<g clip-path="url(#a)">
|
||||||
|
<path fill="#555" d="M0 0h34v20H0z"/>
|
||||||
|
<path fill="#4c1" d="M34 0h58v20H34z"/>
|
||||||
|
<path fill="url(#b)" d="M0 0h92v20H0z"/>
|
||||||
|
</g>
|
||||||
|
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="11">
|
||||||
|
<text x="17" y="15" fill="#010101" fill-opacity=".3">chat</text>
|
||||||
|
<text x="17" y="14">chat</text>
|
||||||
|
<g transform="scale(0.1) translate(340, -21)">
|
||||||
|
<path class="shadow" d="M263.5,105.5c3.9,1.7,4.2,3,1.1,8.8c-3.1,6-3.9,6.3-7.7,4.8c-4.8-2.1-11-3.6-15-3.6c-6.5,0-10.9,2.3-10.9,5.9
|
||||||
|
c0,11.7,37.4,5.4,37.4,30.4c0,12.6-10.8,21-27,21c-8.5,0-19-2.8-26.3-6.5c-3.6-1.8-3.8-2.9-0.7-8.9c2.7-5.3,3.6-5.8,7.5-4.2
|
||||||
|
c6.2,2.7,14,4.8,19.3,4.8c6,0,9.9-2.4,9.9-6c0-11.4-38.1-6-38.1-30.2c0-12.9,10.7-21.5,26.8-21.5
|
||||||
|
C247.4,100.2,256.9,102.5,263.5,105.5z"/>
|
||||||
|
<path class="shadow" d="M293.7,75.8V169c0,1.4-1.5,2.9-3.6,2.9h-9.8c-2.1,0-3.6-1.5-3.6-2.9V75.8c0-4.6,1.3-5,8.5-5
|
||||||
|
C293.4,70.7,293.7,71.3,293.7,75.8z"/>
|
||||||
|
<path class="shadow" d="M363.4,128.2v40.1c0,2.1-1.5,3.6-3.6,3.6h-9.7c-2.2,0-3.8-1.6-3.6-3.8l0.1-4.3c-5.3,5.8-12.8,8.9-20.3,8.9
|
||||||
|
c-14.6,0-24.4-8.5-24.4-21.1c0-13.4,11.1-22.5,27.7-22.5c6.3,0,12.1,1.1,16.8,3.1v-4.6c0-7.4-5.8-11.8-15.7-11.8
|
||||||
|
c-4.6,0-10.3,1.8-14.8,4.5c-3.5,2-4.3,1.8-8.1-3.8c-3.7-5.6-3.6-6.7,0-9c6.8-4.4,16.1-7.2,24.6-7.2
|
||||||
|
C351.4,100.2,363.4,110.6,363.4,128.2z M318.2,151.4c0,4.8,4,8,10.2,8c7.4,0,14.1-3.6,18-9.6v-6.3c-3.9-1.5-8.7-2.3-12.9-2.3
|
||||||
|
C324.3,141.2,318.2,145.5,318.2,151.4z"/>
|
||||||
|
<path class="shadow" d="M429.9,105.6c3.6,2.1,3.7,3.2-0.2,9.2c-3.7,5.7-4.3,6-8.2,4c-3-1.6-7.7-2.9-11.7-2.9
|
||||||
|
c-12.3,0-20.5,8.1-20.5,20.3c0,12.7,8.2,21.2,20.5,21.2c4.3,0,9.6-1.6,13.1-3.6c3.6-2.1,4.3-1.9,8.1,3.6c3.4,5.1,3.3,6.3,0.3,8.5
|
||||||
|
c-5.5,3.8-14.1,6.7-21.7,6.7c-22.7,0-37.9-14.6-37.9-36.4c0-21.7,15.2-36.1,38.1-36.1C416.6,100.2,424.8,102.6,429.9,105.6z"/>
|
||||||
|
<path class="shadow" d="M504.1,163.1c2.8,3.6,1.7,4.9-5.4,7.5c-7.2,2.6-8.2,2.5-10.8-0.9l-20.3-27.1l-9.1,8.8V169
|
||||||
|
c0,1.4-1.5,2.9-3.6,2.9H445c-2.1,0-3.6-1.5-3.6-2.9V75.8c0-4.6,1.3-5,8.5-5c8.2,0,8.5,0.6,8.5,5v53l27.8-26.7
|
||||||
|
c3.1-2.9,4.8-2.7,10.2,0.9c6,3.9,6.5,5,3.6,7.8L479.3,131L504.1,163.1z"/>
|
||||||
|
</g>
|
||||||
|
<g transform="scale(0.1) translate(340, -21)">
|
||||||
|
<rect x="115.9" y="126.3" transform="matrix(0.9482 -0.3176 0.3176 0.9482 -36.3582 46.5843)" class="shadow" width="17.6" height="17"/>
|
||||||
|
<g>
|
||||||
|
<rect x="115.9" y="126.3" transform="matrix(0.9482 -0.3176 0.3176 0.9482 -36.3582 46.5843)" class="shadow" width="17.6" height="17"/>
|
||||||
|
<path class="shadow" d="M182,117.5c-12.9-43-31.5-53-74.5-40.1s-53,31.5-40.1,74.5s31.5,53,74.5,40.1S194.9,160.5,182,117.5z
|
||||||
|
M160.3,145.4l-8.1,2.7l2.8,8.4c1.1,3.4-0.7,7.1-4.1,8.2c-0.7,0.2-1.5,0.4-2.2,0.3c-2.6-0.1-5.1-1.8-6-4.4l-2.8-8.4l-16.7,5.6
|
||||||
|
l2.8,8.4c1.1,3.4-0.7,7.1-4.1,8.2c-0.7,0.2-1.5,0.4-2.2,0.3c-2.6-0.1-5.1-1.8-6-4.4l-2.8-8.4l-8.1,2.7c-0.7,0.2-1.5,0.4-2.2,0.3
|
||||||
|
c-2.6-0.1-5.1-1.8-6-4.4c-1.1-3.4,0.7-7.1,4.1-8.2l8.1-2.7l-5.4-16.1l-8.1,2.7c-0.7,0.2-1.5,0.4-2.2,0.3c-2.6-0.1-5.1-1.8-6-4.4
|
||||||
|
c-1.1-3.4,0.7-7.1,4.1-8.2l8.1-2.7l-2.8-8.4c-1.1-3.4,0.7-7.1,4.1-8.2s7.1,0.7,8.2,4.1l2.8,8.4l16.7-5.6l-2.8-8.4
|
||||||
|
c-1.1-3.4,0.7-7.1,4.1-8.2s7.1,0.7,8.2,4.1l2.8,8.4l8.1-2.7c3.4-1.1,7.1,0.7,8.2,4.1c1.1,3.4-0.7,7.1-4.1,8.2l-8.1,2.7l5.4,16.1
|
||||||
|
l8.1-2.7c3.4-1.1,7.1,0.7,8.2,4.1C165.5,140.6,163.7,144.3,160.3,145.4z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
<g transform="scale(0.1) translate(340, -31)">
|
||||||
|
<path class="white" d="M263.5,105.5c3.9,1.7,4.2,3,1.1,8.8c-3.1,6-3.9,6.3-7.7,4.8c-4.8-2.1-11-3.6-15-3.6c-6.5,0-10.9,2.3-10.9,5.9
|
||||||
|
c0,11.7,37.4,5.4,37.4,30.4c0,12.6-10.8,21-27,21c-8.5,0-19-2.8-26.3-6.5c-3.6-1.8-3.8-2.9-0.7-8.9c2.7-5.3,3.6-5.8,7.5-4.2
|
||||||
|
c6.2,2.7,14,4.8,19.3,4.8c6,0,9.9-2.4,9.9-6c0-11.4-38.1-6-38.1-30.2c0-12.9,10.7-21.5,26.8-21.5
|
||||||
|
C247.4,100.2,256.9,102.5,263.5,105.5z"/>
|
||||||
|
<path class="white" d="M293.7,75.8V169c0,1.4-1.5,2.9-3.6,2.9h-9.8c-2.1,0-3.6-1.5-3.6-2.9V75.8c0-4.6,1.3-5,8.5-5
|
||||||
|
C293.4,70.7,293.7,71.3,293.7,75.8z"/>
|
||||||
|
<path class="white" d="M363.4,128.2v40.1c0,2.1-1.5,3.6-3.6,3.6h-9.7c-2.2,0-3.8-1.6-3.6-3.8l0.1-4.3c-5.3,5.8-12.8,8.9-20.3,8.9
|
||||||
|
c-14.6,0-24.4-8.5-24.4-21.1c0-13.4,11.1-22.5,27.7-22.5c6.3,0,12.1,1.1,16.8,3.1v-4.6c0-7.4-5.8-11.8-15.7-11.8
|
||||||
|
c-4.6,0-10.3,1.8-14.8,4.5c-3.5,2-4.3,1.8-8.1-3.8c-3.7-5.6-3.6-6.7,0-9c6.8-4.4,16.1-7.2,24.6-7.2
|
||||||
|
C351.4,100.2,363.4,110.6,363.4,128.2z M318.2,151.4c0,4.8,4,8,10.2,8c7.4,0,14.1-3.6,18-9.6v-6.3c-3.9-1.5-8.7-2.3-12.9-2.3
|
||||||
|
C324.3,141.2,318.2,145.5,318.2,151.4z"/>
|
||||||
|
<path class="white" d="M429.9,105.6c3.6,2.1,3.7,3.2-0.2,9.2c-3.7,5.7-4.3,6-8.2,4c-3-1.6-7.7-2.9-11.7-2.9
|
||||||
|
c-12.3,0-20.5,8.1-20.5,20.3c0,12.7,8.2,21.2,20.5,21.2c4.3,0,9.6-1.6,13.1-3.6c3.6-2.1,4.3-1.9,8.1,3.6c3.4,5.1,3.3,6.3,0.3,8.5
|
||||||
|
c-5.5,3.8-14.1,6.7-21.7,6.7c-22.7,0-37.9-14.6-37.9-36.4c0-21.7,15.2-36.1,38.1-36.1C416.6,100.2,424.8,102.6,429.9,105.6z"/>
|
||||||
|
<path class="white" d="M504.1,163.1c2.8,3.6,1.7,4.9-5.4,7.5c-7.2,2.6-8.2,2.5-10.8-0.9l-20.3-27.1l-9.1,8.8V169
|
||||||
|
c0,1.4-1.5,2.9-3.6,2.9H445c-2.1,0-3.6-1.5-3.6-2.9V75.8c0-4.6,1.3-5,8.5-5c8.2,0,8.5,0.6,8.5,5v53l27.8-26.7
|
||||||
|
c3.1-2.9,4.8-2.7,10.2,0.9c6,3.9,6.5,5,3.6,7.8L479.3,131L504.1,163.1z"/>
|
||||||
|
</g>
|
||||||
|
<g transform="scale(0.1) translate(340, -31)">
|
||||||
|
<rect x="115.9" y="126.3" transform="matrix(0.9482 -0.3176 0.3176 0.9482 -36.3582 46.5843)" class="white" width="17.6" height="17"/>
|
||||||
|
<g>
|
||||||
|
<rect x="115.9" y="126.3" transform="matrix(0.9482 -0.3176 0.3176 0.9482 -36.3582 46.5843)" class="white" width="17.6" height="17"/>
|
||||||
|
<path class="white" d="M182,117.5c-12.9-43-31.5-53-74.5-40.1s-53,31.5-40.1,74.5s31.5,53,74.5,40.1S194.9,160.5,182,117.5z
|
||||||
|
M160.3,145.4l-8.1,2.7l2.8,8.4c1.1,3.4-0.7,7.1-4.1,8.2c-0.7,0.2-1.5,0.4-2.2,0.3c-2.6-0.1-5.1-1.8-6-4.4l-2.8-8.4l-16.7,5.6
|
||||||
|
l2.8,8.4c1.1,3.4-0.7,7.1-4.1,8.2c-0.7,0.2-1.5,0.4-2.2,0.3c-2.6-0.1-5.1-1.8-6-4.4l-2.8-8.4l-8.1,2.7c-0.7,0.2-1.5,0.4-2.2,0.3
|
||||||
|
c-2.6-0.1-5.1-1.8-6-4.4c-1.1-3.4,0.7-7.1,4.1-8.2l8.1-2.7l-5.4-16.1l-8.1,2.7c-0.7,0.2-1.5,0.4-2.2,0.3c-2.6-0.1-5.1-1.8-6-4.4
|
||||||
|
c-1.1-3.4,0.7-7.1,4.1-8.2l8.1-2.7l-2.8-8.4c-1.1-3.4,0.7-7.1,4.1-8.2s7.1,0.7,8.2,4.1l2.8,8.4l16.7-5.6l-2.8-8.4
|
||||||
|
c-1.1-3.4,0.7-7.1,4.1-8.2s7.1,0.7,8.2,4.1l2.8,8.4l8.1-2.7c3.4-1.1,7.1,0.7,8.2,4.1c1.1,3.4-0.7,7.1-4.1,8.2l-8.1,2.7l5.4,16.1
|
||||||
|
l8.1-2.7c3.4-1.1,7.1,0.7,8.2,4.1C165.5,140.6,163.7,144.3,160.3,145.4z"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 7.1 KiB |
10
images/dark/git-icon-orange.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 93 93" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<path fill="#F05133" d="M90,41.8L49.9,1.7c-2.3-2.3-6.1-2.3-8.4,0L33.2,10l10.6,10.6c2.5-0.8,5.3-0.3,7.2,1.7c2,2,2.5,4.8,1.7,7.3
|
||||||
|
l10.2,10.2c2.5-0.8,5.3-0.3,7.3,1.7c2.8,2.7,2.8,7.2,0,10s-7.2,2.8-10,0c-2.1-2.1-2.6-5.1-1.5-7.7l-9.5-9.5v25
|
||||||
|
c0.7,0.3,1.3,0.8,1.9,1.3c2.8,2.7,2.8,7.2,0,10c-2.8,2.7-7.2,2.7-10,0c-2.8-2.8-2.8-7.2,0-10c0.7-0.7,1.5-1.2,2.3-1.5V33.8
|
||||||
|
c-0.8-0.3-1.6-0.9-2.3-1.5c-2.1-2.1-2.6-5.1-1.5-7.7L29.2,14.2L1.7,41.7c-2.3,2.3-2.3,6.1,0,8.4l40.1,40.1c2.3,2.3,6.1,2.3,8.4,0
|
||||||
|
l39.9-39.9C92.4,47.9,92.4,44.1,90,41.8z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 795 B |
12
images/dark/git-icon-progress.svg
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 93 93" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<path fill="#FFFFFF" fill-opacity="0.74" d="M90,41.8L49.9,1.7c-2.3-2.3-6.1-2.3-8.4,0L33.2,10l10.6,10.6c2.5-0.8,5.3-0.3,7.2,1.7c2,2,2.5,4.8,1.7,7.3
|
||||||
|
l10.2,10.2c2.5-0.8,5.3-0.3,7.3,1.7c2.8,2.7,2.8,7.2,0,10s-7.2,2.8-10,0c-2.1-2.1-2.6-5.1-1.5-7.7l-9.5-9.5v25
|
||||||
|
c0.7,0.3,1.3,0.8,1.9,1.3c2.8,2.7,2.8,7.2,0,10c-2.8,2.7-7.2,2.7-10,0c-2.8-2.8-2.8-7.2,0-10c0.7-0.7,1.5-1.2,2.3-1.5V33.8
|
||||||
|
c-0.8-0.3-1.6-0.9-2.3-1.5c-2.1-2.1-2.6-5.1-1.5-7.7L29.2,14.2L1.7,41.7c-2.3,2.3-2.3,6.1,0,8.4l40.1,40.1c2.3,2.3,6.1,2.3,8.4,0
|
||||||
|
l39.9-39.9C92.4,47.9,92.4,44.1,90,41.8z">
|
||||||
|
<animate attributeName="fill" values="#FFFFFF;#F05133;#FFFFFF" dur="1s" repeatCount="indefinite"/>
|
||||||
|
</path>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 941 B |
10
images/dark/git-icon.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 93 93" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<path fill="#FFFFFF" fill-opacity="0.74" d="M90,41.8L49.9,1.7c-2.3-2.3-6.1-2.3-8.4,0L33.2,10l10.6,10.6c2.5-0.8,5.3-0.3,7.2,1.7c2,2,2.5,4.8,1.7,7.3
|
||||||
|
l10.2,10.2c2.5-0.8,5.3-0.3,7.3,1.7c2.8,2.7,2.8,7.2,0,10s-7.2,2.8-10,0c-2.1-2.1-2.6-5.1-1.5-7.7l-9.5-9.5v25
|
||||||
|
c0.7,0.3,1.3,0.8,1.9,1.3c2.8,2.7,2.8,7.2,0,10c-2.8,2.7-7.2,2.7-10,0c-2.8-2.8-2.8-7.2,0-10c0.7-0.7,1.5-1.2,2.3-1.5V33.8
|
||||||
|
c-0.8-0.3-1.6-0.9-2.3-1.5c-2.1-2.1-2.6-5.1-1.5-7.7L29.2,14.2L1.7,41.7c-2.3,2.3-2.3,6.1,0,8.4l40.1,40.1c2.3,2.3,6.1,2.3,8.4,0
|
||||||
|
l39.9-39.9C92.4,47.9,92.4,44.1,90,41.8z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 815 B |
6
images/dark/highlight-gutter.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18px" height="18px" viewBox="0 0 18 18" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<rect fill="#00bcf2" fill-opacity="0.6" x="7" y="0" width="3" height="18"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 312 B |
1
images/dark/icon-add.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><title>Layer 1</title><rect height="11" width="3" y="3" x="7" fill="#C5C5C5"/><rect height="3" width="11" y="7" x="3" fill="#C5C5C5"/></svg>
|
||||||
|
After Width: | Height: | Size: 203 B |
4
images/dark/icon-commit.svg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="256" height="256" viewBox="0 0 14 16" xml:space="preserve">
|
||||||
|
<path fill="#C5C5C5" d="M10.86 7c-.45-1.72-2-3-3.86-3-1.86 0-3.41 1.28-3.86 3H0v2h3.14c.45 1.72 2 3 3.86 3 1.86 0 3.41-1.28 3.86-3H14V7h-3.14zM7 10.2c-1.22 0-2.2-.98-2.2-2.2 0-1.22.98-2.2 2.2-2.2 1.22 0 2.2.98 2.2 2.2 0 1.22-.98 2.2-2.2 2.2z"></path>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 480 B |
5
images/dark/icon-refresh.svg
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16">
|
||||||
|
<path d="M13.451 5.609l-.579-.939-1.068.812-.076.094c-.335.415-.927 1.341-1.124 2.876l-.021.165.033.163.071.345c0 1.654-1.346 3-3 3a2.98 2.98 0 0 1-2.107-.868 2.98 2.98 0 0 1-.873-2.111 3.004 3.004 0 0 1 2.351-2.929v2.926s2.528-2.087 2.984-2.461h.012L13.115 4.1 8.196 0H7.059v2.404A6.759 6.759 0 0 0 .938 9.125c0 1.809.707 3.508 1.986 4.782a6.707 6.707 0 0 0 4.784 1.988 6.758 6.758 0 0 0 6.75-6.75 6.741 6.741 0 0 0-1.007-3.536z" fill="#2D2D30"/>
|
||||||
|
<path d="M12.6 6.134l-.094.071c-.269.333-.746 1.096-.91 2.375.057.277.092.495.092.545 0 2.206-1.794 4-4 4a3.986 3.986 0 0 1-2.817-1.164 3.987 3.987 0 0 1-1.163-2.815c0-2.206 1.794-4 4-4l.351.025v1.85S9.685 5.679 9.69 5.682l1.869-1.577-3.5-2.917v2.218l-.371-.03a5.75 5.75 0 0 0-4.055 9.826 5.75 5.75 0 0 0 9.826-4.056 5.725 5.725 0 0 0-.859-3.012z" fill="#C5C5C5"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 987 B |
6
images/dark/icon-status-added.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#3c8746" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
A
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/dark/icon-status-conflict.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#7F4E7E" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
C
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/dark/icon-status-copied.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#692C77" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
C
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/dark/icon-status-deleted.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#9E121D" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
D
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/dark/icon-status-ignored.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#969696" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
I
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/dark/icon-status-modified.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#1B80B2" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
M
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/dark/icon-status-renamed.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#CC6633" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
R
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/dark/icon-status-untracked.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#6C6C6C" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
U
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
10
images/git-icon.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 93 93" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<path fill="#F05133" d="M90,41.8L49.9,1.7c-2.3-2.3-6.1-2.3-8.4,0L33.2,10l10.6,10.6c2.5-0.8,5.3-0.3,7.2,1.7c2,2,2.5,4.8,1.7,7.3
|
||||||
|
l10.2,10.2c2.5-0.8,5.3-0.3,7.3,1.7c2.8,2.7,2.8,7.2,0,10s-7.2,2.8-10,0c-2.1-2.1-2.6-5.1-1.5-7.7l-9.5-9.5v25
|
||||||
|
c0.7,0.3,1.3,0.8,1.9,1.3c2.8,2.7,2.8,7.2,0,10c-2.8,2.7-7.2,2.7-10,0c-2.8-2.8-2.8-7.2,0-10c0.7-0.7,1.5-1.2,2.3-1.5V33.8
|
||||||
|
c-0.8-0.3-1.6-0.9-2.3-1.5c-2.1-2.1-2.6-5.1-1.5-7.7L29.2,14.2L1.7,41.7c-2.3,2.3-2.3,6.1,0,8.4l40.1,40.1c2.3,2.3,6.1,2.3,8.4,0
|
||||||
|
l39.9-39.9C92.4,47.9,92.4,44.1,90,41.8z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 795 B |
BIN
images/gitlens-icon.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
18
images/gitlens-icon.svg
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 93 93" style="enable-background:new 0 0 93 93;" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<path fill="#F05133" d="M90,41.8L49.9,1.7c-2.3-2.3-6.1-2.3-8.4,0L33.2,10l10.6,10.6c2.5-0.8,5.3-0.3,7.2,1.7c2,2,2.5,4.8,1.7,7.3
|
||||||
|
l10.2,10.2c2.5-0.8,5.3-0.3,7.3,1.7c2.8,2.7,2.8,7.2,0,10s-7.2,2.8-10,0c-2.1-2.1-2.6-5.1-1.5-7.7l-9.5-9.5v25
|
||||||
|
c0.7,0.3,1.3,0.8,1.9,1.3c2.8,2.7,2.8,7.2,0,10c-2.8,2.7-7.2,2.7-10,0c-2.8-2.8-2.8-7.2,0-10c0.7-0.7,1.5-1.2,2.3-1.5V33.8
|
||||||
|
c-0.8-0.3-1.6-0.9-2.3-1.5c-2.1-2.1-2.6-5.1-1.5-7.7L29.2,14.2L1.7,41.7c-2.3,2.3-2.3,6.1,0,8.4l40.1,40.1c2.3,2.3,6.1,2.3,8.4,0
|
||||||
|
l39.9-39.9C92.4,47.9,92.4,44.1,90,41.8z"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<path fill="#FFFFFF" d="M38.1,56.9l-9-9c1.2-1.6,1.9-3.5,1.9-5.6c0-5.2-4.2-9.4-9.4-9.4s-9.4,4.2-9.4,9.4s4.2,9.4,9.4,9.4
|
||||||
|
c2.1,0,4.1-0.7,5.6-1.9l9,9c0.3,0.3,0.6,0.4,0.9,0.4c0.3,0,0.7-0.1,0.9-0.4C38.6,58.2,38.6,57.4,38.1,56.9z M21.6,49.7
|
||||||
|
c-4.1,0-7.5-3.4-7.5-7.5s3.4-7.5,7.5-7.5s7.5,3.4,7.5,7.5S25.7,49.7,21.6,49.7z"/>
|
||||||
|
<path fill="#FFFFFF" d="M27,41.7c0.1,0,0.2,0,0.2,0c0.5-0.1,0.8-0.6,0.7-1.2c-0.5-1.7-1.5-3.1-3.1-4c-1.5-0.9-3.3-1.1-5-0.7
|
||||||
|
c-0.5,0.1-0.8,0.6-0.7,1.2c0.1,0.5,0.6,0.8,1.2,0.7c1.2-0.3,2.5-0.2,3.6,0.5c1.1,0.6,1.9,1.6,2.2,2.9C26.2,41.4,26.6,41.7,27,41.7z"/>
|
||||||
|
<circle fill="#FFFFFF" cx="27.1" cy="43.9" r="0.9"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.5 KiB |
BIN
images/gitlens-preview-full.gif
Normal file
|
After Width: | Height: | Size: 5.2 MiB |
BIN
images/gitlens-preview.gif
Normal file
|
After Width: | Height: | Size: 2.7 MiB |
BIN
images/gitlens-preview1.gif
Normal file
|
After Width: | Height: | Size: 4.8 MiB |
BIN
images/gitlens-preview2.gif
Normal file
|
After Width: | Height: | Size: 6.6 MiB |
10
images/light/git-icon-orange.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 93 93" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<path fill="#F05133" d="M90,41.8L49.9,1.7c-2.3-2.3-6.1-2.3-8.4,0L33.2,10l10.6,10.6c2.5-0.8,5.3-0.3,7.2,1.7c2,2,2.5,4.8,1.7,7.3
|
||||||
|
l10.2,10.2c2.5-0.8,5.3-0.3,7.3,1.7c2.8,2.7,2.8,7.2,0,10s-7.2,2.8-10,0c-2.1-2.1-2.6-5.1-1.5-7.7l-9.5-9.5v25
|
||||||
|
c0.7,0.3,1.3,0.8,1.9,1.3c2.8,2.7,2.8,7.2,0,10c-2.8,2.7-7.2,2.7-10,0c-2.8-2.8-2.8-7.2,0-10c0.7-0.7,1.5-1.2,2.3-1.5V33.8
|
||||||
|
c-0.8-0.3-1.6-0.9-2.3-1.5c-2.1-2.1-2.6-5.1-1.5-7.7L29.2,14.2L1.7,41.7c-2.3,2.3-2.3,6.1,0,8.4l40.1,40.1c2.3,2.3,6.1,2.3,8.4,0
|
||||||
|
l39.9-39.9C92.4,47.9,92.4,44.1,90,41.8z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 795 B |
13
images/light/git-icon-progress.svg
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 93 93" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<path fill="#000000" fill-opacity="0.6" d="M90,41.8L49.9,1.7c-2.3-2.3-6.1-2.3-8.4,0L33.2,10l10.6,10.6c2.5-0.8,5.3-0.3,7.2,1.7c2,2,2.5,4.8,1.7,7.3
|
||||||
|
l10.2,10.2c2.5-0.8,5.3-0.3,7.3,1.7c2.8,2.7,2.8,7.2,0,10s-7.2,2.8-10,0c-2.1-2.1-2.6-5.1-1.5-7.7l-9.5-9.5v25
|
||||||
|
c0.7,0.3,1.3,0.8,1.9,1.3c2.8,2.7,2.8,7.2,0,10c-2.8,2.7-7.2,2.7-10,0c-2.8-2.8-2.8-7.2,0-10c0.7-0.7,1.5-1.2,2.3-1.5V33.8
|
||||||
|
c-0.8-0.3-1.6-0.9-2.3-1.5c-2.1-2.1-2.6-5.1-1.5-7.7L29.2,14.2L1.7,41.7c-2.3,2.3-2.3,6.1,0,8.4l40.1,40.1c2.3,2.3,6.1,2.3,8.4,0
|
||||||
|
l39.9-39.9C92.4,47.9,92.4,44.1,90,41.8z">
|
||||||
|
<animate attributeName="fill" values="#000000;#F05133;#000000" dur="1s" repeatCount="indefinite"/>
|
||||||
|
</path>
|
||||||
|
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 941 B |
10
images/light/git-icon.svg
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 93 93" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<path fill="#000000" fill-opacity="0.6" d="M90,41.8L49.9,1.7c-2.3-2.3-6.1-2.3-8.4,0L33.2,10l10.6,10.6c2.5-0.8,5.3-0.3,7.2,1.7c2,2,2.5,4.8,1.7,7.3
|
||||||
|
l10.2,10.2c2.5-0.8,5.3-0.3,7.3,1.7c2.8,2.7,2.8,7.2,0,10s-7.2,2.8-10,0c-2.1-2.1-2.6-5.1-1.5-7.7l-9.5-9.5v25
|
||||||
|
c0.7,0.3,1.3,0.8,1.9,1.3c2.8,2.7,2.8,7.2,0,10c-2.8,2.7-7.2,2.7-10,0c-2.8-2.8-2.8-7.2,0-10c0.7-0.7,1.5-1.2,2.3-1.5V33.8
|
||||||
|
c-0.8-0.3-1.6-0.9-2.3-1.5c-2.1-2.1-2.6-5.1-1.5-7.7L29.2,14.2L1.7,41.7c-2.3,2.3-2.3,6.1,0,8.4l40.1,40.1c2.3,2.3,6.1,2.3,8.4,0
|
||||||
|
l39.9-39.9C92.4,47.9,92.4,44.1,90,41.8z"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 814 B |
6
images/light/highlight-gutter.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="18px" height="18px" viewBox="0 0 18 18" xml:space="preserve">
|
||||||
|
<g>
|
||||||
|
<rect fill="#00bcf2" fill-opacity="0.6" x="7" y="0" width="3" height="18"/>
|
||||||
|
</g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 313 B |
1
images/light/icon-add.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg width="16" height="16" xmlns="http://www.w3.org/2000/svg"><title>Layer 1</title><rect height="11" width="3" y="3" x="7" fill="#424242"/><rect height="3" width="11" y="7" x="3" fill="#424242"/></svg>
|
||||||
|
After Width: | Height: | Size: 203 B |
4
images/light/icon-commit.svg
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="256" height="256" viewBox="0 0 14 16" xml:space="preserve">
|
||||||
|
<path fill="#6c6c6c" d="M10.86 7c-.45-1.72-2-3-3.86-3-1.86 0-3.41 1.28-3.86 3H0v2h3.14c.45 1.72 2 3 3.86 3 1.86 0 3.41-1.28 3.86-3H14V7h-3.14zM7 10.2c-1.22 0-2.2-.98-2.2-2.2 0-1.22.98-2.2 2.2-2.2 1.22 0 2.2.98 2.2 2.2 0 1.22-.98 2.2-2.2 2.2z"></path>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 480 B |
5
images/light/icon-refresh.svg
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16">
|
||||||
|
<path d='M13.451 5.609l-.579-.939-1.068.812-.076.094c-.335.415-.927 1.341-1.124 2.876l-.021.165.033.163.071.345c0 1.654-1.346 3-3 3a2.98 2.98 0 0 1-2.107-.868 2.98 2.98 0 0 1-.873-2.111 3.004 3.004 0 0 1 2.351-2.929v2.926s2.528-2.087 2.984-2.461h.012L13.115 4.1 8.196 0H7.059v2.404A6.759 6.759 0 0 0 .938 9.125c0 1.809.707 3.508 1.986 4.782a6.707 6.707 0 0 0 4.784 1.988 6.758 6.758 0 0 0 6.75-6.75 6.741 6.741 0 0 0-1.007-3.536z' fill='#F6F6F6'/>
|
||||||
|
<path d='M12.6 6.134l-.094.071c-.269.333-.746 1.096-.91 2.375.057.277.092.495.092.545 0 2.206-1.794 4-4 4a3.986 3.986 0 0 1-2.817-1.164 3.987 3.987 0 0 1-1.163-2.815c0-2.206 1.794-4 4-4l.351.025v1.85S9.685 5.679 9.69 5.682l1.869-1.577-3.5-2.917v2.218l-.371-.03a5.75 5.75 0 0 0-4.055 9.826 5.75 5.75 0 0 0 9.826-4.056 5.725 5.725 0 0 0-.859-3.012z' fill='#424242'/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 987 B |
6
images/light/icon-status-added.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#2d883e" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
A
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/light/icon-status-conflict.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#9B4F96" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
C
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/light/icon-status-copied.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#682079" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
C
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/light/icon-status-deleted.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#B9131A" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
D
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/light/icon-status-ignored.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#969696" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
I
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/light/icon-status-modified.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#007ACC" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
M
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/light/icon-status-renamed.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#CC6633" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
R
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
6
images/light/icon-status-untracked.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<svg width="14px" height="14px" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<rect fill="#6C6C6C" x="0" y="0" width="100" height="100" rx="35" ry="35"/>
|
||||||
|
<text x="50" y="75" font-size="75" text-anchor="middle" style="font-family: Menlo, Monaco, Consolas, "Droid Sans Mono", "Inconsolata", "Courier New", monospace, "Droid Sans Fallback";" fill="white">
|
||||||
|
U
|
||||||
|
</text>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 431 B |
|
Before Width: | Height: | Size: 185 KiB |
|
Before Width: | Height: | Size: 124 KiB |
BIN
images/screenshot-branch-history.png
Normal file
|
After Width: | Height: | Size: 98 KiB |
BIN
images/screenshot-code-lens.png
Normal file
|
After Width: | Height: | Size: 7.6 KiB |
BIN
images/screenshot-commit-details.png
Normal file
|
After Width: | Height: | Size: 67 KiB |
BIN
images/screenshot-commit-file-details.png
Normal file
|
After Width: | Height: | Size: 75 KiB |
BIN
images/screenshot-file-blame-annotations.png
Normal file
|
After Width: | Height: | Size: 16 KiB |
BIN
images/screenshot-file-history.png
Normal file
|
After Width: | Height: | Size: 80 KiB |
BIN
images/screenshot-git-stashes.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
images/screenshot-line-blame-annotation.png
Normal file
|
After Width: | Height: | Size: 6.8 KiB |
BIN
images/screenshot-line-blame-annotations.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
images/screenshot-repo-status.png
Normal file
|
After Width: | Height: | Size: 54 KiB |
BIN
images/screenshot-stash-details.png
Normal file
|
After Width: | Height: | Size: 57 KiB |
BIN
images/screenshot-stash-list.png
Normal file
|
After Width: | Height: | Size: 25 KiB |
BIN
images/screenshot-status-bar.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
2756
package-lock.json
generated
Normal file
1632
package.json
517
src/@types/applicationinsights/index.d.ts
vendored
Normal file
@@ -0,0 +1,517 @@
|
|||||||
|
/*
|
||||||
|
In 0.15.33 `setOfflineMode` is missing from the interfaces `ApplicationInsights` and `Channel`.
|
||||||
|
When a version > 0.15.33 of @types/applicationinsights is available on npm, this file can be
|
||||||
|
deleted and the dev dependency can be resurrected in `package.json`.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Type definitions for Application Insights v0.15.12
|
||||||
|
// Project: https://github.com/Microsoft/ApplicationInsights-node.js
|
||||||
|
// Definitions by: Scott Southwood <https://github.com/scsouthw/>
|
||||||
|
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||||
|
|
||||||
|
interface AutoCollectConsole {
|
||||||
|
constructor(client: Client): AutoCollectConsole;
|
||||||
|
enable(isEnabled: boolean): void;
|
||||||
|
isInitialized(): boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AutoCollectExceptions {
|
||||||
|
constructor(client: Client): AutoCollectExceptions;
|
||||||
|
isInitialized(): boolean;
|
||||||
|
enable(isEnabled: boolean): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AutoCollectPerformance {
|
||||||
|
constructor(client: Client): AutoCollectPerformance;
|
||||||
|
enable(isEnabled: boolean): void;
|
||||||
|
isInitialized(): boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface AutoCollectRequests {
|
||||||
|
constructor(client: Client): AutoCollectRequests;
|
||||||
|
enable(isEnabled: boolean): void;
|
||||||
|
isInitialized(): boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
declare namespace ContractsModule {
|
||||||
|
enum DataPointType {
|
||||||
|
Measurement = 0,
|
||||||
|
Aggregation = 1,
|
||||||
|
}
|
||||||
|
enum DependencyKind {
|
||||||
|
SQL = 0,
|
||||||
|
Http = 1,
|
||||||
|
Other = 2,
|
||||||
|
}
|
||||||
|
enum DependencySourceType {
|
||||||
|
Undefined = 0,
|
||||||
|
Aic = 1,
|
||||||
|
Apmc = 2,
|
||||||
|
}
|
||||||
|
enum SessionState {
|
||||||
|
Start = 0,
|
||||||
|
End = 1,
|
||||||
|
}
|
||||||
|
enum SeverityLevel {
|
||||||
|
Verbose = 0,
|
||||||
|
Information = 1,
|
||||||
|
Warning = 2,
|
||||||
|
Error = 3,
|
||||||
|
Critical = 4,
|
||||||
|
}
|
||||||
|
interface ContextTagKeys {
|
||||||
|
applicationVersion: string;
|
||||||
|
applicationBuild: string;
|
||||||
|
deviceId: string;
|
||||||
|
deviceIp: string;
|
||||||
|
deviceLanguage: string;
|
||||||
|
deviceLocale: string;
|
||||||
|
deviceModel: string;
|
||||||
|
deviceNetwork: string;
|
||||||
|
deviceOEMName: string;
|
||||||
|
deviceOS: string;
|
||||||
|
deviceOSVersion: string;
|
||||||
|
deviceRoleInstance: string;
|
||||||
|
deviceRoleName: string;
|
||||||
|
deviceScreenResolution: string;
|
||||||
|
deviceType: string;
|
||||||
|
deviceMachineName: string;
|
||||||
|
locationIp: string;
|
||||||
|
operationId: string;
|
||||||
|
operationName: string;
|
||||||
|
operationParentId: string;
|
||||||
|
operationRootId: string;
|
||||||
|
operationSyntheticSource: string;
|
||||||
|
operationIsSynthetic: string;
|
||||||
|
sessionId: string;
|
||||||
|
sessionIsFirst: string;
|
||||||
|
sessionIsNew: string;
|
||||||
|
userAccountAcquisitionDate: string;
|
||||||
|
userAccountId: string;
|
||||||
|
userAgent: string;
|
||||||
|
userId: string;
|
||||||
|
userStoreRegion: string;
|
||||||
|
sampleRate: string;
|
||||||
|
internalSdkVersion: string;
|
||||||
|
internalAgentVersion: string;
|
||||||
|
constructor(): ContextTagKeys;
|
||||||
|
}
|
||||||
|
interface Domain {
|
||||||
|
ver: number;
|
||||||
|
properties: any;
|
||||||
|
constructor(): Domain;
|
||||||
|
}
|
||||||
|
interface Data<TDomain extends ContractsModule.Domain> {
|
||||||
|
baseType: string;
|
||||||
|
baseData: TDomain;
|
||||||
|
constructor(): Data<TDomain>;
|
||||||
|
}
|
||||||
|
interface Envelope {
|
||||||
|
ver: number;
|
||||||
|
name: string;
|
||||||
|
time: string;
|
||||||
|
sampleRate: number;
|
||||||
|
seq: string;
|
||||||
|
iKey: string;
|
||||||
|
flags: number;
|
||||||
|
deviceId: string;
|
||||||
|
os: string;
|
||||||
|
osVer: string;
|
||||||
|
appId: string;
|
||||||
|
appVer: string;
|
||||||
|
userId: string;
|
||||||
|
tags: {
|
||||||
|
[key: string]: string;
|
||||||
|
};
|
||||||
|
data: Data<Domain>;
|
||||||
|
constructor(): Envelope;
|
||||||
|
}
|
||||||
|
interface EventData extends ContractsModule.Domain {
|
||||||
|
ver: number;
|
||||||
|
name: string;
|
||||||
|
properties: any;
|
||||||
|
measurements: any;
|
||||||
|
constructor(): EventData;
|
||||||
|
}
|
||||||
|
interface MessageData extends ContractsModule.Domain {
|
||||||
|
ver: number;
|
||||||
|
message: string;
|
||||||
|
severityLevel: ContractsModule.SeverityLevel;
|
||||||
|
properties: any;
|
||||||
|
constructor(): MessageData;
|
||||||
|
}
|
||||||
|
interface ExceptionData extends ContractsModule.Domain {
|
||||||
|
ver: number;
|
||||||
|
handledAt: string;
|
||||||
|
exceptions: ExceptionDetails[];
|
||||||
|
severityLevel: ContractsModule.SeverityLevel;
|
||||||
|
problemId: string;
|
||||||
|
crashThreadId: number;
|
||||||
|
properties: any;
|
||||||
|
measurements: any;
|
||||||
|
constructor(): ExceptionData;
|
||||||
|
}
|
||||||
|
interface StackFrame {
|
||||||
|
level: number;
|
||||||
|
method: string;
|
||||||
|
assembly: string;
|
||||||
|
fileName: string;
|
||||||
|
line: number;
|
||||||
|
constructor(): StackFrame;
|
||||||
|
}
|
||||||
|
interface ExceptionDetails {
|
||||||
|
id: number;
|
||||||
|
outerId: number;
|
||||||
|
typeName: string;
|
||||||
|
message: string;
|
||||||
|
hasFullStack: boolean;
|
||||||
|
stack: string;
|
||||||
|
parsedStack: StackFrame[];
|
||||||
|
constructor(): ExceptionDetails;
|
||||||
|
}
|
||||||
|
interface DataPoint {
|
||||||
|
name: string;
|
||||||
|
kind: ContractsModule.DataPointType;
|
||||||
|
value: number;
|
||||||
|
count: number;
|
||||||
|
min: number;
|
||||||
|
max: number;
|
||||||
|
stdDev: number;
|
||||||
|
constructor(): DataPoint;
|
||||||
|
}
|
||||||
|
interface MetricData extends ContractsModule.Domain {
|
||||||
|
ver: number;
|
||||||
|
metrics: DataPoint[];
|
||||||
|
properties: any;
|
||||||
|
constructor(): MetricData;
|
||||||
|
}
|
||||||
|
interface PageViewData extends ContractsModule.EventData {
|
||||||
|
ver: number;
|
||||||
|
url: string;
|
||||||
|
name: string;
|
||||||
|
duration: string;
|
||||||
|
properties: any;
|
||||||
|
measurements: any;
|
||||||
|
constructor(): PageViewData;
|
||||||
|
}
|
||||||
|
interface PageViewPerfData extends ContractsModule.PageViewData {
|
||||||
|
ver: number;
|
||||||
|
url: string;
|
||||||
|
perfTotal: string;
|
||||||
|
name: string;
|
||||||
|
duration: string;
|
||||||
|
networkConnect: string;
|
||||||
|
sentRequest: string;
|
||||||
|
receivedResponse: string;
|
||||||
|
domProcessing: string;
|
||||||
|
properties: any;
|
||||||
|
measurements: any;
|
||||||
|
constructor(): PageViewPerfData;
|
||||||
|
}
|
||||||
|
interface RemoteDependencyData extends ContractsModule.Domain {
|
||||||
|
ver: number;
|
||||||
|
name: string;
|
||||||
|
kind: ContractsModule.DataPointType;
|
||||||
|
value: number;
|
||||||
|
count: number;
|
||||||
|
min: number;
|
||||||
|
max: number;
|
||||||
|
stdDev: number;
|
||||||
|
dependencyKind: ContractsModule.DependencyKind;
|
||||||
|
success: boolean;
|
||||||
|
async: boolean;
|
||||||
|
dependencySource: ContractsModule.DependencySourceType;
|
||||||
|
commandName: string;
|
||||||
|
dependencyTypeName: string;
|
||||||
|
properties: any;
|
||||||
|
constructor(): RemoteDependencyData;
|
||||||
|
}
|
||||||
|
interface AjaxCallData extends ContractsModule.PageViewData {
|
||||||
|
ver: number;
|
||||||
|
url: string;
|
||||||
|
ajaxUrl: string;
|
||||||
|
name: string;
|
||||||
|
duration: string;
|
||||||
|
requestSize: number;
|
||||||
|
responseSize: number;
|
||||||
|
timeToFirstByte: string;
|
||||||
|
timeToLastByte: string;
|
||||||
|
callbackDuration: string;
|
||||||
|
responseCode: string;
|
||||||
|
success: boolean;
|
||||||
|
properties: any;
|
||||||
|
measurements: any;
|
||||||
|
constructor(): AjaxCallData;
|
||||||
|
}
|
||||||
|
interface RequestData extends ContractsModule.Domain {
|
||||||
|
ver: number;
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
startTime: string;
|
||||||
|
duration: string;
|
||||||
|
responseCode: string;
|
||||||
|
success: boolean;
|
||||||
|
httpMethod: string;
|
||||||
|
url: string;
|
||||||
|
properties: any;
|
||||||
|
measurements: any;
|
||||||
|
constructor(): RequestData;
|
||||||
|
}
|
||||||
|
interface SessionStateData extends ContractsModule.Domain {
|
||||||
|
ver: number;
|
||||||
|
state: ContractsModule.SessionState;
|
||||||
|
constructor(): SessionStateData;
|
||||||
|
}
|
||||||
|
interface PerformanceCounterData extends ContractsModule.Domain {
|
||||||
|
ver: number;
|
||||||
|
categoryName: string;
|
||||||
|
counterName: string;
|
||||||
|
instanceName: string;
|
||||||
|
kind: DataPointType;
|
||||||
|
count: number;
|
||||||
|
min: number;
|
||||||
|
max: number;
|
||||||
|
stdDev: number;
|
||||||
|
value: number;
|
||||||
|
properties: any;
|
||||||
|
constructor(): PerformanceCounterData;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
interface Channel {
|
||||||
|
constructor(isDisabled: () => boolean, getBatchSize: () => number, getBatchIntervalMs: () => number, sender: Sender): Channel;
|
||||||
|
/**
|
||||||
|
* Add a telemetry item to the send buffer
|
||||||
|
*/
|
||||||
|
send(envelope: ContractsModule.Envelope): void;
|
||||||
|
handleCrash(envelope: ContractsModule.Envelope): void;
|
||||||
|
/**
|
||||||
|
* Immediately send buffered data
|
||||||
|
*/
|
||||||
|
triggerSend(isNodeCrashing?: boolean): void;
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
setOfflineMode(value: boolean, resentIntervall?: number): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Client {
|
||||||
|
config: Config;
|
||||||
|
context: Context;
|
||||||
|
commonProperties: {
|
||||||
|
[key: string]: string;
|
||||||
|
};
|
||||||
|
channel: Channel;
|
||||||
|
/**
|
||||||
|
* Constructs a new client of the client
|
||||||
|
* @param iKey the instrumentation key to use (read from environment variable if not specified)
|
||||||
|
*/
|
||||||
|
constructor(iKey?: string): Client;
|
||||||
|
/**
|
||||||
|
* Log a user action or other occurrence.
|
||||||
|
* @param name A string to identify this event in the portal.
|
||||||
|
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||||
|
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||||
|
*/
|
||||||
|
trackEvent(name: string, properties?: {
|
||||||
|
[key: string]: string;
|
||||||
|
}, measurements?: {
|
||||||
|
[key: string]: number;
|
||||||
|
}): void;
|
||||||
|
/**
|
||||||
|
* Log a trace message
|
||||||
|
* @param message A string to identify this event in the portal.
|
||||||
|
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||||
|
*/
|
||||||
|
trackTrace(message: string, severityLevel?: ContractsModule.SeverityLevel, properties?: {
|
||||||
|
[key: string]: string;
|
||||||
|
}): void;
|
||||||
|
/**
|
||||||
|
* Log an exception you have caught.
|
||||||
|
* @param exception An Error from a catch clause, or the string error message.
|
||||||
|
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||||
|
* @param measurements map[string, number] - metrics associated with this event, displayed in Metrics Explorer on the portal. Defaults to empty.
|
||||||
|
*/
|
||||||
|
trackException(exception: Error, properties?: {
|
||||||
|
[key: string]: string;
|
||||||
|
}): void;
|
||||||
|
/**
|
||||||
|
* Log a numeric value that is not associated with a specific event. Typically used to send regular reports of performance indicators.
|
||||||
|
* To send a single measurement, use just the first two parameters. If you take measurements very frequently, you can reduce the
|
||||||
|
* telemetry bandwidth by aggregating multiple measurements and sending the resulting average at intervals.
|
||||||
|
* @param name A string that identifies the metric.
|
||||||
|
* @param value The value of the metric
|
||||||
|
* @param count the number of samples used to get this value
|
||||||
|
* @param min the min sample for this set
|
||||||
|
* @param max the max sample for this set
|
||||||
|
* @param stdDev the standard deviation of the set
|
||||||
|
*/
|
||||||
|
trackMetric(name: string, value: number, count?: number, min?: number, max?: number, stdDev?: number, properties?: {
|
||||||
|
[key: string]: string;
|
||||||
|
}): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log an incoming http request to your server. The request data will be tracked during the response "finish" event if it is successful or the request "error"
|
||||||
|
* event if it fails. The request duration is automatically calculated as the timespan between when the trackRequest method was called, and when the response "finish"
|
||||||
|
* or request "error" events were fired.
|
||||||
|
* @param request The http.IncomingMessage object to track
|
||||||
|
* @param response The http.ServerResponse object for this request
|
||||||
|
* @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty.
|
||||||
|
*/
|
||||||
|
trackRequest(request: any /* http.IncomingMessage */, response: any /* http.ServerResponse */, properties?: {
|
||||||
|
[key: string]: string;
|
||||||
|
}): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log an incoming http request to your server. The request data is tracked synchronously rather than waiting for the response "finish"" or request "error"" events.
|
||||||
|
* Use this if you need your request telemetry to respect custom app insights operation and user context (for example if you set any appInsights.client.context.tags).
|
||||||
|
* @param request The http.IncomingMessage object to track
|
||||||
|
* @param response The http.ServerResponse object for this request
|
||||||
|
* @param ellapsedMilliseconds The duration for this request. Defaults to 0.
|
||||||
|
* @param properties map[string, string] - additional data used to filter requests in the portal. Defaults to empty.
|
||||||
|
* @param error An error that was returned for this request if it was unsuccessful. Defaults to null.
|
||||||
|
*/
|
||||||
|
trackRequestSync(request: any /*http.IncomingMessage */, response: any /*http.ServerResponse */, ellapsedMilliseconds?: number, properties?: {
|
||||||
|
[key: string]: string;
|
||||||
|
}, error?: any): void;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Log information about a dependency of your app. Typically used to track the time database calls or outgoing http requests take from your server.
|
||||||
|
* @param name The name of the dependency (i.e. "myDatabse")
|
||||||
|
* @param commandname The name of the command executed on the dependency
|
||||||
|
* @param elapsedTimeMs The amount of time in ms that the dependency took to return the result
|
||||||
|
* @param success True if the dependency succeeded, false otherwise
|
||||||
|
* @param dependencyTypeName The type of the dependency (i.e. "SQL" "HTTP"). Defaults to empty.
|
||||||
|
* @param properties map[string, string] - additional data used to filter events and metrics in the portal. Defaults to empty.
|
||||||
|
* @param dependencyKind ContractsModule.DependencyKind of this dependency. Defaults to Other.
|
||||||
|
* @param async True if the dependency was executed asynchronously, false otherwise. Defaults to false
|
||||||
|
* @param dependencySource ContractsModule.DependencySourceType of this dependency. Defaults to Undefined.
|
||||||
|
*/
|
||||||
|
trackDependency(name: string, commandName: string, elapsedTimeMs: number, success: boolean, dependencyTypeName?: string, properties?: {}, dependencyKind?: any, async?: boolean, dependencySource?: number): void;
|
||||||
|
/**
|
||||||
|
* Immediately send all queued telemetry.
|
||||||
|
*/
|
||||||
|
sendPendingData(callback?: (response: string) => void): void;
|
||||||
|
getEnvelope(data: ContractsModule.Data<ContractsModule.Domain>, tagOverrides?: {
|
||||||
|
[key: string]: string;
|
||||||
|
}): ContractsModule.Envelope;
|
||||||
|
/**
|
||||||
|
* Generic track method for all telemetry types
|
||||||
|
* @param data the telemetry to send
|
||||||
|
* @param tagOverrides the context tags to use for this telemetry which overwrite default context values
|
||||||
|
*/
|
||||||
|
track(data: ContractsModule.Data<ContractsModule.Domain>, tagOverrides?: {
|
||||||
|
[key: string]: string;
|
||||||
|
}): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Config {
|
||||||
|
instrumentationKey: string;
|
||||||
|
sessionRenewalMs: number;
|
||||||
|
sessionExpirationMs: number;
|
||||||
|
endpointUrl: string;
|
||||||
|
maxBatchSize: number;
|
||||||
|
maxBatchIntervalMs: number;
|
||||||
|
disableAppInsights: boolean;
|
||||||
|
constructor(instrumentationKey?: string): Config;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Context {
|
||||||
|
keys: ContractsModule.ContextTagKeys;
|
||||||
|
tags: {
|
||||||
|
[key: string]: string;
|
||||||
|
};
|
||||||
|
constructor(packageJsonPath?: string): Context;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Sender {
|
||||||
|
constructor(getUrl: () => string, onSuccess?: (response: string) => void, onError?: (error: Error) => void): Sender;
|
||||||
|
send(payload: any/* Buffer */): void;
|
||||||
|
saveOnCrash(payload: string): void;
|
||||||
|
/**
|
||||||
|
* enable caching events locally on error
|
||||||
|
*/
|
||||||
|
enableCacheOnError(): void;
|
||||||
|
/**
|
||||||
|
* disable caching events locally on error
|
||||||
|
*/
|
||||||
|
disableCacheOnError(): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The singleton meta interface for the default client of the client. This interface is used to setup/start and configure
|
||||||
|
* the auto-collection behavior of the application insights module.
|
||||||
|
*/
|
||||||
|
interface ApplicationInsights {
|
||||||
|
client: Client;
|
||||||
|
/**
|
||||||
|
* Initializes a client with the given instrumentation key, if this is not specified, the value will be
|
||||||
|
* read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY
|
||||||
|
* @returns {ApplicationInsights/Client} a new client
|
||||||
|
*/
|
||||||
|
getClient(instrumentationKey?: string): Client;
|
||||||
|
/**
|
||||||
|
* Initializes the default client of the client and sets the default configuration
|
||||||
|
* @param instrumentationKey the instrumentation key to use. Optional, if this is not specified, the value will be
|
||||||
|
* read from the environment variable APPINSIGHTS_INSTRUMENTATIONKEY
|
||||||
|
* @returns {ApplicationInsights} this interface
|
||||||
|
*/
|
||||||
|
setup(instrumentationKey?: string): ApplicationInsights;
|
||||||
|
/**
|
||||||
|
* Starts automatic collection of telemetry. Prior to calling start no telemetry will be collected
|
||||||
|
* @returns {ApplicationInsights} this interface
|
||||||
|
*/
|
||||||
|
start(): ApplicationInsights;
|
||||||
|
/**
|
||||||
|
* Sets the state of console tracking (enabled by default)
|
||||||
|
* @param value if true console activity will be sent to Application Insights
|
||||||
|
* @returns {ApplicationInsights} this interface
|
||||||
|
*/
|
||||||
|
setAutoCollectConsole(value: boolean): ApplicationInsights;
|
||||||
|
/**
|
||||||
|
* Sets the state of dependency tracking (enabled by default)
|
||||||
|
* @param value if true dependencies will be sent to Application Insights
|
||||||
|
* @returns {ApplicationInsights} this interface
|
||||||
|
*/
|
||||||
|
setAutoCollectDependencies(value: boolean): ApplicationInsights;
|
||||||
|
/**
|
||||||
|
* Sets the state of exception tracking (enabled by default)
|
||||||
|
* @param value if true uncaught exceptions will be sent to Application Insights
|
||||||
|
* @returns {ApplicationInsights} this interface
|
||||||
|
*/
|
||||||
|
setAutoCollectExceptions(value: boolean): ApplicationInsights;
|
||||||
|
/**
|
||||||
|
* Sets the state of performance tracking (enabled by default)
|
||||||
|
* @param value if true performance counters will be collected every second and sent to Application Insights
|
||||||
|
* @returns {ApplicationInsights} this interface
|
||||||
|
*/
|
||||||
|
setAutoCollectPerformance(value: boolean): ApplicationInsights;
|
||||||
|
/**
|
||||||
|
* Sets the state of request tracking (enabled by default)
|
||||||
|
* @param value if true requests will be sent to Application Insights
|
||||||
|
* @returns {ApplicationInsights} this interface
|
||||||
|
*/
|
||||||
|
setAutoCollectRequests(value: boolean): ApplicationInsights;
|
||||||
|
/**
|
||||||
|
* Enables verbose debug logging
|
||||||
|
* @returns {ApplicationInsights} this interface
|
||||||
|
*/
|
||||||
|
enableVerboseLogging(): ApplicationInsights;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
setOfflineMode(value: boolean, resentIntervall?: number): ApplicationInsights;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
setAutoDependencyCorrelation(value: boolean): ApplicationInsights;
|
||||||
|
}
|
||||||
|
|
||||||
|
declare module "applicationinsights" {
|
||||||
|
const applicationinsights: ApplicationInsights;
|
||||||
|
export = applicationinsights;
|
||||||
|
}
|
||||||
10
src/@types/ignore/index.d.ts
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
declare module "ignore" {
|
||||||
|
namespace ignore {
|
||||||
|
interface Ignore {
|
||||||
|
add(patterns: string | Array<string> | Ignore): Ignore;
|
||||||
|
filter(paths: Array<string>): Array<string>;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
function ignore(): ignore.Ignore;
|
||||||
|
export = ignore;
|
||||||
|
}
|
||||||
13
src/@types/spawn-rx/index.d.ts
vendored
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
/// <reference path="../../../node_modules/rxjs/Observable.d.ts" />
|
||||||
|
declare module "spawn-rx" {
|
||||||
|
import { Observable } from 'rxjs/Observable';
|
||||||
|
|
||||||
|
namespace spawnrx {
|
||||||
|
function findActualExecutable(exe: string, args?: Array<string> | undefined): { cmd: string, args: Array<string> };
|
||||||
|
function spawnDetached(exe: string, params?: Array<string> | undefined, opts?: Object | undefined): Observable<string>;
|
||||||
|
function spawn(exe: string, params?: Array<string> | undefined, opts?: Object | undefined): Observable<string>;
|
||||||
|
function spawnDetachedPromise(exe: string, params?: Array<string> | undefined, opts?: Object | undefined): Promise<string>;
|
||||||
|
function spawnPromise(exe: string, params?: Array<string> | undefined, opts?: Object | undefined): Promise<string>;
|
||||||
|
}
|
||||||
|
export = spawnrx;
|
||||||
|
}
|
||||||
62
src/activeEditorTracker.ts
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
|
||||||
|
'use strict';
|
||||||
|
import { Functions } from './system';
|
||||||
|
import { commands, Disposable, TextEditor, window } from 'vscode';
|
||||||
|
import { BuiltInCommands } from './constants';
|
||||||
|
|
||||||
|
export class ActiveEditorTracker extends Disposable {
|
||||||
|
|
||||||
|
private _disposable: Disposable;
|
||||||
|
private _resolver: ((value?: TextEditor | PromiseLike<TextEditor>) => void) | undefined;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super(() => this.dispose());
|
||||||
|
|
||||||
|
const fn = Functions.debounce((e: TextEditor) => this._resolver && this._resolver(e), 50);
|
||||||
|
this._disposable = window.onDidChangeActiveTextEditor(fn);
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
this._disposable && this._disposable.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
async awaitClose(timeout: number = 500): Promise<TextEditor | undefined> {
|
||||||
|
this.close();
|
||||||
|
return this.wait(timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
async awaitNext(timeout: number = 500): Promise<TextEditor | undefined> {
|
||||||
|
this.next();
|
||||||
|
return this.wait(timeout);
|
||||||
|
}
|
||||||
|
|
||||||
|
async close(): Promise<{} | undefined> {
|
||||||
|
return commands.executeCommand(BuiltInCommands.CloseActiveEditor);
|
||||||
|
}
|
||||||
|
|
||||||
|
async next(): Promise<{} | undefined> {
|
||||||
|
return commands.executeCommand(BuiltInCommands.NextEditor);
|
||||||
|
}
|
||||||
|
|
||||||
|
async wait(timeout: number = 500): Promise<TextEditor | undefined> {
|
||||||
|
const editor = await new Promise<TextEditor>((resolve, reject) => {
|
||||||
|
let timer: any;
|
||||||
|
|
||||||
|
this._resolver = (e: TextEditor) => {
|
||||||
|
if (timer) {
|
||||||
|
clearTimeout(timer as any);
|
||||||
|
timer = 0;
|
||||||
|
resolve(e);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
resolve(window.activeTextEditor);
|
||||||
|
timer = 0;
|
||||||
|
}, timeout) as any;
|
||||||
|
});
|
||||||
|
|
||||||
|
this._resolver = undefined;
|
||||||
|
return editor;
|
||||||
|
}
|
||||||
|
}
|
||||||
406
src/annotations/annotationController.ts
Normal file
@@ -0,0 +1,406 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Functions, Objects } from '../system';
|
||||||
|
import { DecorationRenderOptions, Disposable, Event, EventEmitter, ExtensionContext, OverviewRulerLane, Progress, ProgressLocation, TextDocument, TextDocumentChangeEvent, TextEditor, TextEditorDecorationType, TextEditorViewColumnChangeEvent, window, workspace } from 'vscode';
|
||||||
|
import { AnnotationProviderBase } from './annotationProvider';
|
||||||
|
import { Keyboard, KeyboardScope, KeyCommand, Keys } from '../keyboard';
|
||||||
|
import { TextDocumentComparer, TextEditorComparer } from '../comparers';
|
||||||
|
import { ExtensionKey, IConfig, LineHighlightLocations, themeDefaults } from '../configuration';
|
||||||
|
import { CommandContext, setCommandContext } from '../constants';
|
||||||
|
import { BlameabilityChangeEvent, GitContextTracker, GitService, GitUri } from '../gitService';
|
||||||
|
import { GutterBlameAnnotationProvider } from './gutterBlameAnnotationProvider';
|
||||||
|
import { HoverBlameAnnotationProvider } from './hoverBlameAnnotationProvider';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { RecentChangesAnnotationProvider } from './recentChangesAnnotationProvider';
|
||||||
|
import { WhitespaceController } from './whitespaceController';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
export type FileAnnotationType = 'gutter' | 'hover' | 'recentChanges';
|
||||||
|
export const FileAnnotationType = {
|
||||||
|
Gutter: 'gutter' as FileAnnotationType,
|
||||||
|
Hover: 'hover' as FileAnnotationType,
|
||||||
|
RecentChanges: 'recentChanges' as FileAnnotationType
|
||||||
|
};
|
||||||
|
|
||||||
|
export const Decorations = {
|
||||||
|
blameAnnotation: window.createTextEditorDecorationType({
|
||||||
|
isWholeLine: true,
|
||||||
|
textDecoration: 'none'
|
||||||
|
} as DecorationRenderOptions),
|
||||||
|
blameHighlight: undefined as TextEditorDecorationType | undefined,
|
||||||
|
recentChangesAnnotation: undefined as TextEditorDecorationType | undefined,
|
||||||
|
recentChangesHighlight: undefined as TextEditorDecorationType | undefined
|
||||||
|
};
|
||||||
|
|
||||||
|
export class AnnotationController extends Disposable {
|
||||||
|
|
||||||
|
private _onDidToggleAnnotations = new EventEmitter<void>();
|
||||||
|
get onDidToggleAnnotations(): Event<void> {
|
||||||
|
return this._onDidToggleAnnotations.event;
|
||||||
|
}
|
||||||
|
|
||||||
|
private _annotationsDisposable: Disposable | undefined;
|
||||||
|
private _annotationProviders: Map<number, AnnotationProviderBase> = new Map();
|
||||||
|
private _config: IConfig;
|
||||||
|
private _disposable: Disposable;
|
||||||
|
private _whitespaceController: WhitespaceController | undefined;
|
||||||
|
|
||||||
|
constructor(private context: ExtensionContext, private git: GitService, private gitContextTracker: GitContextTracker) {
|
||||||
|
super(() => this.dispose());
|
||||||
|
|
||||||
|
this._onConfigurationChanged();
|
||||||
|
|
||||||
|
const subscriptions: Disposable[] = [];
|
||||||
|
|
||||||
|
subscriptions.push(workspace.onDidChangeConfiguration(this._onConfigurationChanged, this));
|
||||||
|
|
||||||
|
this._disposable = Disposable.from(...subscriptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
this._annotationProviders.forEach(async (p, i) => await this.clear(i));
|
||||||
|
|
||||||
|
Decorations.blameAnnotation && Decorations.blameAnnotation.dispose();
|
||||||
|
Decorations.blameHighlight && Decorations.blameHighlight.dispose();
|
||||||
|
|
||||||
|
this._annotationsDisposable && this._annotationsDisposable.dispose();
|
||||||
|
this._whitespaceController && this._whitespaceController.dispose();
|
||||||
|
this._disposable && this._disposable.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
private _onConfigurationChanged() {
|
||||||
|
let toggleWhitespace = workspace.getConfiguration(`${ExtensionKey}.advanced.toggleWhitespace`).get<boolean>('enabled');
|
||||||
|
// Until https://github.com/Microsoft/vscode/issues/11485 is fixed we need to toggle whitespace for non-monospace fonts and ligatures
|
||||||
|
// TODO: detect monospace vs non-monospace font
|
||||||
|
|
||||||
|
// if (!toggleWhitespace) {
|
||||||
|
// // Since we know ligatures will break the whitespace rendering -- turn it back on
|
||||||
|
// toggleWhitespace = workspace.getConfiguration('editor').get<boolean>('fontLigatures', false);
|
||||||
|
// }
|
||||||
|
|
||||||
|
// If the setting is on and we aren't showing any annotations, make sure it is necessary (i.e. only when rendering whitespace)
|
||||||
|
if (toggleWhitespace && this._annotationProviders.size === 0) {
|
||||||
|
toggleWhitespace = (workspace.getConfiguration('editor').get<string>('renderWhitespace') !== 'none');
|
||||||
|
}
|
||||||
|
|
||||||
|
let changed = false;
|
||||||
|
|
||||||
|
if (toggleWhitespace && this._whitespaceController === undefined) {
|
||||||
|
changed = true;
|
||||||
|
this._whitespaceController = new WhitespaceController();
|
||||||
|
}
|
||||||
|
else if (!toggleWhitespace && this._whitespaceController !== undefined) {
|
||||||
|
changed = true;
|
||||||
|
this._whitespaceController.dispose();
|
||||||
|
this._whitespaceController = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const cfg = workspace.getConfiguration().get<IConfig>(ExtensionKey)!;
|
||||||
|
const cfgBlameHighlight = cfg.blame.file.lineHighlight;
|
||||||
|
const cfgChangesHighlight = cfg.recentChanges.file.lineHighlight;
|
||||||
|
const cfgTheme = cfg.theme.lineHighlight;
|
||||||
|
|
||||||
|
if (!Objects.areEquivalent(cfgBlameHighlight, this._config && this._config.blame.file.lineHighlight) ||
|
||||||
|
!Objects.areEquivalent(cfgChangesHighlight, this._config && this._config.recentChanges.file.lineHighlight) ||
|
||||||
|
!Objects.areEquivalent(cfgTheme, this._config && this._config.theme.lineHighlight)) {
|
||||||
|
changed = true;
|
||||||
|
|
||||||
|
Decorations.blameHighlight && Decorations.blameHighlight.dispose();
|
||||||
|
|
||||||
|
if (cfgBlameHighlight.enabled) {
|
||||||
|
Decorations.blameHighlight = window.createTextEditorDecorationType({
|
||||||
|
gutterIconSize: 'contain',
|
||||||
|
isWholeLine: true,
|
||||||
|
overviewRulerLane: OverviewRulerLane.Right,
|
||||||
|
dark: {
|
||||||
|
backgroundColor: cfgBlameHighlight.locations.includes(LineHighlightLocations.Line)
|
||||||
|
? cfgTheme.dark.backgroundColor || themeDefaults.lineHighlight.dark.backgroundColor
|
||||||
|
: undefined,
|
||||||
|
gutterIconPath: cfgBlameHighlight.locations.includes(LineHighlightLocations.Gutter)
|
||||||
|
? this.context.asAbsolutePath('images/dark/highlight-gutter.svg')
|
||||||
|
: undefined,
|
||||||
|
overviewRulerColor: cfgBlameHighlight.locations.includes(LineHighlightLocations.OverviewRuler)
|
||||||
|
? cfgTheme.dark.overviewRulerColor || themeDefaults.lineHighlight.dark.overviewRulerColor
|
||||||
|
: undefined
|
||||||
|
},
|
||||||
|
light: {
|
||||||
|
backgroundColor: cfgBlameHighlight.locations.includes(LineHighlightLocations.Line)
|
||||||
|
? cfgTheme.light.backgroundColor || themeDefaults.lineHighlight.light.backgroundColor
|
||||||
|
: undefined,
|
||||||
|
gutterIconPath: cfgBlameHighlight.locations.includes(LineHighlightLocations.Gutter)
|
||||||
|
? this.context.asAbsolutePath('images/light/highlight-gutter.svg')
|
||||||
|
: undefined,
|
||||||
|
overviewRulerColor: cfgBlameHighlight.locations.includes(LineHighlightLocations.OverviewRuler)
|
||||||
|
? cfgTheme.light.overviewRulerColor || themeDefaults.lineHighlight.light.overviewRulerColor
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
Decorations.blameHighlight = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
Decorations.recentChangesHighlight && Decorations.recentChangesHighlight.dispose();
|
||||||
|
|
||||||
|
Decorations.recentChangesHighlight = window.createTextEditorDecorationType({
|
||||||
|
gutterIconSize: 'contain',
|
||||||
|
isWholeLine: true,
|
||||||
|
overviewRulerLane: OverviewRulerLane.Right,
|
||||||
|
dark: {
|
||||||
|
backgroundColor: cfgChangesHighlight.locations.includes(LineHighlightLocations.Line)
|
||||||
|
? cfgTheme.dark.backgroundColor || themeDefaults.lineHighlight.dark.backgroundColor
|
||||||
|
: undefined,
|
||||||
|
gutterIconPath: cfgChangesHighlight.locations.includes(LineHighlightLocations.Gutter)
|
||||||
|
? this.context.asAbsolutePath('images/dark/highlight-gutter.svg')
|
||||||
|
: undefined,
|
||||||
|
overviewRulerColor: cfgChangesHighlight.locations.includes(LineHighlightLocations.OverviewRuler)
|
||||||
|
? cfgTheme.dark.overviewRulerColor || themeDefaults.lineHighlight.dark.overviewRulerColor
|
||||||
|
: undefined
|
||||||
|
},
|
||||||
|
light: {
|
||||||
|
backgroundColor: cfgChangesHighlight.locations.includes(LineHighlightLocations.Line)
|
||||||
|
? cfgTheme.light.backgroundColor || themeDefaults.lineHighlight.light.backgroundColor
|
||||||
|
: undefined,
|
||||||
|
gutterIconPath: cfgChangesHighlight.locations.includes(LineHighlightLocations.Gutter)
|
||||||
|
? this.context.asAbsolutePath('images/light/highlight-gutter.svg')
|
||||||
|
: undefined,
|
||||||
|
overviewRulerColor: cfgChangesHighlight.locations.includes(LineHighlightLocations.OverviewRuler)
|
||||||
|
? cfgTheme.light.overviewRulerColor || themeDefaults.lineHighlight.light.overviewRulerColor
|
||||||
|
: undefined
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Objects.areEquivalent(cfg.blame.file, this._config && this._config.blame.file) ||
|
||||||
|
!Objects.areEquivalent(cfg.recentChanges.file, this._config && this._config.recentChanges.file) ||
|
||||||
|
!Objects.areEquivalent(cfg.annotations, this._config && this._config.annotations) ||
|
||||||
|
!Objects.areEquivalent(cfg.theme.annotations, this._config && this._config.theme.annotations)) {
|
||||||
|
changed = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._config = cfg;
|
||||||
|
|
||||||
|
if (changed) {
|
||||||
|
// Since the configuration has changed -- reset any visible annotations
|
||||||
|
for (const provider of this._annotationProviders.values()) {
|
||||||
|
if (provider === undefined) continue;
|
||||||
|
|
||||||
|
if (provider.annotationType === FileAnnotationType.RecentChanges) {
|
||||||
|
provider.reset(Decorations.recentChangesAnnotation, Decorations.recentChangesHighlight);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
provider.reset(Decorations.blameAnnotation, Decorations.blameHighlight, this._whitespaceController);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async clear(column: number) {
|
||||||
|
const provider = this._annotationProviders.get(column);
|
||||||
|
if (provider === undefined) return;
|
||||||
|
|
||||||
|
this._annotationProviders.delete(column);
|
||||||
|
await provider.dispose();
|
||||||
|
|
||||||
|
if (this._annotationProviders.size === 0) {
|
||||||
|
Logger.log(`Remove listener registrations for annotations`);
|
||||||
|
|
||||||
|
await setCommandContext(CommandContext.AnnotationStatus, undefined);
|
||||||
|
|
||||||
|
this._keyboardScope && this._keyboardScope.dispose();
|
||||||
|
this._keyboardScope = undefined;
|
||||||
|
|
||||||
|
this._annotationsDisposable && this._annotationsDisposable.dispose();
|
||||||
|
this._annotationsDisposable = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
this._onDidToggleAnnotations.fire();
|
||||||
|
}
|
||||||
|
|
||||||
|
getAnnotationType(editor: TextEditor | undefined): FileAnnotationType | undefined {
|
||||||
|
const provider = this.getProvider(editor);
|
||||||
|
return provider === undefined ? undefined : provider.annotationType;
|
||||||
|
}
|
||||||
|
|
||||||
|
getProvider(editor: TextEditor | undefined): AnnotationProviderBase | undefined {
|
||||||
|
if (!editor || !editor.document || !this.git.isEditorBlameable(editor)) return undefined;
|
||||||
|
|
||||||
|
return this._annotationProviders.get(editor.viewColumn || -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
private _keyboardScope: KeyboardScope | undefined = undefined;
|
||||||
|
|
||||||
|
async showAnnotations(editor: TextEditor, type: FileAnnotationType, shaOrLine?: string | number): Promise<boolean> {
|
||||||
|
if (!editor || !editor.document || !this.git.isEditorBlameable(editor)) return false;
|
||||||
|
|
||||||
|
const currentProvider = this._annotationProviders.get(editor.viewColumn || -1);
|
||||||
|
if (currentProvider && TextEditorComparer.equals(currentProvider.editor, editor)) {
|
||||||
|
await currentProvider.selection(shaOrLine);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return window.withProgress({ location: ProgressLocation.Window }, async (progress: Progress<{ message: string }>) => {
|
||||||
|
await setCommandContext(CommandContext.AnnotationStatus, 'computing');
|
||||||
|
|
||||||
|
const computingAnnotations = this._showAnnotationsCore(currentProvider, editor, type, shaOrLine, progress);
|
||||||
|
const result = await computingAnnotations;
|
||||||
|
|
||||||
|
await setCommandContext(CommandContext.AnnotationStatus, result ? 'computed' : undefined);
|
||||||
|
|
||||||
|
return computingAnnotations;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private async _showAnnotationsCore(currentProvider: AnnotationProviderBase | undefined, editor: TextEditor, type: FileAnnotationType, shaOrLine?: string | number, progress?: Progress<{ message: string}>): Promise<boolean> {
|
||||||
|
if (progress !== undefined) {
|
||||||
|
let annotationsLabel = 'annotations';
|
||||||
|
switch (type) {
|
||||||
|
case FileAnnotationType.Gutter:
|
||||||
|
case FileAnnotationType.Hover:
|
||||||
|
annotationsLabel = 'blame annotations';
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FileAnnotationType.RecentChanges:
|
||||||
|
annotationsLabel = 'recent changes annotations';
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
progress!.report({ message: `Computing ${annotationsLabel} for ${path.basename(editor.document.fileName)}` });
|
||||||
|
}
|
||||||
|
|
||||||
|
// Allows pressing escape to exit the annotations
|
||||||
|
if (this._keyboardScope === undefined) {
|
||||||
|
this._keyboardScope = await Keyboard.instance.beginScope({
|
||||||
|
escape: {
|
||||||
|
onDidPressKey: (key: Keys) => {
|
||||||
|
const e = window.activeTextEditor;
|
||||||
|
if (e === undefined) return Promise.resolve(undefined);
|
||||||
|
|
||||||
|
this.clear(e.viewColumn || -1);
|
||||||
|
return Promise.resolve(undefined);
|
||||||
|
}
|
||||||
|
} as KeyCommand
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const gitUri = await GitUri.fromUri(editor.document.uri, this.git);
|
||||||
|
|
||||||
|
let provider: AnnotationProviderBase | undefined = undefined;
|
||||||
|
switch (type) {
|
||||||
|
case FileAnnotationType.Gutter:
|
||||||
|
provider = new GutterBlameAnnotationProvider(this.context, editor, Decorations.blameAnnotation, Decorations.blameHighlight, this._whitespaceController, this.git, gitUri);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FileAnnotationType.Hover:
|
||||||
|
provider = new HoverBlameAnnotationProvider(this.context, editor, Decorations.blameAnnotation, Decorations.blameHighlight, this._whitespaceController, this.git, gitUri);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case FileAnnotationType.RecentChanges:
|
||||||
|
provider = new RecentChangesAnnotationProvider(this.context, editor, undefined, Decorations.recentChangesHighlight!, this.git, gitUri);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (provider === undefined || !(await provider.validate())) return false;
|
||||||
|
|
||||||
|
if (currentProvider) {
|
||||||
|
await this.clear(currentProvider.editor.viewColumn || -1);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!this._annotationsDisposable && this._annotationProviders.size === 0) {
|
||||||
|
Logger.log(`Add listener registrations for annotations`);
|
||||||
|
|
||||||
|
const subscriptions: Disposable[] = [];
|
||||||
|
|
||||||
|
subscriptions.push(window.onDidChangeVisibleTextEditors(Functions.debounce(this._onVisibleTextEditorsChanged, 100), this));
|
||||||
|
subscriptions.push(window.onDidChangeTextEditorViewColumn(this._onTextEditorViewColumnChanged, this));
|
||||||
|
subscriptions.push(workspace.onDidChangeTextDocument(this._onTextDocumentChanged, this));
|
||||||
|
subscriptions.push(workspace.onDidCloseTextDocument(this._onTextDocumentClosed, this));
|
||||||
|
subscriptions.push(this.gitContextTracker.onDidChangeBlameability(this._onBlameabilityChanged, this));
|
||||||
|
|
||||||
|
this._annotationsDisposable = Disposable.from(...subscriptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
this._annotationProviders.set(editor.viewColumn || -1, provider);
|
||||||
|
if (await provider.provideAnnotation(shaOrLine)) {
|
||||||
|
this._onDidToggleAnnotations.fire();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
async toggleAnnotations(editor: TextEditor, type: FileAnnotationType, shaOrLine?: string | number): Promise<boolean> {
|
||||||
|
if (!editor || !editor.document || (type === FileAnnotationType.RecentChanges ? !this.git.isTrackable(editor.document.uri) : !this.git.isEditorBlameable(editor))) return false;
|
||||||
|
|
||||||
|
const provider = this._annotationProviders.get(editor.viewColumn || -1);
|
||||||
|
if (provider === undefined) return this.showAnnotations(editor, type, shaOrLine);
|
||||||
|
|
||||||
|
const reopen = provider.annotationType !== type;
|
||||||
|
await this.clear(provider.editor.viewColumn || -1);
|
||||||
|
|
||||||
|
if (!reopen) return false;
|
||||||
|
|
||||||
|
return this.showAnnotations(editor, type, shaOrLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
private _onBlameabilityChanged(e: BlameabilityChangeEvent) {
|
||||||
|
if (e.blameable || !e.editor) return;
|
||||||
|
|
||||||
|
for (const [key, p] of this._annotationProviders) {
|
||||||
|
if (!TextDocumentComparer.equals(p.document, e.editor.document)) continue;
|
||||||
|
|
||||||
|
Logger.log('BlameabilityChanged:', `Clear annotations for column ${key}`);
|
||||||
|
this.clear(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private _onTextDocumentChanged(e: TextDocumentChangeEvent) {
|
||||||
|
for (const [key, p] of this._annotationProviders) {
|
||||||
|
if (!TextDocumentComparer.equals(p.document, e.document)) continue;
|
||||||
|
|
||||||
|
// TODO: Rework this once https://github.com/Microsoft/vscode/issues/27231 is released in v1.13
|
||||||
|
// We have to defer because isDirty is not reliable inside this event
|
||||||
|
setTimeout(() => {
|
||||||
|
// If the document is dirty all is fine, just kick out since the GitContextTracker will handle it
|
||||||
|
if (e.document.isDirty) return;
|
||||||
|
|
||||||
|
// If the document isn't dirty, it is very likely this event was triggered by an outside edit of this document
|
||||||
|
// Which means the document has been reloaded and the annotations have been removed, so we need to update (clear) our state tracking
|
||||||
|
Logger.log('TextDocumentChanged:', `Clear annotations for column ${key}`);
|
||||||
|
this.clear(key);
|
||||||
|
}, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private _onTextDocumentClosed(e: TextDocument) {
|
||||||
|
for (const [key, p] of this._annotationProviders) {
|
||||||
|
if (!TextDocumentComparer.equals(p.document, e)) continue;
|
||||||
|
|
||||||
|
Logger.log('TextDocumentClosed:', `Clear annotations for column ${key}`);
|
||||||
|
this.clear(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async _onTextEditorViewColumnChanged(e: TextEditorViewColumnChangeEvent) {
|
||||||
|
const viewColumn = e.viewColumn || -1;
|
||||||
|
|
||||||
|
Logger.log('TextEditorViewColumnChanged:', `Clear annotations for column ${viewColumn}`);
|
||||||
|
await this.clear(viewColumn);
|
||||||
|
|
||||||
|
for (const [key, p] of this._annotationProviders) {
|
||||||
|
if (!TextEditorComparer.equals(p.editor, e.textEditor)) continue;
|
||||||
|
|
||||||
|
Logger.log('TextEditorViewColumnChanged:', `Clear annotations for column ${key}`);
|
||||||
|
await this.clear(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async _onVisibleTextEditorsChanged(e: TextEditor[]) {
|
||||||
|
if (e.every(_ => _.document.uri.scheme === 'inmemory')) return;
|
||||||
|
|
||||||
|
for (const [key, p] of this._annotationProviders) {
|
||||||
|
if (e.some(_ => TextEditorComparer.equals(p.editor, _))) continue;
|
||||||
|
|
||||||
|
Logger.log('VisibleTextEditorsChanged:', `Clear annotations for column ${key}`);
|
||||||
|
this.clear(key);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
75
src/annotations/annotationProvider.ts
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
'use strict';
|
||||||
|
// import { Functions } from '../system';
|
||||||
|
import { Disposable, ExtensionContext, TextDocument, TextEditor, TextEditorDecorationType, TextEditorSelectionChangeEvent, window, workspace } from 'vscode';
|
||||||
|
import { FileAnnotationType } from '../annotations/annotationController';
|
||||||
|
import { TextDocumentComparer } from '../comparers';
|
||||||
|
import { ExtensionKey, IConfig } from '../configuration';
|
||||||
|
import { WhitespaceController } from './whitespaceController';
|
||||||
|
|
||||||
|
export abstract class AnnotationProviderBase extends Disposable {
|
||||||
|
|
||||||
|
public annotationType: FileAnnotationType;
|
||||||
|
public document: TextDocument;
|
||||||
|
|
||||||
|
protected _config: IConfig;
|
||||||
|
protected _disposable: Disposable;
|
||||||
|
|
||||||
|
constructor(context: ExtensionContext, public editor: TextEditor, protected decoration: TextEditorDecorationType | undefined, protected highlightDecoration: TextEditorDecorationType | undefined, protected whitespaceController: WhitespaceController | undefined) {
|
||||||
|
super(() => this.dispose());
|
||||||
|
|
||||||
|
this.document = this.editor.document;
|
||||||
|
|
||||||
|
this._config = workspace.getConfiguration().get<IConfig>(ExtensionKey)!;
|
||||||
|
|
||||||
|
const subscriptions: Disposable[] = [];
|
||||||
|
|
||||||
|
subscriptions.push(window.onDidChangeTextEditorSelection(this._onTextEditorSelectionChanged, this));
|
||||||
|
|
||||||
|
this._disposable = Disposable.from(...subscriptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
async dispose() {
|
||||||
|
await this.clear();
|
||||||
|
|
||||||
|
this._disposable && this._disposable.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async _onTextEditorSelectionChanged(e: TextEditorSelectionChangeEvent) {
|
||||||
|
if (!TextDocumentComparer.equals(this.document, e.textEditor && e.textEditor.document)) return;
|
||||||
|
|
||||||
|
return this.selection(e.selections[0].active.line);
|
||||||
|
}
|
||||||
|
|
||||||
|
async clear() {
|
||||||
|
if (this.editor !== undefined) {
|
||||||
|
try {
|
||||||
|
if (this.highlightDecoration !== undefined) {
|
||||||
|
this.editor.setDecorations(this.highlightDecoration, []);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.decoration !== undefined) {
|
||||||
|
this.editor.setDecorations(this.decoration, []);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ex) { }
|
||||||
|
}
|
||||||
|
|
||||||
|
// HACK: Until https://github.com/Microsoft/vscode/issues/11485 is fixed -- restore whitespace
|
||||||
|
this.whitespaceController && await this.whitespaceController.restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
async reset(decoration: TextEditorDecorationType | undefined, highlightDecoration: TextEditorDecorationType | undefined, whitespaceController?: WhitespaceController) {
|
||||||
|
await this.clear();
|
||||||
|
|
||||||
|
this._config = workspace.getConfiguration().get<IConfig>(ExtensionKey)!;
|
||||||
|
this.decoration = decoration;
|
||||||
|
this.highlightDecoration = highlightDecoration;
|
||||||
|
this.whitespaceController = whitespaceController;
|
||||||
|
|
||||||
|
await this.provideAnnotation(this.editor === undefined ? undefined : this.editor.selection.active.line);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract async provideAnnotation(shaOrLine?: string | number): Promise<boolean>;
|
||||||
|
abstract async selection(shaOrLine?: string | number): Promise<void>;
|
||||||
|
abstract async validate(): Promise<boolean>;
|
||||||
|
}
|
||||||
222
src/annotations/annotations.ts
Normal file
@@ -0,0 +1,222 @@
|
|||||||
|
import { Strings } from '../system';
|
||||||
|
import { DecorationInstanceRenderOptions, DecorationOptions, ThemableDecorationRenderOptions } from 'vscode';
|
||||||
|
import { IThemeConfig, themeDefaults } from '../configuration';
|
||||||
|
import { GlyphChars } from '../constants';
|
||||||
|
import { CommitFormatter, GitCommit, GitDiffChunkLine, GitService, GitUri, ICommitFormatOptions } from '../gitService';
|
||||||
|
import * as moment from 'moment';
|
||||||
|
|
||||||
|
interface IHeatmapConfig {
|
||||||
|
enabled: boolean;
|
||||||
|
location?: 'left' | 'right';
|
||||||
|
}
|
||||||
|
|
||||||
|
interface IRenderOptions {
|
||||||
|
uncommittedForegroundColor?: {
|
||||||
|
dark: string;
|
||||||
|
light: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
before?: DecorationInstanceRenderOptions & ThemableDecorationRenderOptions & { height?: string };
|
||||||
|
dark?: DecorationInstanceRenderOptions;
|
||||||
|
light?: DecorationInstanceRenderOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const endOfLineIndex = 1000000;
|
||||||
|
const escapeMarkdownRegEx = /[`\>\#\*\_\-\+\.]/g;
|
||||||
|
// const sampleMarkdown = '## message `not code` *not important* _no underline_ \n> don\'t quote me \n- don\'t list me \n+ don\'t list me \n1. don\'t list me \nnot h1 \n=== \nnot h2 \n---\n***\n---\n___';
|
||||||
|
|
||||||
|
export class Annotations {
|
||||||
|
|
||||||
|
static applyHeatmap(decoration: DecorationOptions, date: Date, now: moment.Moment) {
|
||||||
|
const color = this._getHeatmapColor(now, date);
|
||||||
|
(decoration.renderOptions!.before! as any).borderColor = color;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static _getHeatmapColor(now: moment.Moment, date: Date) {
|
||||||
|
const days = now.diff(moment(date), 'days');
|
||||||
|
|
||||||
|
if (days <= 2) return '#ffeca7';
|
||||||
|
if (days <= 7) return '#ffdd8c';
|
||||||
|
if (days <= 14) return '#ffdd7c';
|
||||||
|
if (days <= 30) return '#fba447';
|
||||||
|
if (days <= 60) return '#f68736';
|
||||||
|
if (days <= 90) return '#f37636';
|
||||||
|
if (days <= 180) return '#ca6632';
|
||||||
|
if (days <= 365) return '#c0513f';
|
||||||
|
if (days <= 730) return '#a2503a';
|
||||||
|
return '#793738';
|
||||||
|
}
|
||||||
|
|
||||||
|
static getHoverMessage(commit: GitCommit, dateFormat: string | null): string | string[] {
|
||||||
|
if (dateFormat === null) {
|
||||||
|
dateFormat = 'MMMM Do, YYYY h:MMa';
|
||||||
|
}
|
||||||
|
|
||||||
|
let message = '';
|
||||||
|
if (!commit.isUncommitted) {
|
||||||
|
message = commit.message
|
||||||
|
// Escape markdown
|
||||||
|
.replace(escapeMarkdownRegEx, '\\$&')
|
||||||
|
// Escape markdown header (since the above regex won't match it)
|
||||||
|
.replace(/^===/gm, `${GlyphChars.ZeroWidthSpace}===`)
|
||||||
|
// Keep under the same block-quote
|
||||||
|
.replace(/\n/g, ' \n');
|
||||||
|
message = `\n\n> ${message}`;
|
||||||
|
}
|
||||||
|
return `\`${commit.shortSha}\` __${commit.author}__, ${moment(commit.date).fromNow()} _(${moment(commit.date).format(dateFormat)})_${message}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
static getHoverDiffMessage(commit: GitCommit, chunkLine: GitDiffChunkLine | undefined): string | undefined {
|
||||||
|
if (chunkLine === undefined) return undefined;
|
||||||
|
|
||||||
|
const codeDiff = this._getCodeDiff(chunkLine);
|
||||||
|
return commit.isUncommitted
|
||||||
|
? `\`Changes\` ${GlyphChars.Dash} _uncommitted_\n${codeDiff}`
|
||||||
|
: `\`Changes\` ${GlyphChars.Dash} \`${commit.previousShortSha}\` ${GlyphChars.ArrowLeftRight} \`${commit.shortSha}\`\n${codeDiff}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static _getCodeDiff(chunkLine: GitDiffChunkLine): string {
|
||||||
|
const previous = chunkLine.previous === undefined ? undefined : chunkLine.previous[0];
|
||||||
|
return `\`\`\`
|
||||||
|
- ${previous === undefined || previous.line === undefined ? '' : previous.line.trim()}
|
||||||
|
+ ${chunkLine.line === undefined ? '' : chunkLine.line.trim()}
|
||||||
|
\`\`\``;
|
||||||
|
}
|
||||||
|
|
||||||
|
static async changesHover(commit: GitCommit, line: number, uri: GitUri, git: GitService): Promise<DecorationOptions> {
|
||||||
|
const chunkLine = await git.getDiffForLine(uri, line + uri.offset, commit.isUncommitted ? undefined : commit.previousSha);
|
||||||
|
const message = this.getHoverDiffMessage(commit, chunkLine);
|
||||||
|
|
||||||
|
return {
|
||||||
|
hoverMessage: message
|
||||||
|
} as DecorationOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
static detailsHover(commit: GitCommit, dateFormat: string | null): DecorationOptions {
|
||||||
|
const message = this.getHoverMessage(commit, dateFormat);
|
||||||
|
return {
|
||||||
|
hoverMessage: message
|
||||||
|
} as DecorationOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gutter(commit: GitCommit, format: string, dateFormatOrFormatOptions: string | null | ICommitFormatOptions, renderOptions: IRenderOptions): DecorationOptions {
|
||||||
|
const content = Strings.pad(CommitFormatter.fromTemplate(format, commit, dateFormatOrFormatOptions), 1, 1);
|
||||||
|
|
||||||
|
return {
|
||||||
|
renderOptions: {
|
||||||
|
before: {
|
||||||
|
...renderOptions.before,
|
||||||
|
...{
|
||||||
|
contentText: content
|
||||||
|
}
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
before: commit.isUncommitted
|
||||||
|
? { ...renderOptions.dark, ...{ color: renderOptions.uncommittedForegroundColor!.dark } }
|
||||||
|
: { ...renderOptions.dark }
|
||||||
|
},
|
||||||
|
light: {
|
||||||
|
before: commit.isUncommitted
|
||||||
|
? { ...renderOptions.light, ...{ color: renderOptions.uncommittedForegroundColor!.light } }
|
||||||
|
: { ...renderOptions.light }
|
||||||
|
}
|
||||||
|
} as DecorationInstanceRenderOptions
|
||||||
|
} as DecorationOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
static gutterRenderOptions(cfgTheme: IThemeConfig, heatmap: IHeatmapConfig): IRenderOptions {
|
||||||
|
const cfgFileTheme = cfgTheme.annotations.file.gutter;
|
||||||
|
|
||||||
|
let borderStyle = undefined;
|
||||||
|
let borderWidth = undefined;
|
||||||
|
if (heatmap.enabled) {
|
||||||
|
borderStyle = 'solid';
|
||||||
|
borderWidth = heatmap.location === 'left' ? '0 0 0 2px' : '0 2px 0 0';
|
||||||
|
}
|
||||||
|
|
||||||
|
return {
|
||||||
|
uncommittedForegroundColor: {
|
||||||
|
dark: cfgFileTheme.dark.uncommittedForegroundColor || cfgFileTheme.dark.foregroundColor || themeDefaults.annotations.file.gutter.dark.foregroundColor,
|
||||||
|
light: cfgFileTheme.light.uncommittedForegroundColor || cfgFileTheme.light.foregroundColor || themeDefaults.annotations.file.gutter.light.foregroundColor
|
||||||
|
},
|
||||||
|
before: {
|
||||||
|
borderStyle: borderStyle,
|
||||||
|
borderWidth: borderWidth,
|
||||||
|
height: '100%',
|
||||||
|
margin: '0 26px -1px 0'
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
backgroundColor: cfgFileTheme.dark.backgroundColor || undefined,
|
||||||
|
color: cfgFileTheme.dark.foregroundColor || themeDefaults.annotations.file.gutter.dark.foregroundColor,
|
||||||
|
textDecoration: cfgFileTheme.separateLines ? 'overline solid rgba(0, 0, 0, .2)' : 'none'
|
||||||
|
} as DecorationInstanceRenderOptions,
|
||||||
|
light: {
|
||||||
|
backgroundColor: cfgFileTheme.light.backgroundColor || undefined,
|
||||||
|
color: cfgFileTheme.light.foregroundColor || themeDefaults.annotations.file.gutter.light.foregroundColor,
|
||||||
|
textDecoration: cfgFileTheme.separateLines ? 'overline solid rgba(0, 0, 0, .05)' : 'none'
|
||||||
|
} as DecorationInstanceRenderOptions
|
||||||
|
} as IRenderOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
static hover(commit: GitCommit, renderOptions: IRenderOptions, heatmap: boolean, dateFormat: string | null): DecorationOptions {
|
||||||
|
return {
|
||||||
|
hoverMessage: this.getHoverMessage(commit, dateFormat),
|
||||||
|
renderOptions: heatmap ? { before: { ...renderOptions.before } } : undefined
|
||||||
|
} as DecorationOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
static hoverRenderOptions(cfgTheme: IThemeConfig, heatmap: IHeatmapConfig): IRenderOptions {
|
||||||
|
if (!heatmap.enabled) return { before: undefined };
|
||||||
|
|
||||||
|
return {
|
||||||
|
before: {
|
||||||
|
borderStyle: 'solid',
|
||||||
|
borderWidth: '0 0 0 2px',
|
||||||
|
contentText: GlyphChars.ZeroWidthSpace,
|
||||||
|
height: '100%',
|
||||||
|
margin: '0 26px 0 0',
|
||||||
|
textDecoration: 'none'
|
||||||
|
}
|
||||||
|
} as IRenderOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
static trailing(commit: GitCommit, format: string, dateFormat: string | null, cfgTheme: IThemeConfig): DecorationOptions {
|
||||||
|
const message = CommitFormatter.fromTemplate(format, commit, dateFormat);
|
||||||
|
return {
|
||||||
|
renderOptions: {
|
||||||
|
after: {
|
||||||
|
contentText: Strings.pad(message, 1, 1)
|
||||||
|
},
|
||||||
|
dark: {
|
||||||
|
after: {
|
||||||
|
backgroundColor: cfgTheme.annotations.line.trailing.dark.backgroundColor || undefined,
|
||||||
|
color: cfgTheme.annotations.line.trailing.dark.foregroundColor || themeDefaults.annotations.line.trailing.dark.foregroundColor
|
||||||
|
}
|
||||||
|
},
|
||||||
|
light: {
|
||||||
|
after: {
|
||||||
|
backgroundColor: cfgTheme.annotations.line.trailing.light.backgroundColor || undefined,
|
||||||
|
color: cfgTheme.annotations.line.trailing.light.foregroundColor || themeDefaults.annotations.line.trailing.light.foregroundColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} as DecorationInstanceRenderOptions
|
||||||
|
} as DecorationOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
static withRange(decoration: DecorationOptions, start?: number, end?: number): DecorationOptions {
|
||||||
|
let range = decoration.range;
|
||||||
|
if (start !== undefined) {
|
||||||
|
range = range.with({
|
||||||
|
start: range.start.with({ character: start })
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
if (end !== undefined) {
|
||||||
|
range = range.with({
|
||||||
|
end: range.end.with({ character: end })
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
return { ...decoration, ...{ range: range } };
|
||||||
|
}
|
||||||
|
}
|
||||||
81
src/annotations/blameAnnotationProvider.ts
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Iterables } from '../system';
|
||||||
|
import { ExtensionContext, Range, TextEditor, TextEditorDecorationType } from 'vscode';
|
||||||
|
import { AnnotationProviderBase } from './annotationProvider';
|
||||||
|
import { GitBlame, GitService, GitUri } from '../gitService';
|
||||||
|
import { WhitespaceController } from './whitespaceController';
|
||||||
|
|
||||||
|
export abstract class BlameAnnotationProviderBase extends AnnotationProviderBase {
|
||||||
|
|
||||||
|
protected _blame: Promise<GitBlame | undefined>;
|
||||||
|
|
||||||
|
constructor(context: ExtensionContext, editor: TextEditor, decoration: TextEditorDecorationType | undefined, highlightDecoration: TextEditorDecorationType | undefined, whitespaceController: WhitespaceController | undefined, protected git: GitService, protected uri: GitUri) {
|
||||||
|
super(context, editor, decoration, highlightDecoration, whitespaceController);
|
||||||
|
|
||||||
|
this._blame = this.git.getBlameForFile(this.uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
async selection(shaOrLine?: string | number, blame?: GitBlame) {
|
||||||
|
if (!this.highlightDecoration) return;
|
||||||
|
|
||||||
|
if (blame === undefined) {
|
||||||
|
blame = await this._blame;
|
||||||
|
if (!blame || !blame.lines.length) return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const offset = this.uri.offset;
|
||||||
|
|
||||||
|
let sha: string | undefined = undefined;
|
||||||
|
if (typeof shaOrLine === 'string') {
|
||||||
|
sha = shaOrLine;
|
||||||
|
}
|
||||||
|
else if (typeof shaOrLine === 'number') {
|
||||||
|
const line = shaOrLine - offset;
|
||||||
|
if (line >= 0) {
|
||||||
|
const commitLine = blame.lines[line];
|
||||||
|
sha = commitLine && commitLine.sha;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sha = Iterables.first(blame.commits.values()).sha;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!sha) {
|
||||||
|
this.editor.setDecorations(this.highlightDecoration, []);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const highlightDecorationRanges = blame.lines
|
||||||
|
.filter(l => l.sha === sha)
|
||||||
|
.map(l => this.editor.document.validateRange(new Range(l.line + offset, 0, l.line + offset, 1000000)));
|
||||||
|
|
||||||
|
this.editor.setDecorations(this.highlightDecoration, highlightDecorationRanges);
|
||||||
|
}
|
||||||
|
|
||||||
|
async validate(): Promise<boolean> {
|
||||||
|
const blame = await this._blame;
|
||||||
|
return blame !== undefined && blame.lines.length !== 0;
|
||||||
|
}
|
||||||
|
protected async getBlame(requiresWhitespaceHack: boolean): Promise<GitBlame | undefined> {
|
||||||
|
let whitespacePromise: Promise<void> | undefined;
|
||||||
|
// HACK: Until https://github.com/Microsoft/vscode/issues/11485 is fixed -- override whitespace (turn off)
|
||||||
|
if (requiresWhitespaceHack) {
|
||||||
|
whitespacePromise = this.whitespaceController && this.whitespaceController.override();
|
||||||
|
}
|
||||||
|
|
||||||
|
let blame: GitBlame | undefined;
|
||||||
|
if (whitespacePromise) {
|
||||||
|
[blame] = await Promise.all([this._blame, whitespacePromise]);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
blame = await this._blame;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (blame === undefined || !blame.lines.length) {
|
||||||
|
this.whitespaceController && await this.whitespaceController.restore();
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return blame;
|
||||||
|
}
|
||||||
|
}
|
||||||
123
src/annotations/gutterBlameAnnotationProvider.ts
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Strings } from '../system';
|
||||||
|
import { DecorationOptions, Range } from 'vscode';
|
||||||
|
import { FileAnnotationType } from './annotationController';
|
||||||
|
import { Annotations, endOfLineIndex } from './annotations';
|
||||||
|
import { BlameAnnotationProviderBase } from './blameAnnotationProvider';
|
||||||
|
import { GlyphChars } from '../constants';
|
||||||
|
import { GitBlameCommit, ICommitFormatOptions } from '../gitService';
|
||||||
|
import * as moment from 'moment';
|
||||||
|
|
||||||
|
export class GutterBlameAnnotationProvider extends BlameAnnotationProviderBase {
|
||||||
|
|
||||||
|
async provideAnnotation(shaOrLine?: string | number, type?: FileAnnotationType): Promise<boolean> {
|
||||||
|
this.annotationType = FileAnnotationType.Gutter;
|
||||||
|
|
||||||
|
const blame = await this.getBlame(true);
|
||||||
|
if (blame === undefined) return false;
|
||||||
|
|
||||||
|
// console.time('Computing blame annotations...');
|
||||||
|
|
||||||
|
const cfg = this._config.annotations.file.gutter;
|
||||||
|
|
||||||
|
// Precalculate the formatting options so we don't need to do it on each iteration
|
||||||
|
const tokenOptions = Strings.getTokensFromTemplate(cfg.format)
|
||||||
|
.reduce((map, token) => {
|
||||||
|
map[token.key] = token.options as ICommitFormatOptions;
|
||||||
|
return map;
|
||||||
|
}, {} as { [token: string]: ICommitFormatOptions });
|
||||||
|
|
||||||
|
const options: ICommitFormatOptions = {
|
||||||
|
dateFormat: cfg.dateFormat === null ? this._config.defaultDateFormat : cfg.dateFormat,
|
||||||
|
tokenOptions: tokenOptions
|
||||||
|
};
|
||||||
|
|
||||||
|
const now = moment();
|
||||||
|
const offset = this.uri.offset;
|
||||||
|
const renderOptions = Annotations.gutterRenderOptions(this._config.theme, cfg.heatmap);
|
||||||
|
const dateFormat = this._config.defaultDateFormat;
|
||||||
|
const separateLines = this._config.theme.annotations.file.gutter.separateLines;
|
||||||
|
|
||||||
|
const decorations: DecorationOptions[] = [];
|
||||||
|
const document = this.document;
|
||||||
|
|
||||||
|
let commit: GitBlameCommit | undefined;
|
||||||
|
let compacted = false;
|
||||||
|
let details: DecorationOptions | undefined;
|
||||||
|
let gutter: DecorationOptions | undefined;
|
||||||
|
let previousSha: string | undefined;
|
||||||
|
|
||||||
|
for (const l of blame.lines) {
|
||||||
|
commit = blame.commits.get(l.sha);
|
||||||
|
if (commit === undefined) continue;
|
||||||
|
|
||||||
|
const line = l.line + offset;
|
||||||
|
|
||||||
|
if (previousSha === l.sha) {
|
||||||
|
// Use a shallow copy of the previous decoration options
|
||||||
|
gutter = { ...gutter } as DecorationOptions;
|
||||||
|
if (cfg.compact && !compacted) {
|
||||||
|
// Since we are wiping out the contextText make sure to copy the objects
|
||||||
|
gutter.renderOptions = { ...gutter.renderOptions };
|
||||||
|
gutter.renderOptions.before = {
|
||||||
|
...gutter.renderOptions.before,
|
||||||
|
...{ contentText: GlyphChars.Space.repeat(gutter.renderOptions!.before!.contentText!.length) }
|
||||||
|
};
|
||||||
|
|
||||||
|
if (separateLines) {
|
||||||
|
gutter.renderOptions.dark = { ...gutter.renderOptions.dark };
|
||||||
|
gutter.renderOptions.dark.before = { ...gutter.renderOptions.dark.before, ...{ textDecoration: 'none' } };
|
||||||
|
gutter.renderOptions.light = { ...gutter.renderOptions.light };
|
||||||
|
gutter.renderOptions.light.before = { ...gutter.renderOptions.light.before, ...{ textDecoration: 'none' } };
|
||||||
|
}
|
||||||
|
|
||||||
|
compacted = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
const endIndex = document.lineAt(line).firstNonWhitespaceCharacterIndex;
|
||||||
|
gutter.range = new Range(line, 0, line, endIndex);
|
||||||
|
decorations.push(gutter);
|
||||||
|
|
||||||
|
if (details !== undefined) {
|
||||||
|
details = { ...details } as DecorationOptions;
|
||||||
|
details.range = cfg.hover.wholeLine
|
||||||
|
? document.validateRange(new Range(line, 0, line, endOfLineIndex))
|
||||||
|
: gutter.range;
|
||||||
|
decorations.push(details);
|
||||||
|
}
|
||||||
|
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
compacted = false;
|
||||||
|
previousSha = l.sha;
|
||||||
|
|
||||||
|
gutter = Annotations.gutter(commit, cfg.format, options, renderOptions);
|
||||||
|
|
||||||
|
if (cfg.heatmap.enabled) {
|
||||||
|
Annotations.applyHeatmap(gutter, commit.date, now);
|
||||||
|
}
|
||||||
|
|
||||||
|
const endIndex = document.lineAt(line).firstNonWhitespaceCharacterIndex;
|
||||||
|
gutter.range = new Range(line, 0, line, endIndex);
|
||||||
|
decorations.push(gutter);
|
||||||
|
|
||||||
|
if (cfg.hover.details) {
|
||||||
|
details = Annotations.detailsHover(commit, dateFormat);
|
||||||
|
details.range = cfg.hover.wholeLine
|
||||||
|
? document.validateRange(new Range(line, 0, line, endOfLineIndex))
|
||||||
|
: gutter.range;
|
||||||
|
decorations.push(details);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (decorations.length) {
|
||||||
|
this.editor.setDecorations(this.decoration!, decorations);
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.timeEnd('Computing blame annotations...');
|
||||||
|
|
||||||
|
this.selection(shaOrLine, blame);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
64
src/annotations/hoverBlameAnnotationProvider.ts
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
'use strict';
|
||||||
|
import { DecorationOptions, Range } from 'vscode';
|
||||||
|
import { FileAnnotationType } from './annotationController';
|
||||||
|
import { Annotations, endOfLineIndex } from './annotations';
|
||||||
|
import { BlameAnnotationProviderBase } from './blameAnnotationProvider';
|
||||||
|
import { GitBlameCommit } from '../gitService';
|
||||||
|
import * as moment from 'moment';
|
||||||
|
|
||||||
|
export class HoverBlameAnnotationProvider extends BlameAnnotationProviderBase {
|
||||||
|
|
||||||
|
async provideAnnotation(shaOrLine?: string | number): Promise<boolean> {
|
||||||
|
this.annotationType = FileAnnotationType.Hover;
|
||||||
|
|
||||||
|
const blame = await this.getBlame(this._config.annotations.file.hover.heatmap.enabled);
|
||||||
|
if (blame === undefined) return false;
|
||||||
|
|
||||||
|
// console.time('Computing blame annotations...');
|
||||||
|
|
||||||
|
const cfg = this._config.annotations.file.hover;
|
||||||
|
|
||||||
|
const now = moment();
|
||||||
|
const offset = this.uri.offset;
|
||||||
|
const renderOptions = Annotations.hoverRenderOptions(this._config.theme, cfg.heatmap);
|
||||||
|
const dateFormat = this._config.defaultDateFormat;
|
||||||
|
|
||||||
|
const decorations: DecorationOptions[] = [];
|
||||||
|
const document = this.document;
|
||||||
|
|
||||||
|
let commit: GitBlameCommit | undefined;
|
||||||
|
let hover: DecorationOptions | undefined;
|
||||||
|
|
||||||
|
for (const l of blame.lines) {
|
||||||
|
commit = blame.commits.get(l.sha);
|
||||||
|
if (commit === undefined) continue;
|
||||||
|
|
||||||
|
const line = l.line + offset;
|
||||||
|
|
||||||
|
hover = Annotations.hover(commit, renderOptions, cfg.heatmap.enabled, dateFormat);
|
||||||
|
|
||||||
|
if (cfg.wholeLine) {
|
||||||
|
hover.range = document.validateRange(new Range(line, 0, line, endOfLineIndex));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const endIndex = document.lineAt(line).firstNonWhitespaceCharacterIndex;
|
||||||
|
hover.range = new Range(line, 0, line, endIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cfg.heatmap.enabled) {
|
||||||
|
Annotations.applyHeatmap(hover, commit.date, now);
|
||||||
|
}
|
||||||
|
|
||||||
|
decorations.push(hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (decorations.length) {
|
||||||
|
this.editor.setDecorations(this.decoration!, decorations);
|
||||||
|
}
|
||||||
|
|
||||||
|
// console.timeEnd('Computing blame annotations...');
|
||||||
|
|
||||||
|
this.selection(shaOrLine, blame);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
74
src/annotations/recentChangesAnnotationProvider.ts
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
'use strict';
|
||||||
|
import { DecorationOptions, ExtensionContext, Position, Range, TextEditor, TextEditorDecorationType } from 'vscode';
|
||||||
|
import { Annotations, endOfLineIndex } from './annotations';
|
||||||
|
import { FileAnnotationType } from './annotationController';
|
||||||
|
import { AnnotationProviderBase } from './annotationProvider';
|
||||||
|
import { GitService, GitUri } from '../gitService';
|
||||||
|
|
||||||
|
export class RecentChangesAnnotationProvider extends AnnotationProviderBase {
|
||||||
|
|
||||||
|
constructor(context: ExtensionContext, editor: TextEditor, decoration: TextEditorDecorationType | undefined, highlightDecoration: TextEditorDecorationType | undefined, private git: GitService, private uri: GitUri) {
|
||||||
|
super(context, editor, decoration, highlightDecoration, undefined);
|
||||||
|
}
|
||||||
|
|
||||||
|
async provideAnnotation(shaOrLine?: string | number): Promise<boolean> {
|
||||||
|
this.annotationType = FileAnnotationType.RecentChanges;
|
||||||
|
|
||||||
|
const commit = await this.git.getLogCommit(this.uri.repoPath, this.uri.fsPath, { previous: true });
|
||||||
|
if (commit === undefined) return false;
|
||||||
|
|
||||||
|
const diff = await this.git.getDiffForFile(this.uri, commit.previousSha);
|
||||||
|
if (diff === undefined) return false;
|
||||||
|
|
||||||
|
const cfg = this._config.annotations.file.recentChanges;
|
||||||
|
const dateFormat = this._config.defaultDateFormat;
|
||||||
|
|
||||||
|
const decorators: DecorationOptions[] = [];
|
||||||
|
|
||||||
|
for (const chunk of diff.chunks) {
|
||||||
|
let count = chunk.currentPosition.start - 2;
|
||||||
|
for (const line of chunk.lines) {
|
||||||
|
if (line.line === undefined) continue;
|
||||||
|
|
||||||
|
count++;
|
||||||
|
|
||||||
|
if (line.state === 'unchanged') continue;
|
||||||
|
|
||||||
|
let endingIndex = 0;
|
||||||
|
if (cfg.hover.details || cfg.hover.changes) {
|
||||||
|
endingIndex = cfg.hover.wholeLine ? endOfLineIndex : this.editor.document.lineAt(count).firstNonWhitespaceCharacterIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
const range = this.editor.document.validateRange(new Range(new Position(count, 0), new Position(count, endingIndex)));
|
||||||
|
|
||||||
|
if (cfg.hover.details) {
|
||||||
|
decorators.push({
|
||||||
|
hoverMessage: Annotations.getHoverMessage(commit, dateFormat),
|
||||||
|
range: range
|
||||||
|
} as DecorationOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
let message: string | undefined = undefined;
|
||||||
|
if (cfg.hover.changes) {
|
||||||
|
message = Annotations.getHoverDiffMessage(commit, line);
|
||||||
|
}
|
||||||
|
|
||||||
|
decorators.push({
|
||||||
|
hoverMessage: message,
|
||||||
|
range: range
|
||||||
|
} as DecorationOptions);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.editor.setDecorations(this.highlightDecoration!, decorators);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
async selection(shaOrLine?: string | number): Promise<void> {
|
||||||
|
}
|
||||||
|
|
||||||
|
async validate(): Promise<boolean> {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
150
src/annotations/whitespaceController.ts
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Disposable, workspace } from 'vscode';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
|
||||||
|
interface ConfigurationInspection {
|
||||||
|
key: string;
|
||||||
|
defaultValue?: string;
|
||||||
|
globalValue?: string;
|
||||||
|
workspaceValue?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum SettingLocation {
|
||||||
|
workspace,
|
||||||
|
global,
|
||||||
|
default
|
||||||
|
}
|
||||||
|
|
||||||
|
class RenderWhitespaceConfiguration {
|
||||||
|
|
||||||
|
constructor(public inspection: ConfigurationInspection) { }
|
||||||
|
|
||||||
|
get location(): SettingLocation {
|
||||||
|
if (this.inspection.workspaceValue) return SettingLocation.workspace;
|
||||||
|
if (this.inspection.globalValue) return SettingLocation.global;
|
||||||
|
return SettingLocation.default;
|
||||||
|
}
|
||||||
|
|
||||||
|
get overrideRequired() {
|
||||||
|
return this.value != null && this.value !== 'none';
|
||||||
|
}
|
||||||
|
|
||||||
|
get value(): string | undefined {
|
||||||
|
return this.inspection.workspaceValue || this.inspection.globalValue || this.inspection.defaultValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
update(replacement: ConfigurationInspection): boolean {
|
||||||
|
let override = false;
|
||||||
|
|
||||||
|
switch (this.location) {
|
||||||
|
case SettingLocation.workspace:
|
||||||
|
this.inspection.defaultValue = replacement.defaultValue;
|
||||||
|
this.inspection.globalValue = replacement.globalValue;
|
||||||
|
if (replacement.workspaceValue !== 'none') {
|
||||||
|
this.inspection.workspaceValue = replacement.workspaceValue;
|
||||||
|
override = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SettingLocation.global:
|
||||||
|
this.inspection.defaultValue = replacement.defaultValue;
|
||||||
|
this.inspection.workspaceValue = replacement.workspaceValue;
|
||||||
|
if (replacement.globalValue !== 'none') {
|
||||||
|
this.inspection.globalValue = replacement.globalValue;
|
||||||
|
override = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case SettingLocation.default:
|
||||||
|
this.inspection.globalValue = replacement.globalValue;
|
||||||
|
this.inspection.workspaceValue = replacement.workspaceValue;
|
||||||
|
if (replacement.defaultValue !== 'none') {
|
||||||
|
this.inspection.defaultValue = replacement.defaultValue;
|
||||||
|
override = true;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return override;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export class WhitespaceController extends Disposable {
|
||||||
|
|
||||||
|
private _configuration: RenderWhitespaceConfiguration;
|
||||||
|
private _count: number = 0;
|
||||||
|
private _disposable: Disposable;
|
||||||
|
private _disposed: boolean = false;
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super(() => this.dispose());
|
||||||
|
|
||||||
|
const subscriptions: Disposable[] = [];
|
||||||
|
|
||||||
|
subscriptions.push(workspace.onDidChangeConfiguration(this._onConfigurationChanged, this));
|
||||||
|
|
||||||
|
this._disposable = Disposable.from(...subscriptions);
|
||||||
|
|
||||||
|
this._onConfigurationChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
async dispose() {
|
||||||
|
this._disposed = true;
|
||||||
|
if (this._count !== 0) {
|
||||||
|
await this._restoreWhitespace();
|
||||||
|
this._count = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private _onConfigurationChanged() {
|
||||||
|
if (this._disposed) return;
|
||||||
|
|
||||||
|
const inspection = workspace.getConfiguration('editor').inspect<string>('renderWhitespace')!;
|
||||||
|
|
||||||
|
if (!this._count) {
|
||||||
|
this._configuration = new RenderWhitespaceConfiguration(inspection);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this._configuration.update(inspection)) {
|
||||||
|
// Since we were currently overriding whitespace, re-override
|
||||||
|
setTimeout(() => this._overrideWhitespace(), 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async override() {
|
||||||
|
if (this._disposed) return;
|
||||||
|
|
||||||
|
Logger.log(`Request whitespace override; count=${this._count}`);
|
||||||
|
this._count++;
|
||||||
|
if (this._count === 1 && this._configuration.overrideRequired) {
|
||||||
|
// Override whitespace (turn off)
|
||||||
|
await this._overrideWhitespace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async _overrideWhitespace() {
|
||||||
|
Logger.log(`Override whitespace`);
|
||||||
|
const cfg = workspace.getConfiguration('editor');
|
||||||
|
return cfg.update('renderWhitespace', 'none', this._configuration.location === SettingLocation.global);
|
||||||
|
}
|
||||||
|
|
||||||
|
async restore() {
|
||||||
|
if (this._disposed || this._count === 0) return;
|
||||||
|
|
||||||
|
Logger.log(`Request whitespace restore; count=${this._count}`);
|
||||||
|
this._count--;
|
||||||
|
if (this._count === 0 && this._configuration.overrideRequired) {
|
||||||
|
// restore whitespace
|
||||||
|
await this._restoreWhitespace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private async _restoreWhitespace() {
|
||||||
|
Logger.log(`Restore whitespace`);
|
||||||
|
const cfg = workspace.getConfiguration('editor');
|
||||||
|
return cfg.update('renderWhitespace',
|
||||||
|
this._configuration.location === SettingLocation.default
|
||||||
|
? undefined
|
||||||
|
: this._configuration.value,
|
||||||
|
this._configuration.location === SettingLocation.global);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,115 +0,0 @@
|
|||||||
'use strict';
|
|
||||||
import {CancellationToken, CodeLens, CodeLensProvider, commands, ExtensionContext, Location, Position, Range, SymbolInformation, SymbolKind, TextDocument, Uri} from 'vscode';
|
|
||||||
import {Commands, VsCodeCommands, WorkspaceState} from './constants';
|
|
||||||
import GitBlameProvider, {IGitBlame, IGitBlameCommit} from './gitBlameProvider';
|
|
||||||
import * as moment from 'moment';
|
|
||||||
|
|
||||||
export class GitBlameCodeLens extends CodeLens {
|
|
||||||
constructor(private blameProvider: GitBlameProvider, public fileName: string, public blameRange: Range, range: Range) {
|
|
||||||
super(range);
|
|
||||||
}
|
|
||||||
|
|
||||||
getBlame(): Promise<IGitBlame> {
|
|
||||||
return this.blameProvider.getBlameForRange(this.fileName, this.blameRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
static toUri(lens: GitBlameCodeLens, repoPath: string, commit: IGitBlameCommit, index: number, commitCount: number): Uri {
|
|
||||||
return GitBlameProvider.toBlameUri(repoPath, commit, lens.blameRange, index, commitCount);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export class GitHistoryCodeLens extends CodeLens {
|
|
||||||
constructor(public repoPath: string, public fileName: string, range: Range) {
|
|
||||||
super(range);
|
|
||||||
}
|
|
||||||
|
|
||||||
// static toUri(lens: GitHistoryCodeLens, index: number): Uri {
|
|
||||||
// return GitBlameProvider.toBlameUri(Object.assign({ repoPath: lens.repoPath, index: index, range: lens.blameRange, lines: lines }, line));
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
export default class GitCodeLensProvider implements CodeLensProvider {
|
|
||||||
constructor(context: ExtensionContext, public blameProvider: GitBlameProvider) { }
|
|
||||||
|
|
||||||
provideCodeLenses(document: TextDocument, token: CancellationToken): CodeLens[] | Thenable<CodeLens[]> {
|
|
||||||
this.blameProvider.blameFile(document.fileName);
|
|
||||||
|
|
||||||
return (commands.executeCommand(VsCodeCommands.ExecuteDocumentSymbolProvider, document.uri) as Promise<SymbolInformation[]>).then(symbols => {
|
|
||||||
let lenses: CodeLens[] = [];
|
|
||||||
symbols.forEach(sym => this._provideCodeLens(document, sym, lenses));
|
|
||||||
|
|
||||||
// Check if we have a lens for the whole document -- if not add one
|
|
||||||
if (!lenses.find(l => l.range.start.line === 0 && l.range.end.line === 0)) {
|
|
||||||
const docRange = document.validateRange(new Range(0, 1000000, 1000000, 1000000));
|
|
||||||
lenses.push(new GitBlameCodeLens(this.blameProvider, document.fileName, docRange, new Range(0, 0, 0, docRange.start.character)));
|
|
||||||
lenses.push(new GitHistoryCodeLens(this.blameProvider.repoPath, document.fileName, docRange.with(new Position(docRange.start.line, docRange.start.character + 1))));
|
|
||||||
}
|
|
||||||
return lenses;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
private _provideCodeLens(document: TextDocument, symbol: SymbolInformation, lenses: CodeLens[]): void {
|
|
||||||
switch (symbol.kind) {
|
|
||||||
case SymbolKind.Package:
|
|
||||||
case SymbolKind.Module:
|
|
||||||
case SymbolKind.Class:
|
|
||||||
case SymbolKind.Interface:
|
|
||||||
case SymbolKind.Constructor:
|
|
||||||
case SymbolKind.Method:
|
|
||||||
case SymbolKind.Property:
|
|
||||||
case SymbolKind.Field:
|
|
||||||
case SymbolKind.Function:
|
|
||||||
case SymbolKind.Enum:
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const line = document.lineAt(symbol.location.range.start);
|
|
||||||
|
|
||||||
let startChar = line.text.indexOf(symbol.name); //line.firstNonWhitespaceCharacterIndex;
|
|
||||||
if (startChar === -1) {
|
|
||||||
startChar = line.firstNonWhitespaceCharacterIndex;
|
|
||||||
} else {
|
|
||||||
startChar += Math.floor(symbol.name.length / 2) - 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
lenses.push(new GitBlameCodeLens(this.blameProvider, document.fileName, symbol.location.range, line.range.with(new Position(line.range.start.line, startChar))));
|
|
||||||
lenses.push(new GitHistoryCodeLens(this.blameProvider.repoPath, document.fileName, line.range.with(new Position(line.range.start.line, startChar + 1))));
|
|
||||||
}
|
|
||||||
|
|
||||||
resolveCodeLens(lens: CodeLens, token: CancellationToken): Thenable<CodeLens> {
|
|
||||||
if (lens instanceof GitBlameCodeLens) return this._resolveGitBlameCodeLens(lens, token);
|
|
||||||
if (lens instanceof GitHistoryCodeLens) return this._resolveGitHistoryCodeLens(lens, token);
|
|
||||||
}
|
|
||||||
|
|
||||||
_resolveGitBlameCodeLens(lens: GitBlameCodeLens, token: CancellationToken): Thenable<CodeLens> {
|
|
||||||
return new Promise<CodeLens>((resolve, reject) => {
|
|
||||||
lens.getBlame().then(blame => {
|
|
||||||
if (!blame.lines.length) {
|
|
||||||
console.error('No blame lines found', lens);
|
|
||||||
reject(null);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const recentCommit = Array.from(blame.commits.values()).sort((a, b) => b.date.getTime() - a.date.getTime())[0];
|
|
||||||
lens.command = {
|
|
||||||
title: `${recentCommit.author}, ${moment(recentCommit.date).fromNow()}`,
|
|
||||||
command: Commands.ShowBlameHistory,
|
|
||||||
arguments: [Uri.file(lens.fileName), lens.blameRange, lens.range.start] //, lens.locations]
|
|
||||||
};
|
|
||||||
resolve(lens);
|
|
||||||
});
|
|
||||||
});//.catch(ex => Promise.reject(ex)); // TODO: Figure out a better way to stop the codelens from appearing
|
|
||||||
}
|
|
||||||
|
|
||||||
_resolveGitHistoryCodeLens(lens: GitHistoryCodeLens, token: CancellationToken): Thenable<CodeLens> {
|
|
||||||
// TODO: Play with this more -- get this to open the correct diff to the right place
|
|
||||||
lens.command = {
|
|
||||||
title: `View History`,
|
|
||||||
command: 'git.viewFileHistory', // viewLineHistory
|
|
||||||
arguments: [Uri.file(lens.fileName)]
|
|
||||||
};
|
|
||||||
return Promise.resolve(lens);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
42
src/commands.ts
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
'use strict';
|
||||||
|
export * from './commands/common';
|
||||||
|
|
||||||
|
export * from './commands/clearFileAnnotations';
|
||||||
|
export * from './commands/closeUnchangedFiles';
|
||||||
|
export * from './commands/copyMessageToClipboard';
|
||||||
|
export * from './commands/copyShaToClipboard';
|
||||||
|
export * from './commands/diffDirectory';
|
||||||
|
export * from './commands/diffLineWithPrevious';
|
||||||
|
export * from './commands/diffLineWithWorking';
|
||||||
|
export * from './commands/diffWithBranch';
|
||||||
|
export * from './commands/diffWithNext';
|
||||||
|
export * from './commands/diffWithPrevious';
|
||||||
|
export * from './commands/diffWithRevision';
|
||||||
|
export * from './commands/diffWithWorking';
|
||||||
|
export * from './commands/openChangedFiles';
|
||||||
|
export * from './commands/openBranchInRemote';
|
||||||
|
export * from './commands/openCommitInRemote';
|
||||||
|
export * from './commands/openFileInRemote';
|
||||||
|
export * from './commands/openInRemote';
|
||||||
|
export * from './commands/openRepoInRemote';
|
||||||
|
export * from './commands/resetSuppressedWarnings';
|
||||||
|
export * from './commands/showBlameHistory';
|
||||||
|
export * from './commands/showCommitSearch';
|
||||||
|
export * from './commands/showFileBlame';
|
||||||
|
export * from './commands/showFileHistory';
|
||||||
|
export * from './commands/showLastQuickPick';
|
||||||
|
export * from './commands/showLineBlame';
|
||||||
|
export * from './commands/showQuickBranchHistory';
|
||||||
|
export * from './commands/showQuickCommitDetails';
|
||||||
|
export * from './commands/showQuickCommitFileDetails';
|
||||||
|
export * from './commands/showQuickCurrentBranchHistory';
|
||||||
|
export * from './commands/showQuickFileHistory';
|
||||||
|
export * from './commands/showQuickRepoStatus';
|
||||||
|
export * from './commands/showQuickStashList';
|
||||||
|
export * from './commands/stashApply';
|
||||||
|
export * from './commands/stashDelete';
|
||||||
|
export * from './commands/stashSave';
|
||||||
|
export * from './commands/toggleCodeLens';
|
||||||
|
export * from './commands/toggleFileBlame';
|
||||||
|
export * from './commands/toggleFileRecentChanges';
|
||||||
|
export * from './commands/toggleLineBlame';
|
||||||
24
src/commands/clearFileAnnotations.ts
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
'use strict';
|
||||||
|
import { TextEditor, TextEditorEdit, Uri, window } from 'vscode';
|
||||||
|
import { AnnotationController } from '../annotations/annotationController';
|
||||||
|
import { Commands, EditorCommand } from './common';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
|
||||||
|
export class ClearFileAnnotationsCommand extends EditorCommand {
|
||||||
|
|
||||||
|
constructor(private annotationController: AnnotationController) {
|
||||||
|
super(Commands.ClearFileAnnotations);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor: TextEditor, edit: TextEditorEdit, uri?: Uri): Promise<any> {
|
||||||
|
if (editor === undefined || editor.document === undefined || editor.document.isDirty) return undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
return this.annotationController.clear(editor.viewColumn || -1);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'ClearFileAnnotationsCommand');
|
||||||
|
return window.showErrorMessage(`Unable to clear file annotations. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
87
src/commands/closeUnchangedFiles.ts
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
'use strict';
|
||||||
|
import { commands, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorTracker } from '../activeEditorTracker';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { TextEditorComparer, UriComparer } from '../comparers';
|
||||||
|
import { BuiltInCommands } from '../constants';
|
||||||
|
import { GitService } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { Messages } from '../messages';
|
||||||
|
|
||||||
|
export interface CloseUnchangedFilesCommandArgs {
|
||||||
|
uris?: Uri[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class CloseUnchangedFilesCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.CloseUnchangedFiles);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: CloseUnchangedFilesCommandArgs = {}) {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (args.uris === undefined) {
|
||||||
|
args = { ...args };
|
||||||
|
|
||||||
|
const repoPath = await this.git.getRepoPathFromUri(uri);
|
||||||
|
if (!repoPath) return Messages.showNoRepositoryWarningMessage(`Unable to close unchanged files`);
|
||||||
|
|
||||||
|
const status = await this.git.getStatusForRepo(repoPath);
|
||||||
|
if (status === undefined) return window.showWarningMessage(`Unable to close unchanged files`);
|
||||||
|
|
||||||
|
args.uris = status.files.map(_ => _.Uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.uris.length === 0) return commands.executeCommand(BuiltInCommands.CloseAllEditors);
|
||||||
|
|
||||||
|
const editorTracker = new ActiveEditorTracker();
|
||||||
|
|
||||||
|
let count = 0;
|
||||||
|
let previous = undefined;
|
||||||
|
let editor = window.activeTextEditor;
|
||||||
|
while (true) {
|
||||||
|
if (editor !== undefined) {
|
||||||
|
if (TextEditorComparer.equals(previous, editor, { useId: true, usePosition: true })) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (editor.document !== undefined &&
|
||||||
|
(editor.document.isDirty || args.uris.some(_ => UriComparer.equals(_, editor!.document && editor!.document.uri)))) {
|
||||||
|
const lastPrevious = previous;
|
||||||
|
previous = editor;
|
||||||
|
editor = await editorTracker.awaitNext(500);
|
||||||
|
|
||||||
|
if (TextEditorComparer.equals(lastPrevious, editor, { useId: true, usePosition: true })) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
previous = editor;
|
||||||
|
editor = await editorTracker.awaitClose(500);
|
||||||
|
|
||||||
|
if (previous === undefined && editor === undefined) {
|
||||||
|
count++;
|
||||||
|
// This is such a shitty hack, but I can't figure out any other reliable way to know that we've cycled through all the editors :(
|
||||||
|
if (count >= 4) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
count = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
editorTracker.dispose();
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'CloseUnchangedFilesCommand');
|
||||||
|
return window.showErrorMessage(`Unable to close unchanged files. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
304
src/commands/common.ts
Normal file
@@ -0,0 +1,304 @@
|
|||||||
|
'use strict';
|
||||||
|
import { commands, Disposable, SourceControlResourceGroup, SourceControlResourceState, TextDocumentShowOptions, TextEditor, TextEditorEdit, Uri, window, workspace } from 'vscode';
|
||||||
|
import { ExplorerNode } from '../views/explorerNodes';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { Telemetry } from '../telemetry';
|
||||||
|
|
||||||
|
export type Commands =
|
||||||
|
'gitlens.clearFileAnnotations' |
|
||||||
|
'gitlens.closeUnchangedFiles' |
|
||||||
|
'gitlens.copyMessageToClipboard' |
|
||||||
|
'gitlens.copyShaToClipboard' |
|
||||||
|
'gitlens.diffDirectory' |
|
||||||
|
'gitlens.diffWithBranch' |
|
||||||
|
'gitlens.diffWithNext' |
|
||||||
|
'gitlens.diffWithPrevious' |
|
||||||
|
'gitlens.diffLineWithPrevious' |
|
||||||
|
'gitlens.diffWithRevision' |
|
||||||
|
'gitlens.diffWithWorking' |
|
||||||
|
'gitlens.diffLineWithWorking' |
|
||||||
|
'gitlens.openChangedFiles' |
|
||||||
|
'gitlens.openBranchInRemote' |
|
||||||
|
'gitlens.openCommitInRemote' |
|
||||||
|
'gitlens.openFileInRemote' |
|
||||||
|
'gitlens.openInRemote' |
|
||||||
|
'gitlens.openRepoInRemote' |
|
||||||
|
'gitlens.resetSuppressedWarnings' |
|
||||||
|
'gitlens.showBlameHistory' |
|
||||||
|
'gitlens.showCommitSearch' |
|
||||||
|
'gitlens.showFileBlame' |
|
||||||
|
'gitlens.showFileHistory' |
|
||||||
|
'gitlens.showLastQuickPick' |
|
||||||
|
'gitlens.showLineBlame' |
|
||||||
|
'gitlens.showQuickBranchHistory' |
|
||||||
|
'gitlens.showQuickCommitDetails' |
|
||||||
|
'gitlens.showQuickCommitFileDetails' |
|
||||||
|
'gitlens.showQuickFileHistory' |
|
||||||
|
'gitlens.showQuickRepoHistory' |
|
||||||
|
'gitlens.showQuickRepoStatus' |
|
||||||
|
'gitlens.showQuickStashList' |
|
||||||
|
'gitlens.stashApply' |
|
||||||
|
'gitlens.stashDelete' |
|
||||||
|
'gitlens.stashSave' |
|
||||||
|
'gitlens.toggleCodeLens' |
|
||||||
|
'gitlens.toggleFileBlame' |
|
||||||
|
'gitlens.toggleFileRecentChanges' |
|
||||||
|
'gitlens.toggleLineBlame';
|
||||||
|
export const Commands = {
|
||||||
|
ClearFileAnnotations: 'gitlens.clearFileAnnotations' as Commands,
|
||||||
|
CloseUnchangedFiles: 'gitlens.closeUnchangedFiles' as Commands,
|
||||||
|
CopyMessageToClipboard: 'gitlens.copyMessageToClipboard' as Commands,
|
||||||
|
CopyShaToClipboard: 'gitlens.copyShaToClipboard' as Commands,
|
||||||
|
DiffDirectory: 'gitlens.diffDirectory' as Commands,
|
||||||
|
DiffWithBranch: 'gitlens.diffWithBranch' as Commands,
|
||||||
|
DiffWithNext: 'gitlens.diffWithNext' as Commands,
|
||||||
|
DiffWithPrevious: 'gitlens.diffWithPrevious' as Commands,
|
||||||
|
DiffLineWithPrevious: 'gitlens.diffLineWithPrevious' as Commands,
|
||||||
|
DiffWithRevision: 'gitlens.diffWithRevision' as Commands,
|
||||||
|
DiffWithWorking: 'gitlens.diffWithWorking' as Commands,
|
||||||
|
DiffLineWithWorking: 'gitlens.diffLineWithWorking' as Commands,
|
||||||
|
OpenChangedFiles: 'gitlens.openChangedFiles' as Commands,
|
||||||
|
OpenBranchInRemote: 'gitlens.openBranchInRemote' as Commands,
|
||||||
|
OpenCommitInRemote: 'gitlens.openCommitInRemote' as Commands,
|
||||||
|
OpenFileInRemote: 'gitlens.openFileInRemote' as Commands,
|
||||||
|
OpenInRemote: 'gitlens.openInRemote' as Commands,
|
||||||
|
OpenRepoInRemote: 'gitlens.openRepoInRemote' as Commands,
|
||||||
|
ResetSuppressedWarnings: 'gitlens.resetSuppressedWarnings' as Commands,
|
||||||
|
ShowBlameHistory: 'gitlens.showBlameHistory' as Commands,
|
||||||
|
ShowCommitSearch: 'gitlens.showCommitSearch' as Commands,
|
||||||
|
ShowFileBlame: 'gitlens.showFileBlame' as Commands,
|
||||||
|
ShowFileHistory: 'gitlens.showFileHistory' as Commands,
|
||||||
|
ShowLastQuickPick: 'gitlens.showLastQuickPick' as Commands,
|
||||||
|
ShowLineBlame: 'gitlens.showLineBlame' as Commands,
|
||||||
|
ShowQuickCommitDetails: 'gitlens.showQuickCommitDetails' as Commands,
|
||||||
|
ShowQuickCommitFileDetails: 'gitlens.showQuickCommitFileDetails' as Commands,
|
||||||
|
ShowQuickFileHistory: 'gitlens.showQuickFileHistory' as Commands,
|
||||||
|
ShowQuickBranchHistory: 'gitlens.showQuickBranchHistory' as Commands,
|
||||||
|
ShowQuickCurrentBranchHistory: 'gitlens.showQuickRepoHistory' as Commands,
|
||||||
|
ShowQuickRepoStatus: 'gitlens.showQuickRepoStatus' as Commands,
|
||||||
|
ShowQuickStashList: 'gitlens.showQuickStashList' as Commands,
|
||||||
|
StashApply: 'gitlens.stashApply' as Commands,
|
||||||
|
StashDelete: 'gitlens.stashDelete' as Commands,
|
||||||
|
StashSave: 'gitlens.stashSave' as Commands,
|
||||||
|
ToggleCodeLens: 'gitlens.toggleCodeLens' as Commands,
|
||||||
|
ToggleFileBlame: 'gitlens.toggleFileBlame' as Commands,
|
||||||
|
ToggleFileRecentChanges: 'gitlens.toggleFileRecentChanges' as Commands,
|
||||||
|
ToggleLineBlame: 'gitlens.toggleLineBlame' as Commands
|
||||||
|
};
|
||||||
|
|
||||||
|
export function getCommandUri(uri?: Uri, editor?: TextEditor): Uri | undefined {
|
||||||
|
if (uri instanceof Uri) return uri;
|
||||||
|
if (editor === undefined || editor.document === undefined) return undefined;
|
||||||
|
return editor.document.uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CommandContextParsingOptions {
|
||||||
|
editor: boolean;
|
||||||
|
uri: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CommandBaseContext {
|
||||||
|
editor?: TextEditor;
|
||||||
|
uri?: Uri;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CommandScmGroupsContext extends CommandBaseContext {
|
||||||
|
type: 'scm-groups';
|
||||||
|
scmResourceGroups: SourceControlResourceGroup[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CommandScmStatesContext extends CommandBaseContext {
|
||||||
|
type: 'scm-states';
|
||||||
|
scmResourceStates: SourceControlResourceState[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CommandUnknownContext extends CommandBaseContext {
|
||||||
|
type: 'unknown';
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CommandUriContext extends CommandBaseContext {
|
||||||
|
type: 'uri';
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CommandViewContext extends CommandBaseContext {
|
||||||
|
type: 'view';
|
||||||
|
node: ExplorerNode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export type CommandContext = CommandScmGroupsContext | CommandScmStatesContext | CommandUnknownContext | CommandUriContext | CommandViewContext;
|
||||||
|
|
||||||
|
function isScmResourceGroup(group: any): group is SourceControlResourceGroup {
|
||||||
|
if (group === undefined) return false;
|
||||||
|
|
||||||
|
return (group as SourceControlResourceGroup).id !== undefined && (group.handle !== undefined || (group as SourceControlResourceGroup).label !== undefined || (group as SourceControlResourceGroup).resourceStates !== undefined);
|
||||||
|
}
|
||||||
|
|
||||||
|
function isScmResourceState(state: any): state is SourceControlResourceState {
|
||||||
|
if (state === undefined) return false;
|
||||||
|
|
||||||
|
return (state as SourceControlResourceState).resourceUri !== undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
function isTextEditor(editor: any): editor is TextEditor {
|
||||||
|
if (editor === undefined) return false;
|
||||||
|
|
||||||
|
return editor.id !== undefined && ((editor as TextEditor).edit !== undefined || (editor as TextEditor).document !== undefined);
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class Command extends Disposable {
|
||||||
|
|
||||||
|
protected readonly contextParsingOptions: CommandContextParsingOptions = { editor: false, uri: false };
|
||||||
|
|
||||||
|
private _disposable: Disposable;
|
||||||
|
|
||||||
|
constructor(protected command: Commands) {
|
||||||
|
super(() => this.dispose());
|
||||||
|
|
||||||
|
this._disposable = commands.registerCommand(command, this._execute, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
this._disposable && this._disposable.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async preExecute(context: CommandContext, ...args: any[]): Promise<any> {
|
||||||
|
return this.execute(...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract execute(...args: any[]): any;
|
||||||
|
|
||||||
|
protected _execute(...args: any[]): any {
|
||||||
|
Telemetry.trackEvent(this.command);
|
||||||
|
|
||||||
|
const [context, rest] = Command._parseContext(this.contextParsingOptions, ...args);
|
||||||
|
return this.preExecute(context, ...rest);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static _parseContext(options: CommandContextParsingOptions, ...args: any[]): [CommandContext, any[]] {
|
||||||
|
let editor: TextEditor | undefined = undefined;
|
||||||
|
|
||||||
|
let firstArg = args[0];
|
||||||
|
if (options.editor && (firstArg === undefined || isTextEditor(firstArg))) {
|
||||||
|
editor = firstArg;
|
||||||
|
args = args.slice(1);
|
||||||
|
firstArg = args[0];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (options.uri && (firstArg === undefined || firstArg instanceof Uri)) {
|
||||||
|
const [uri, ...rest] = args as [Uri, any];
|
||||||
|
return [{ type: 'uri', editor: editor, uri: uri }, rest];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (firstArg instanceof ExplorerNode) {
|
||||||
|
const [node, ...rest] = args as [ExplorerNode, any];
|
||||||
|
return [{ type: 'view', node: node, uri: node.uri }, rest];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isScmResourceState(firstArg)) {
|
||||||
|
const states = [];
|
||||||
|
let count = 0;
|
||||||
|
for (const arg of args) {
|
||||||
|
if (!isScmResourceState(arg)) break;
|
||||||
|
|
||||||
|
count++;
|
||||||
|
states.push(arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [{ type: 'scm-states', scmResourceStates: states, uri: states[0].resourceUri }, args.slice(count)];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isScmResourceGroup(firstArg)) {
|
||||||
|
const groups = [];
|
||||||
|
let count = 0;
|
||||||
|
for (const arg of args) {
|
||||||
|
if (!isScmResourceGroup(arg)) break;
|
||||||
|
|
||||||
|
count++;
|
||||||
|
groups.push(arg);
|
||||||
|
}
|
||||||
|
|
||||||
|
return [{ type: 'scm-groups', scmResourceGroups: groups }, args.slice(count)];
|
||||||
|
}
|
||||||
|
|
||||||
|
return [{ type: 'unknown', editor: editor }, args];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class ActiveEditorCommand extends Command {
|
||||||
|
|
||||||
|
protected readonly contextParsingOptions: CommandContextParsingOptions = { editor: true, uri: true };
|
||||||
|
|
||||||
|
constructor(public readonly command: Commands) {
|
||||||
|
super(command);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async preExecute(context: CommandContext, ...args: any[]): Promise<any> {
|
||||||
|
return this.execute(context.editor, context.uri, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected _execute(...args: any[]): any {
|
||||||
|
return super._execute(window.activeTextEditor, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract execute(editor?: TextEditor, ...args: any[]): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
let lastCommand: { command: string, args: any[] } | undefined = undefined;
|
||||||
|
export function getLastCommand() {
|
||||||
|
return lastCommand;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class ActiveEditorCachedCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(public readonly command: Commands) {
|
||||||
|
super(command);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected _execute(...args: any[]): any {
|
||||||
|
lastCommand = {
|
||||||
|
command: this.command,
|
||||||
|
args: args
|
||||||
|
};
|
||||||
|
return super._execute(...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract execute(editor: TextEditor, ...args: any[]): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export abstract class EditorCommand extends Disposable {
|
||||||
|
|
||||||
|
private _disposable: Disposable;
|
||||||
|
|
||||||
|
constructor(public readonly command: Commands) {
|
||||||
|
super(() => this.dispose());
|
||||||
|
this._disposable = commands.registerTextEditorCommand(command, this._execute, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
dispose() {
|
||||||
|
this._disposable && this._disposable.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
private _execute(editor: TextEditor, edit: TextEditorEdit, ...args: any[]): any {
|
||||||
|
Telemetry.trackEvent(this.command);
|
||||||
|
return this.execute(editor, edit, ...args);
|
||||||
|
}
|
||||||
|
|
||||||
|
abstract execute(editor: TextEditor, edit: TextEditorEdit, ...args: any[]): any;
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function openEditor(uri: Uri, options?: TextDocumentShowOptions): Promise<TextEditor | undefined> {
|
||||||
|
try {
|
||||||
|
const defaults: TextDocumentShowOptions = {
|
||||||
|
preserveFocus: false,
|
||||||
|
preview: true,
|
||||||
|
viewColumn: (window.activeTextEditor && window.activeTextEditor.viewColumn) || 1
|
||||||
|
};
|
||||||
|
|
||||||
|
const document = await workspace.openTextDocument(uri);
|
||||||
|
return window.showTextDocument(document, { ...defaults, ...(options || {}) });
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'openEditor');
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
}
|
||||||
80
src/commands/copyMessageToClipboard.ts
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Iterables } from '../system';
|
||||||
|
import { TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { copy } from 'copy-paste';
|
||||||
|
|
||||||
|
export interface CopyMessageToClipboardCommandArgs {
|
||||||
|
message?: string;
|
||||||
|
sha?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class CopyMessageToClipboardCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.CopyMessageToClipboard);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: CopyMessageToClipboardCommandArgs = {}): Promise<any> {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
|
||||||
|
try {
|
||||||
|
args = { ...args };
|
||||||
|
|
||||||
|
// If we don't have an editor then get the message of the last commit to the branch
|
||||||
|
if (uri === undefined) {
|
||||||
|
if (!this.git.repoPath) return undefined;
|
||||||
|
|
||||||
|
const log = await this.git.getLogForRepo(this.git.repoPath, undefined, 1);
|
||||||
|
if (!log) return undefined;
|
||||||
|
|
||||||
|
args.message = Iterables.first(log.commits.values()).message;
|
||||||
|
copy(args.message);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
|
||||||
|
if (args.message === undefined) {
|
||||||
|
if (args.sha === undefined) {
|
||||||
|
if (editor !== undefined && editor.document !== undefined && editor.document.isDirty) return undefined;
|
||||||
|
|
||||||
|
const line = (editor && editor.selection.active.line) || gitUri.offset;
|
||||||
|
const blameline = line - gitUri.offset;
|
||||||
|
if (blameline < 0) return undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const blame = await this.git.getBlameForLine(gitUri, blameline);
|
||||||
|
if (!blame) return undefined;
|
||||||
|
|
||||||
|
if (blame.commit.isUncommitted) return undefined;
|
||||||
|
|
||||||
|
args.sha = blame.commit.sha;
|
||||||
|
if (!gitUri.repoPath) {
|
||||||
|
gitUri.repoPath = blame.commit.repoPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'CopyMessageToClipboardCommand', `getBlameForLine(${blameline})`);
|
||||||
|
return window.showErrorMessage(`Unable to copy message. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get the full commit message -- since blame only returns the summary
|
||||||
|
const commit = await this.git.getLogCommit(gitUri.repoPath, gitUri.fsPath, args.sha);
|
||||||
|
if (!commit) return undefined;
|
||||||
|
|
||||||
|
args.message = commit.message;
|
||||||
|
}
|
||||||
|
|
||||||
|
copy(args.message);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'CopyMessageToClipboardCommand');
|
||||||
|
return window.showErrorMessage(`Unable to copy message. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
66
src/commands/copyShaToClipboard.ts
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Iterables } from '../system';
|
||||||
|
import { TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { copy } from 'copy-paste';
|
||||||
|
|
||||||
|
export interface CopyShaToClipboardCommandArgs {
|
||||||
|
sha?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class CopyShaToClipboardCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.CopyShaToClipboard);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: CopyShaToClipboardCommandArgs = {}): Promise<any> {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
|
||||||
|
try {
|
||||||
|
args = { ...args };
|
||||||
|
|
||||||
|
// If we don't have an editor then get the sha of the last commit to the branch
|
||||||
|
if (uri === undefined) {
|
||||||
|
if (!this.git.repoPath) return undefined;
|
||||||
|
|
||||||
|
const log = await this.git.getLogForRepo(this.git.repoPath, undefined, 1);
|
||||||
|
if (!log) return undefined;
|
||||||
|
|
||||||
|
args.sha = Iterables.first(log.commits.values()).sha;
|
||||||
|
copy(args.sha);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
|
||||||
|
if (args.sha === undefined) {
|
||||||
|
if (editor !== undefined && editor.document !== undefined && editor.document.isDirty) return undefined;
|
||||||
|
|
||||||
|
const line = (editor && editor.selection.active.line) || gitUri.offset;
|
||||||
|
const blameline = line - gitUri.offset;
|
||||||
|
if (blameline < 0) return undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const blame = await this.git.getBlameForLine(gitUri, blameline);
|
||||||
|
if (!blame) return undefined;
|
||||||
|
|
||||||
|
args.sha = blame.commit.sha;
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'CopyShaToClipboardCommand', `getBlameForLine(${blameline})`);
|
||||||
|
return window.showErrorMessage(`Unable to copy commit id. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
copy(args.sha);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'CopyShaToClipboardCommand');
|
||||||
|
return window.showErrorMessage(`Unable to copy commit id. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
61
src/commands/diffDirectory.ts
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Iterables } from '../system';
|
||||||
|
import { commands, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { BuiltInCommands, GlyphChars } from '../constants';
|
||||||
|
import { GitService } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { Messages } from '../messages';
|
||||||
|
import { BranchesQuickPick, CommandQuickPickItem } from '../quickPicks';
|
||||||
|
|
||||||
|
export interface DiffDirectoryCommandCommandArgs {
|
||||||
|
shaOrBranch1?: string;
|
||||||
|
shaOrBranch2?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DiffDirectoryCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.DiffDirectory);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: DiffDirectoryCommandCommandArgs = {}): Promise<any> {
|
||||||
|
const diffTool = await this.git.getConfig('diff.tool');
|
||||||
|
if (!diffTool) {
|
||||||
|
const result = await window.showWarningMessage(`Unable to open directory compare because there is no Git diff tool configured`, 'View Git Docs');
|
||||||
|
if (!result) return undefined;
|
||||||
|
|
||||||
|
return commands.executeCommand(BuiltInCommands.Open, Uri.parse('https://git-scm.com/docs/git-config#git-config-difftool'));
|
||||||
|
}
|
||||||
|
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const repoPath = await this.git.getRepoPathFromUri(uri);
|
||||||
|
if (!repoPath) return Messages.showNoRepositoryWarningMessage(`Unable to open directory compare`);
|
||||||
|
|
||||||
|
if (!args.shaOrBranch1) {
|
||||||
|
args = { ...args };
|
||||||
|
|
||||||
|
const branches = await this.git.getBranches(repoPath);
|
||||||
|
const current = Iterables.find(branches, _ => _.current);
|
||||||
|
if (current == null) return window.showWarningMessage(`Unable to open directory compare`);
|
||||||
|
|
||||||
|
const pick = await BranchesQuickPick.show(branches, `Compare ${current.name} to ${GlyphChars.Ellipsis}`);
|
||||||
|
if (pick === undefined) return undefined;
|
||||||
|
|
||||||
|
if (pick instanceof CommandQuickPickItem) return pick.execute();
|
||||||
|
|
||||||
|
args.shaOrBranch1 = pick.branch.name;
|
||||||
|
if (args.shaOrBranch1 === undefined) return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.git.openDirectoryDiff(repoPath, args.shaOrBranch1, args.shaOrBranch2);
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffDirectoryCommand');
|
||||||
|
return window.showErrorMessage(`Unable to open directory compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
98
src/commands/diffLineWithPrevious.ts
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
'use strict';
|
||||||
|
import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { BuiltInCommands, GlyphChars } from '../constants';
|
||||||
|
import { DiffWithPreviousCommandArgs } from './diffWithPrevious';
|
||||||
|
import { DiffWithWorkingCommandArgs } from './diffWithWorking';
|
||||||
|
import { GitCommit, GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { Messages } from '../messages';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
export interface DiffLineWithPreviousCommandArgs {
|
||||||
|
commit?: GitCommit;
|
||||||
|
line?: number;
|
||||||
|
showOptions?: TextDocumentShowOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DiffLineWithPreviousCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.DiffLineWithPrevious);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: DiffLineWithPreviousCommandArgs = {}): Promise<any> {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
if (uri === undefined) return undefined;
|
||||||
|
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
|
||||||
|
args = { ...args };
|
||||||
|
if (args.line === undefined) {
|
||||||
|
args.line = editor === undefined ? gitUri.offset : editor.selection.active.line;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.commit === undefined || GitService.isUncommitted(args.commit.sha)) {
|
||||||
|
if (editor !== undefined && editor.document !== undefined && editor.document.isDirty) return undefined;
|
||||||
|
|
||||||
|
const blameline = args.line - gitUri.offset;
|
||||||
|
if (blameline < 0) return undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const blame = await this.git.getBlameForLine(gitUri, blameline);
|
||||||
|
if (blame === undefined) return Messages.showFileNotUnderSourceControlWarningMessage('Unable to open compare');
|
||||||
|
|
||||||
|
args.commit = blame.commit;
|
||||||
|
|
||||||
|
// If we don't have a sha or the current commit matches the blame, show the previous
|
||||||
|
if (gitUri.sha === undefined || gitUri.sha === args.commit.sha) {
|
||||||
|
return commands.executeCommand(Commands.DiffWithPrevious, new GitUri(uri, args.commit), {
|
||||||
|
line: args.line,
|
||||||
|
showOptions: args.showOptions
|
||||||
|
} as DiffWithPreviousCommandArgs);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If the line is uncommitted, find the previous commit and treat it as a DiffWithWorking
|
||||||
|
if (args.commit.isUncommitted) {
|
||||||
|
uri = args.commit.uri;
|
||||||
|
args.commit = new GitCommit(args.commit.type, args.commit.repoPath, args.commit.previousSha!, args.commit.previousFileName!, args.commit.author, args.commit.date, args.commit.message);
|
||||||
|
args.line = (blame.line.line + 1) + gitUri.offset;
|
||||||
|
|
||||||
|
return commands.executeCommand(Commands.DiffWithWorking, uri, {
|
||||||
|
commit: args.commit,
|
||||||
|
line: args.line,
|
||||||
|
showOptions: args.showOptions
|
||||||
|
} as DiffWithWorkingCommandArgs);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffWithPreviousLineCommand', `getBlameForLine(${blameline})`);
|
||||||
|
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
const [rhs, lhs] = await Promise.all([
|
||||||
|
this.git.getVersionedFile(gitUri.repoPath, gitUri.fsPath, gitUri.sha!),
|
||||||
|
this.git.getVersionedFile(args.commit.repoPath, args.commit.uri.fsPath, args.commit.sha)
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
|
Uri.file(lhs),
|
||||||
|
Uri.file(rhs),
|
||||||
|
`${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(gitUri.fsPath)} (${gitUri.shortSha})`,
|
||||||
|
args.showOptions);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffWithPreviousLineCommand', 'getVersionedFile');
|
||||||
|
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
57
src/commands/diffLineWithWorking.ts
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
'use strict';
|
||||||
|
import { commands, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { DiffWithWorkingCommandArgs } from './diffWithWorking';
|
||||||
|
import { GitCommit, GitService, GitUri } from '../gitService';
|
||||||
|
import { Messages } from '../messages';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
|
||||||
|
export interface DiffLineWithWorkingCommandArgs {
|
||||||
|
commit?: GitCommit;
|
||||||
|
line?: number;
|
||||||
|
showOptions?: TextDocumentShowOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DiffLineWithWorkingCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.DiffLineWithWorking);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: DiffLineWithWorkingCommandArgs = {}): Promise<any> {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
if (uri === undefined) return undefined;
|
||||||
|
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
|
||||||
|
args = { ...args };
|
||||||
|
if (args.line === undefined) {
|
||||||
|
args.line = editor === undefined ? gitUri.offset : editor.selection.active.line;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.commit === undefined || GitService.isUncommitted(args.commit.sha)) {
|
||||||
|
if (editor !== undefined && editor.document !== undefined && editor.document.isDirty) return undefined;
|
||||||
|
|
||||||
|
const blameline = args.line - gitUri.offset;
|
||||||
|
if (blameline < 0) return undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const blame = await this.git.getBlameForLine(gitUri, blameline);
|
||||||
|
if (blame === undefined) return Messages.showFileNotUnderSourceControlWarningMessage('Unable to open compare');
|
||||||
|
|
||||||
|
args.commit = blame.commit;
|
||||||
|
// If the line is uncommitted, find the previous commit
|
||||||
|
if (args.commit.isUncommitted) {
|
||||||
|
args.commit = new GitCommit(args.commit.type, args.commit.repoPath, args.commit.previousSha!, args.commit.previousFileName!, args.commit.author, args.commit.date, args.commit.message);
|
||||||
|
args.line = blame.line.line + 1 + gitUri.offset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffLineWithWorkingCommand', `getBlameForLine(${blameline})`);
|
||||||
|
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return commands.executeCommand(Commands.DiffWithWorking, uri, args as DiffWithWorkingCommandArgs);
|
||||||
|
}
|
||||||
|
}
|
||||||
66
src/commands/diffWithBranch.ts
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
'use strict';
|
||||||
|
import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { BuiltInCommands, GlyphChars } from '../constants';
|
||||||
|
import { GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { Messages } from '../messages';
|
||||||
|
import { BranchesQuickPick, CommandQuickPickItem } from '../quickPicks';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
export interface DiffWithBranchCommandArgs {
|
||||||
|
line?: number;
|
||||||
|
showOptions?: TextDocumentShowOptions;
|
||||||
|
|
||||||
|
goBackCommand?: CommandQuickPickItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DiffWithBranchCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.DiffWithBranch);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: DiffWithBranchCommandArgs = {}): Promise<any> {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
if (uri === undefined) return undefined;
|
||||||
|
|
||||||
|
args = { ...args };
|
||||||
|
if (args.line === undefined) {
|
||||||
|
args.line = editor === undefined ? 0 : editor.selection.active.line;
|
||||||
|
}
|
||||||
|
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
if (!gitUri.repoPath) return Messages.showNoRepositoryWarningMessage(`Unable to open branch compare`);
|
||||||
|
|
||||||
|
const branches = await this.git.getBranches(gitUri.repoPath);
|
||||||
|
const pick = await BranchesQuickPick.show(branches, `Compare ${path.basename(gitUri.fsPath)} to ${GlyphChars.Ellipsis}`, args.goBackCommand);
|
||||||
|
if (pick === undefined) return undefined;
|
||||||
|
|
||||||
|
if (pick instanceof CommandQuickPickItem) return pick.execute();
|
||||||
|
|
||||||
|
const branch = pick.branch.name;
|
||||||
|
if (branch === undefined) return undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const compare = await this.git.getVersionedFile(gitUri.repoPath, gitUri.fsPath, branch);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
|
Uri.file(compare),
|
||||||
|
gitUri.fileUri(),
|
||||||
|
`${path.basename(gitUri.fsPath)} (${branch}) ${GlyphChars.ArrowLeftRight} ${path.basename(gitUri.fsPath)}`,
|
||||||
|
args.showOptions);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffWithBranchCommand', 'getVersionedFile');
|
||||||
|
return window.showErrorMessage(`Unable to open branch compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
81
src/commands/diffWithNext.ts
Normal file
@@ -0,0 +1,81 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Iterables } from '../system';
|
||||||
|
import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { BuiltInCommands, GlyphChars } from '../constants';
|
||||||
|
import { GitLogCommit, GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { Messages } from '../messages';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
export interface DiffWithNextCommandArgs {
|
||||||
|
commit?: GitLogCommit;
|
||||||
|
line?: number;
|
||||||
|
range?: Range;
|
||||||
|
showOptions?: TextDocumentShowOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DiffWithNextCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.DiffWithNext);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: DiffWithNextCommandArgs = {}): Promise<any> {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
if (uri === undefined) return undefined;
|
||||||
|
|
||||||
|
args = { ...args };
|
||||||
|
if (args.line === undefined) {
|
||||||
|
args.line = editor === undefined ? 0 : editor.selection.active.line;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.commit === undefined || !(args.commit instanceof GitLogCommit) || args.range !== undefined) {
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
|
||||||
|
try {
|
||||||
|
// If the sha is missing or the file is uncommitted, treat it as a DiffWithWorking
|
||||||
|
if (gitUri.sha === undefined && await this.git.isFileUncommitted(gitUri)) {
|
||||||
|
return commands.executeCommand(Commands.DiffWithWorking, uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
const sha = args.commit === undefined ? gitUri.sha : args.commit.sha;
|
||||||
|
|
||||||
|
const log = await this.git.getLogForFile(gitUri.repoPath, gitUri.fsPath, undefined, { maxCount: sha !== undefined ? undefined : 2, range: args.range! });
|
||||||
|
if (log === undefined) return Messages.showFileNotUnderSourceControlWarningMessage('Unable to open compare');
|
||||||
|
|
||||||
|
args.commit = (sha && log.commits.get(sha)) || Iterables.first(log.commits.values());
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffWithNextCommand', `getLogForFile(${gitUri.repoPath}, ${gitUri.fsPath})`);
|
||||||
|
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.commit.nextSha === undefined) return commands.executeCommand(Commands.DiffWithWorking, uri);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const [rhs, lhs] = await Promise.all([
|
||||||
|
this.git.getVersionedFile(args.commit.repoPath, args.commit.nextUri.fsPath, args.commit.nextSha),
|
||||||
|
this.git.getVersionedFile(args.commit.repoPath, args.commit.uri.fsPath, args.commit.sha)
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
|
Uri.file(lhs),
|
||||||
|
Uri.file(rhs),
|
||||||
|
`${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(args.commit.nextUri.fsPath)} (${args.commit.nextShortSha})`,
|
||||||
|
args.showOptions);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffWithNextCommand', 'getVersionedFile');
|
||||||
|
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
80
src/commands/diffWithPrevious.ts
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Iterables } from '../system';
|
||||||
|
import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { BuiltInCommands, GlyphChars } from '../constants';
|
||||||
|
import { DiffWithWorkingCommandArgs } from './diffWithWorking';
|
||||||
|
import { GitCommit, GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { Messages } from '../messages';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
export interface DiffWithPreviousCommandArgs {
|
||||||
|
commit?: GitCommit;
|
||||||
|
line?: number;
|
||||||
|
range?: Range;
|
||||||
|
showOptions?: TextDocumentShowOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DiffWithPreviousCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.DiffWithPrevious);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: DiffWithPreviousCommandArgs = {}): Promise<any> {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
if (uri === undefined) return undefined;
|
||||||
|
|
||||||
|
args = { ...args };
|
||||||
|
if (args.line === undefined) {
|
||||||
|
args.line = editor === undefined ? 0 : editor.selection.active.line;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.commit === undefined || args.commit.type !== 'file' || args.range !== undefined) {
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const sha = args.commit === undefined ? gitUri.sha : args.commit.sha;
|
||||||
|
|
||||||
|
const log = await this.git.getLogForFile(gitUri.repoPath, gitUri.fsPath, sha, { maxCount: 2, range: args.range!, skipMerges: true });
|
||||||
|
if (log === undefined) return Messages.showFileNotUnderSourceControlWarningMessage('Unable to open compare');
|
||||||
|
|
||||||
|
args.commit = (sha && log.commits.get(sha)) || Iterables.first(log.commits.values());
|
||||||
|
|
||||||
|
// If the sha is missing and the file is uncommitted, then treat it as a DiffWithWorking
|
||||||
|
if (gitUri.sha === undefined && await this.git.isFileUncommitted(gitUri)) return commands.executeCommand(Commands.DiffWithWorking, uri, { commit: args.commit, showOptions: args.showOptions } as DiffWithWorkingCommandArgs);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffWithPreviousCommand', `getLogForFile(${gitUri.repoPath}, ${gitUri.fsPath})`);
|
||||||
|
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.commit.previousSha === undefined) return Messages.showCommitHasNoPreviousCommitWarningMessage(args.commit);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const [rhs, lhs] = await Promise.all([
|
||||||
|
this.git.getVersionedFile(args.commit.repoPath, args.commit.uri.fsPath, args.commit.sha),
|
||||||
|
this.git.getVersionedFile(args.commit.repoPath, args.commit.previousUri.fsPath, args.commit.previousSha)
|
||||||
|
]);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
|
Uri.file(lhs),
|
||||||
|
Uri.file(rhs),
|
||||||
|
`${path.basename(args.commit.previousUri.fsPath)} (${args.commit.previousShortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha})`,
|
||||||
|
args.showOptions);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffWithPreviousCommand', 'getVersionedFile');
|
||||||
|
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
69
src/commands/diffWithRevision.ts
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
'use strict';
|
||||||
|
import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { BuiltInCommands, GlyphChars } from '../constants';
|
||||||
|
import { GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { Messages } from '../messages';
|
||||||
|
import { CommandQuickPickItem, FileHistoryQuickPick } from '../quickPicks';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
export interface DiffWithRevisionCommandArgs {
|
||||||
|
line?: number;
|
||||||
|
maxCount?: number;
|
||||||
|
showOptions?: TextDocumentShowOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DiffWithRevisionCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.DiffWithRevision);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: DiffWithRevisionCommandArgs = {}): Promise<any> {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
if (uri === undefined) return undefined;
|
||||||
|
|
||||||
|
args = { ...args };
|
||||||
|
if (args.line === undefined) {
|
||||||
|
args.line = editor === undefined ? 0 : editor.selection.active.line;
|
||||||
|
}
|
||||||
|
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
if (args.maxCount == null) {
|
||||||
|
args.maxCount = this.git.config.advanced.maxQuickHistory;
|
||||||
|
}
|
||||||
|
|
||||||
|
const progressCancellation = FileHistoryQuickPick.showProgress(gitUri);
|
||||||
|
try {
|
||||||
|
const log = await this.git.getLogForFile(gitUri.repoPath, gitUri.fsPath, gitUri.sha, { maxCount: args.maxCount });
|
||||||
|
if (log === undefined) return Messages.showFileNotUnderSourceControlWarningMessage('Unable to open history compare');
|
||||||
|
|
||||||
|
if (progressCancellation.token.isCancellationRequested) return undefined;
|
||||||
|
|
||||||
|
const pick = await FileHistoryQuickPick.show(this.git, log, gitUri, progressCancellation, { pickerOnly: true });
|
||||||
|
if (pick === undefined) return undefined;
|
||||||
|
|
||||||
|
if (pick instanceof CommandQuickPickItem) return pick.execute();
|
||||||
|
|
||||||
|
const compare = await this.git.getVersionedFile(gitUri.repoPath, gitUri.fsPath, pick.commit.sha);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
|
Uri.file(compare),
|
||||||
|
gitUri.fileUri(),
|
||||||
|
`${path.basename(gitUri.fsPath)} (${pick.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(gitUri.fsPath)}`,
|
||||||
|
args.showOptions);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffWithRevisionCommand', 'getVersionedFile');
|
||||||
|
return window.showErrorMessage(`Unable to open history compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
72
src/commands/diffWithWorking.ts
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
'use strict';
|
||||||
|
import { commands, Range, TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { BuiltInCommands, GlyphChars } from '../constants';
|
||||||
|
import { GitCommit, GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { Messages } from '../messages';
|
||||||
|
import * as path from 'path';
|
||||||
|
|
||||||
|
export interface DiffWithWorkingCommandArgs {
|
||||||
|
commit?: GitCommit;
|
||||||
|
line?: number;
|
||||||
|
showOptions?: TextDocumentShowOptions;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class DiffWithWorkingCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.DiffWithWorking);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: DiffWithWorkingCommandArgs = {}): Promise<any> {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
if (uri === undefined) return undefined;
|
||||||
|
|
||||||
|
args = { ...args };
|
||||||
|
if (args.line === undefined) {
|
||||||
|
args.line = editor === undefined ? 0 : editor.selection.active.line;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.commit === undefined || GitService.isUncommitted(args.commit.sha)) {
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
// If the sha is missing, just let the user know the file matches
|
||||||
|
if (gitUri.sha === undefined) return window.showInformationMessage(`File matches the working tree`);
|
||||||
|
|
||||||
|
try {
|
||||||
|
args.commit = await this.git.getLogCommit(gitUri.repoPath, gitUri.fsPath, gitUri.sha, { firstIfMissing: true });
|
||||||
|
if (args.commit === undefined) return Messages.showFileNotUnderSourceControlWarningMessage('Unable to open compare');
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffWithWorkingCommand', `getLogCommit(${gitUri.repoPath}, ${gitUri.fsPath}, ${gitUri.sha})`);
|
||||||
|
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
|
||||||
|
const workingFileName = await this.git.findWorkingFileName(gitUri.repoPath, gitUri.fsPath);
|
||||||
|
if (workingFileName === undefined) return undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const compare = await this.git.getVersionedFile(args.commit.repoPath, args.commit.uri.fsPath, args.commit.sha);
|
||||||
|
|
||||||
|
if (args.line !== undefined && args.line !== 0) {
|
||||||
|
if (args.showOptions === undefined) {
|
||||||
|
args.showOptions = {};
|
||||||
|
}
|
||||||
|
args.showOptions.selection = new Range(args.line, 0, args.line, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
await commands.executeCommand(BuiltInCommands.Diff,
|
||||||
|
Uri.file(compare),
|
||||||
|
Uri.file(path.resolve(gitUri.repoPath, workingFileName)),
|
||||||
|
`${path.basename(args.commit.uri.fsPath)} (${args.commit.shortSha}) ${GlyphChars.ArrowLeftRight} ${path.basename(workingFileName)}`,
|
||||||
|
args.showOptions);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'DiffWithWorkingCommand', 'getVersionedFile');
|
||||||
|
return window.showErrorMessage(`Unable to open compare. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
58
src/commands/openBranchInRemote.ts
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Arrays } from '../system';
|
||||||
|
import { commands, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { GlyphChars } from '../constants';
|
||||||
|
import { GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { BranchesQuickPick, CommandQuickPickItem } from '../quickPicks';
|
||||||
|
import { OpenInRemoteCommandArgs } from './openInRemote';
|
||||||
|
|
||||||
|
export interface OpenBranchInRemoteCommandArgs {
|
||||||
|
branch?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class OpenBranchInRemoteCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.OpenBranchInRemote);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: OpenBranchInRemoteCommandArgs = {}) {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
|
||||||
|
const gitUri = uri && await GitUri.fromUri(uri, this.git);
|
||||||
|
|
||||||
|
const repoPath = gitUri === undefined ? this.git.repoPath : gitUri.repoPath;
|
||||||
|
if (!repoPath) return undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (args.branch === undefined) {
|
||||||
|
args = { ...args };
|
||||||
|
|
||||||
|
const branches = await this.git.getBranches(repoPath);
|
||||||
|
|
||||||
|
const pick = await BranchesQuickPick.show(branches, `Show history for branch${GlyphChars.Ellipsis}`);
|
||||||
|
if (pick === undefined) return undefined;
|
||||||
|
|
||||||
|
if (pick instanceof CommandQuickPickItem) return undefined;
|
||||||
|
|
||||||
|
args.branch = pick.branch.name;
|
||||||
|
if (args.branch === undefined) return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const remotes = Arrays.uniqueBy(await this.git.getRemotes(repoPath), _ => _.url, _ => !!_.provider);
|
||||||
|
return commands.executeCommand(Commands.OpenInRemote, uri, {
|
||||||
|
resource: {
|
||||||
|
type: 'branch',
|
||||||
|
branch: args.branch
|
||||||
|
},
|
||||||
|
remotes
|
||||||
|
} as OpenInRemoteCommandArgs);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'OpenBranchInRemoteCommandArgs');
|
||||||
|
return window.showErrorMessage(`Unable to open branch in remote provider. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
45
src/commands/openChangedFiles.ts
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
'use strict';
|
||||||
|
import { TextDocumentShowOptions, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri, openEditor } from './common';
|
||||||
|
import { GitService } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { Messages } from '../messages';
|
||||||
|
|
||||||
|
export interface OpenChangedFilesCommandArgs {
|
||||||
|
uris?: Uri[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export class OpenChangedFilesCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.OpenChangedFiles);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: OpenChangedFilesCommandArgs = {}) {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (args.uris === undefined) {
|
||||||
|
args = { ...args };
|
||||||
|
|
||||||
|
const repoPath = await this.git.getRepoPathFromUri(uri);
|
||||||
|
if (!repoPath) return Messages.showNoRepositoryWarningMessage(`Unable to open changed files`);
|
||||||
|
|
||||||
|
const status = await this.git.getStatusForRepo(repoPath);
|
||||||
|
if (status === undefined) return window.showWarningMessage(`Unable to open changed files`);
|
||||||
|
|
||||||
|
args.uris = status.files.filter(_ => _.status !== 'D').map(_ => _.Uri);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const uri of args.uris) {
|
||||||
|
await openEditor(uri, { preserveFocus: true, preview: false } as TextDocumentShowOptions);
|
||||||
|
}
|
||||||
|
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'OpenChangedFilesCommand');
|
||||||
|
return window.showErrorMessage(`Unable to open changed files. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
71
src/commands/openCommitInRemote.ts
Normal file
@@ -0,0 +1,71 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Arrays } from '../system';
|
||||||
|
import { commands, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, CommandContext, Commands, getCommandUri } from './common';
|
||||||
|
import { GitBlameCommit, GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { Messages } from '../messages';
|
||||||
|
import { OpenInRemoteCommandArgs } from './openInRemote';
|
||||||
|
import { CommitNode } from '../views/explorerNodes';
|
||||||
|
|
||||||
|
export interface OpenCommitInRemoteCommandArgs {
|
||||||
|
sha?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class OpenCommitInRemoteCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.OpenCommitInRemote);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected async preExecute(context: CommandContext, args: OpenCommitInRemoteCommandArgs = {}): Promise<any> {
|
||||||
|
if (context.type === 'view' && context.node instanceof CommitNode) {
|
||||||
|
args = { ...args };
|
||||||
|
args.sha = context.node.commit.sha;
|
||||||
|
return this.execute(context.editor, context.node.commit.uri, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.execute(context.editor, context.uri, args);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri, args: OpenCommitInRemoteCommandArgs = {}) {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
if (uri === undefined) return undefined;
|
||||||
|
if (editor !== undefined && editor.document !== undefined && editor.document.isDirty) return undefined;
|
||||||
|
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
if (!gitUri.repoPath) return undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (args.sha === undefined) {
|
||||||
|
const line = editor === undefined ? gitUri.offset : editor.selection.active.line;
|
||||||
|
const blameline = line - gitUri.offset;
|
||||||
|
if (blameline < 0) return undefined;
|
||||||
|
|
||||||
|
const blame = await this.git.getBlameForLine(gitUri, blameline);
|
||||||
|
if (blame === undefined) return Messages.showFileNotUnderSourceControlWarningMessage('Unable to open commit in remote provider');
|
||||||
|
|
||||||
|
let commit = blame.commit;
|
||||||
|
// If the line is uncommitted, find the previous commit
|
||||||
|
if (commit.isUncommitted) {
|
||||||
|
commit = new GitBlameCommit(commit.repoPath, commit.previousSha!, commit.previousFileName!, commit.author, commit.date, commit.message, []);
|
||||||
|
}
|
||||||
|
|
||||||
|
args.sha = commit.sha;
|
||||||
|
}
|
||||||
|
|
||||||
|
const remotes = Arrays.uniqueBy(await this.git.getRemotes(gitUri.repoPath), _ => _.url, _ => !!_.provider);
|
||||||
|
return commands.executeCommand(Commands.OpenInRemote, uri, {
|
||||||
|
resource: {
|
||||||
|
type: 'commit',
|
||||||
|
sha: args.sha
|
||||||
|
},
|
||||||
|
remotes
|
||||||
|
} as OpenInRemoteCommandArgs);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'OpenCommitInRemoteCommand');
|
||||||
|
return window.showErrorMessage(`Unable to open commit in remote provider. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
44
src/commands/openFileInRemote.ts
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Arrays } from '../system';
|
||||||
|
import { commands, Range, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { OpenInRemoteCommandArgs } from './openInRemote';
|
||||||
|
|
||||||
|
export class OpenFileInRemoteCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.OpenFileInRemote);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri) {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
if (uri === undefined) return undefined;
|
||||||
|
|
||||||
|
const gitUri = await GitUri.fromUri(uri, this.git);
|
||||||
|
if (!gitUri.repoPath) return undefined;
|
||||||
|
|
||||||
|
const branch = await this.git.getBranch(gitUri.repoPath);
|
||||||
|
|
||||||
|
try {
|
||||||
|
const remotes = Arrays.uniqueBy(await this.git.getRemotes(gitUri.repoPath), _ => _.url, _ => !!_.provider);
|
||||||
|
const range = editor === undefined ? undefined : new Range(editor.selection.start.with({ line: editor.selection.start.line + 1 }), editor.selection.end.with({ line: editor.selection.end.line + 1 }));
|
||||||
|
|
||||||
|
return commands.executeCommand(Commands.OpenInRemote, uri, {
|
||||||
|
resource: {
|
||||||
|
type: 'file',
|
||||||
|
branch: branch === undefined ? 'Current' : branch.name,
|
||||||
|
fileName: gitUri.getRelativePath(),
|
||||||
|
range: range,
|
||||||
|
sha: gitUri.sha
|
||||||
|
},
|
||||||
|
remotes
|
||||||
|
} as OpenInRemoteCommandArgs);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'OpenFileInRemoteCommand');
|
||||||
|
return window.showErrorMessage(`Unable to open file in remote provider. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
96
src/commands/openInRemote.ts
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Strings } from '../system';
|
||||||
|
import { TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { GlyphChars } from '../constants';
|
||||||
|
import { GitLogCommit, GitRemote, RemoteResource } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { CommandQuickPickItem, OpenRemoteCommandQuickPickItem, RemotesQuickPick } from '../quickPicks';
|
||||||
|
|
||||||
|
export interface OpenInRemoteCommandArgs {
|
||||||
|
remotes?: GitRemote[];
|
||||||
|
resource?: RemoteResource;
|
||||||
|
|
||||||
|
goBackCommand?: CommandQuickPickItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class OpenInRemoteCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor() {
|
||||||
|
super(Commands.OpenInRemote);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor: TextEditor, uri?: Uri, args: OpenInRemoteCommandArgs = {}) {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
|
||||||
|
args = { ...args };
|
||||||
|
if (args.remotes === undefined || args.resource === undefined) return undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
if (args.remotes.length === 1) {
|
||||||
|
const command = new OpenRemoteCommandQuickPickItem(args.remotes[0], args.resource);
|
||||||
|
return command.execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
let placeHolder = '';
|
||||||
|
switch (args.resource.type) {
|
||||||
|
case 'branch':
|
||||||
|
// Check to see if the remote is in the branch
|
||||||
|
const index = args.resource.branch.indexOf('/');
|
||||||
|
if (index >= 0) {
|
||||||
|
const remoteName = args.resource.branch.substring(0, index);
|
||||||
|
const remote = args.remotes.find(r => r.name === remoteName);
|
||||||
|
if (remote !== undefined) {
|
||||||
|
args.resource.branch = args.resource.branch.substring(index + 1);
|
||||||
|
args.remotes = [remote];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
placeHolder = `open ${args.resource.branch} branch in${GlyphChars.Ellipsis}`;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'commit':
|
||||||
|
const shortSha = args.resource.sha.substring(0, 8);
|
||||||
|
placeHolder = `open commit ${shortSha} in${GlyphChars.Ellipsis}`;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'file':
|
||||||
|
if (args.resource.commit !== undefined && args.resource.commit instanceof GitLogCommit) {
|
||||||
|
if (args.resource.commit.status === 'D') {
|
||||||
|
args.resource.sha = args.resource.commit.previousSha;
|
||||||
|
placeHolder = `open ${args.resource.fileName} ${Strings.pad(GlyphChars.Dot, 1, 1)} ${args.resource.commit.previousShortSha} in${GlyphChars.Ellipsis}`;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
args.resource.sha = args.resource.commit.sha;
|
||||||
|
placeHolder = `open ${args.resource.fileName} ${Strings.pad(GlyphChars.Dot, 1, 1)} ${args.resource.commit.shortSha} in${GlyphChars.Ellipsis}`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const shortFileSha = args.resource.sha === undefined ? '' : args.resource.sha.substring(0, 8);
|
||||||
|
const shaSuffix = shortFileSha ? ` ${Strings.pad(GlyphChars.Dot, 1, 1)} ${shortFileSha}` : '';
|
||||||
|
|
||||||
|
placeHolder = `open ${args.resource.fileName}${shaSuffix} in${GlyphChars.Ellipsis}`;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'working-file':
|
||||||
|
placeHolder = `open ${args.resource.fileName} in${GlyphChars.Ellipsis}`;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.remotes.length === 1) {
|
||||||
|
const command = new OpenRemoteCommandQuickPickItem(args.remotes[0], args.resource);
|
||||||
|
return command.execute();
|
||||||
|
}
|
||||||
|
|
||||||
|
const pick = await RemotesQuickPick.show(args.remotes, placeHolder, args.resource, args.goBackCommand);
|
||||||
|
if (pick === undefined) return undefined;
|
||||||
|
|
||||||
|
return pick.execute();
|
||||||
|
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'OpenInRemoteCommand');
|
||||||
|
return window.showErrorMessage(`Unable to open in remote provider. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
37
src/commands/openRepoInRemote.ts
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Arrays } from '../system';
|
||||||
|
import { commands, TextEditor, Uri, window } from 'vscode';
|
||||||
|
import { ActiveEditorCommand, Commands, getCommandUri } from './common';
|
||||||
|
import { GitService, GitUri } from '../gitService';
|
||||||
|
import { Logger } from '../logger';
|
||||||
|
import { OpenInRemoteCommandArgs } from './openInRemote';
|
||||||
|
|
||||||
|
export class OpenRepoInRemoteCommand extends ActiveEditorCommand {
|
||||||
|
|
||||||
|
constructor(private git: GitService) {
|
||||||
|
super(Commands.OpenRepoInRemote);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute(editor?: TextEditor, uri?: Uri) {
|
||||||
|
uri = getCommandUri(uri, editor);
|
||||||
|
|
||||||
|
const gitUri = uri && await GitUri.fromUri(uri, this.git);
|
||||||
|
|
||||||
|
const repoPath = gitUri === undefined ? this.git.repoPath : gitUri.repoPath;
|
||||||
|
if (!repoPath) return undefined;
|
||||||
|
|
||||||
|
try {
|
||||||
|
const remotes = Arrays.uniqueBy(await this.git.getRemotes(repoPath), _ => _.url, _ => !!_.provider);
|
||||||
|
return commands.executeCommand(Commands.OpenInRemote, uri, {
|
||||||
|
resource: {
|
||||||
|
type: 'repo'
|
||||||
|
},
|
||||||
|
remotes
|
||||||
|
} as OpenInRemoteCommandArgs);
|
||||||
|
}
|
||||||
|
catch (ex) {
|
||||||
|
Logger.error(ex, 'OpenRepoInRemoteCommand');
|
||||||
|
return window.showErrorMessage(`Unable to open repository in remote provider. See output channel for more details`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/commands/resetSuppressedWarnings.ts
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
'use strict';
|
||||||
|
import { Objects } from '../system';
|
||||||
|
import { ExtensionContext } from 'vscode';
|
||||||
|
import { Command, Commands } from './common';
|
||||||
|
import { SuppressedKeys } from '../messages';
|
||||||
|
|
||||||
|
export class ResetSuppressedWarningsCommand extends Command {
|
||||||
|
|
||||||
|
constructor(private context: ExtensionContext) {
|
||||||
|
super(Commands.ResetSuppressedWarnings);
|
||||||
|
}
|
||||||
|
|
||||||
|
async execute() {
|
||||||
|
for (const key of Objects.values<string>(SuppressedKeys)) {
|
||||||
|
await this.context.globalState.update(key, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||