Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/editor/browser/widget/diffEditor/registrations.contribution.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { Codicon } from '../../../../base/common/codicons.js';
7
import { ThemeIcon } from '../../../../base/common/themables.js';
8
import { ModelDecorationOptions } from '../../../common/model/textModel.js';
9
import { localize } from '../../../../nls.js';
10
import { registerColor } from '../../../../platform/theme/common/colorRegistry.js';
11
import { registerIcon } from '../../../../platform/theme/common/iconRegistry.js';
12
13
export const diffMoveBorder = registerColor(
14
'diffEditor.move.border',
15
'#8b8b8b9c',
16
localize('diffEditor.move.border', 'The border color for text that got moved in the diff editor.')
17
);
18
19
export const diffMoveBorderActive = registerColor(
20
'diffEditor.moveActive.border',
21
'#FFA500',
22
localize('diffEditor.moveActive.border', 'The active border color for text that got moved in the diff editor.')
23
);
24
25
export const diffEditorUnchangedRegionShadow = registerColor(
26
'diffEditor.unchangedRegionShadow',
27
{ dark: '#000000', light: '#737373BF', hcDark: '#000000', hcLight: '#737373BF', },
28
localize('diffEditor.unchangedRegionShadow', 'The color of the shadow around unchanged region widgets.')
29
);
30
31
export const diffInsertIcon = registerIcon('diff-insert', Codicon.add, localize('diffInsertIcon', 'Line decoration for inserts in the diff editor.'));
32
export const diffRemoveIcon = registerIcon('diff-remove', Codicon.remove, localize('diffRemoveIcon', 'Line decoration for removals in the diff editor.'));
33
34
export const diffLineAddDecorationBackgroundWithIndicator = ModelDecorationOptions.register({
35
className: 'line-insert',
36
description: 'line-insert',
37
isWholeLine: true,
38
linesDecorationsClassName: 'insert-sign ' + ThemeIcon.asClassName(diffInsertIcon),
39
marginClassName: 'gutter-insert',
40
});
41
42
export const diffLineDeleteDecorationBackgroundWithIndicator = ModelDecorationOptions.register({
43
className: 'line-delete',
44
description: 'line-delete',
45
isWholeLine: true,
46
linesDecorationsClassName: 'delete-sign ' + ThemeIcon.asClassName(diffRemoveIcon),
47
marginClassName: 'gutter-delete',
48
});
49
50
export const diffLineAddDecorationBackground = ModelDecorationOptions.register({
51
className: 'line-insert',
52
description: 'line-insert',
53
isWholeLine: true,
54
marginClassName: 'gutter-insert',
55
});
56
57
export const diffLineDeleteDecorationBackground = ModelDecorationOptions.register({
58
className: 'line-delete',
59
description: 'line-delete',
60
isWholeLine: true,
61
marginClassName: 'gutter-delete',
62
});
63
64
export const diffAddDecoration = ModelDecorationOptions.register({
65
className: 'char-insert',
66
description: 'char-insert',
67
shouldFillLineOnLineBreak: true,
68
});
69
70
export const diffWholeLineAddDecoration = ModelDecorationOptions.register({
71
className: 'char-insert',
72
description: 'char-insert',
73
isWholeLine: true,
74
});
75
76
export const diffAddDecorationEmpty = ModelDecorationOptions.register({
77
className: 'char-insert diff-range-empty',
78
description: 'char-insert diff-range-empty',
79
});
80
81
export const diffDeleteDecoration = ModelDecorationOptions.register({
82
className: 'char-delete',
83
description: 'char-delete',
84
shouldFillLineOnLineBreak: true,
85
});
86
87
export const diffWholeLineDeleteDecoration = ModelDecorationOptions.register({
88
className: 'char-delete',
89
description: 'char-delete',
90
isWholeLine: true,
91
});
92
93
export const diffDeleteDecorationEmpty = ModelDecorationOptions.register({
94
className: 'char-delete diff-range-empty',
95
description: 'char-delete diff-range-empty',
96
});
97
98