@@ -20,29 +20,64 @@ export class ElectronFileDecorationProvider
20
20
) {
21
21
const { isPatch, blobIdA, blobIdB, status } = querystringParse ( uri . query ) ;
22
22
23
- // TBD - Should color be used here? It's a bit much if everything has color
24
23
if ( blobIdA && blobIdB ) {
25
24
if ( / ^ [ 0 ] + $ / . test ( blobIdA ) ) {
26
25
// All zeroes for blobIdA indicates it is a new file
27
- return new vscode . FileDecoration ( "A" , "Added" ) ;
26
+ return new vscode . FileDecoration (
27
+ "A" ,
28
+ "Added" ,
29
+ new vscode . ThemeColor ( "gitDecoration.addedResourceForeground" ) ,
30
+ ) ;
28
31
} else if ( / ^ [ 0 ] + $ / . test ( blobIdB ) ) {
29
32
// All zeroes for blobIdB indicates it is a deleted file
30
- return new vscode . FileDecoration ( "D" , "Deleted" ) ;
33
+ return new vscode . FileDecoration (
34
+ "D" ,
35
+ "Deleted" ,
36
+ new vscode . ThemeColor ( "gitDecoration.deletedResourceForeground" ) ,
37
+ ) ;
31
38
} else {
32
- return new vscode . FileDecoration ( "M" , "Modified" ) ;
39
+ return new vscode . FileDecoration (
40
+ "M" ,
41
+ "Modified" ,
42
+ new vscode . ThemeColor ( "gitDecoration.modifiedResourceForeground" ) ,
43
+ ) ;
33
44
}
34
45
} else if ( isPatch && status ) {
35
46
switch ( status as PullRequestFileStatus ) {
36
47
case "added" :
48
+ return new vscode . FileDecoration (
49
+ "A" ,
50
+ "Added" ,
51
+ new vscode . ThemeColor ( "gitDecoration.addedResourceForeground" ) ,
52
+ ) ;
53
+
37
54
case "copied" :
38
- return new vscode . FileDecoration ( "A" , "Added" ) ;
55
+ return new vscode . FileDecoration (
56
+ "C" ,
57
+ "Copied" ,
58
+ new vscode . ThemeColor ( "gitDecoration.renamedResourceForeground" ) ,
59
+ ) ;
39
60
40
61
case "modified" :
62
+ return new vscode . FileDecoration (
63
+ "M" ,
64
+ "Modified" ,
65
+ new vscode . ThemeColor ( "gitDecoration.modifiedResourceForeground" ) ,
66
+ ) ;
67
+
41
68
case "renamed" :
42
- return new vscode . FileDecoration ( "M" , "Modified" ) ;
69
+ return new vscode . FileDecoration (
70
+ "R" ,
71
+ "Renamed" ,
72
+ new vscode . ThemeColor ( "gitDecoration.renamedResourceForeground" ) ,
73
+ ) ;
43
74
44
75
case "removed" :
45
- return new vscode . FileDecoration ( "D" , "Deleted" ) ;
76
+ return new vscode . FileDecoration (
77
+ "D" ,
78
+ "Deleted" ,
79
+ new vscode . ThemeColor ( "gitDecoration.deletedResourceForeground" ) ,
80
+ ) ;
46
81
}
47
82
}
48
83
}
0 commit comments