Skip to content

Commit b9f07f1

Browse files
authored
Adds color descriptions. (microsoft#236741)
1 parent 83c336d commit b9f07f1

File tree

4 files changed

+47
-24
lines changed

4 files changed

+47
-24
lines changed

src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/gutterIndicatorView.ts

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,39 @@ import { OffsetRange } from '../../../../../common/core/offsetRange.js';
1717
import { StickyScrollController } from '../../../../stickyScroll/browser/stickyScrollController.js';
1818
import { InlineCompletionsModel } from '../../model/inlineCompletionsModel.js';
1919
import { mapOutFalsy, n, rectToProps } from './utils.js';
20+
import { localize } from '../../../../../../nls.js';
21+
export const inlineEditIndicatorPrimaryForeground = registerColor(
22+
'inlineEdit.gutterIndicator.primaryForeground',
23+
buttonForeground,
24+
localize('inlineEdit.gutterIndicator.primaryForeground', 'Foreground color for the primary inline edit gutter indicator.')
25+
);
26+
export const inlineEditIndicatorPrimaryBackground = registerColor(
27+
'inlineEdit.gutterIndicator.primaryBackground',
28+
buttonBackground,
29+
localize('inlineEdit.gutterIndicator.primaryBackground', 'Background color for the primary inline edit gutter indicator.')
30+
);
2031

21-
export const inlineEditIndicatorPrimaryForeground = registerColor('inlineEdit.gutterIndicator.primaryForeground', buttonForeground, 'Foreground color for the primary inline edit gutter indicator.');
22-
export const inlineEditIndicatorPrimaryBackground = registerColor('inlineEdit.gutterIndicator.primaryBackground', buttonBackground, 'Background color for the primary inline edit gutter indicator.');
23-
24-
export const inlineEditIndicatorSecondaryForeground = registerColor('inlineEdit.gutterIndicator.secondaryForeground', buttonSecondaryForeground, 'Foreground color for the secondary inline edit gutter indicator.');
25-
export const inlineEditIndicatorSecondaryBackground = registerColor('inlineEdit.gutterIndicator.secondaryBackground', buttonSecondaryBackground, 'Background color for the secondary inline edit gutter indicator.');
32+
export const inlineEditIndicatorSecondaryForeground = registerColor(
33+
'inlineEdit.gutterIndicator.secondaryForeground',
34+
buttonSecondaryForeground,
35+
localize('inlineEdit.gutterIndicator.secondaryForeground', 'Foreground color for the secondary inline edit gutter indicator.')
36+
);
37+
export const inlineEditIndicatorSecondaryBackground = registerColor(
38+
'inlineEdit.gutterIndicator.secondaryBackground',
39+
buttonSecondaryBackground,
40+
localize('inlineEdit.gutterIndicator.secondaryBackground', 'Background color for the secondary inline edit gutter indicator.')
41+
);
2642

27-
export const inlineEditIndicatorsuccessfulForeground = registerColor('inlineEdit.gutterIndicator.successfulForeground', buttonForeground, 'Foreground color for the successful inline edit gutter indicator.');
28-
export const inlineEditIndicatorsuccessfulBackground = registerColor('inlineEdit.gutterIndicator.successfulBackground', { light: '#2e825c', dark: '#2e825c', hcLight: '#2e825c', hcDark: '#2e825c' }, 'Background color for the successful inline edit gutter indicator.');
43+
export const inlineEditIndicatorsuccessfulForeground = registerColor(
44+
'inlineEdit.gutterIndicator.successfulForeground',
45+
buttonForeground,
46+
localize('inlineEdit.gutterIndicator.successfulForeground', 'Foreground color for the successful inline edit gutter indicator.')
47+
);
48+
export const inlineEditIndicatorsuccessfulBackground = registerColor(
49+
'inlineEdit.gutterIndicator.successfulBackground',
50+
{ light: '#2e825c', dark: '#2e825c', hcLight: '#2e825c', hcDark: '#2e825c' },
51+
localize('inlineEdit.gutterIndicator.successfulBackground', 'Background color for the successful inline edit gutter indicator.')
52+
);
2953

3054
export const inlineEditIndicatorBackground = registerColor(
3155
'inlineEdit.gutterIndicator.background',
@@ -35,7 +59,7 @@ export const inlineEditIndicatorBackground = registerColor(
3559
dark: transparent('tab.inactiveBackground', 0.5),
3660
light: '#5f5f5f18',
3761
},
38-
'Background color for the inline edit gutter indicator.'
62+
localize('inlineEdit.gutterIndicator.background', 'Background color for the inline edit gutter indicator.')
3963
);
4064

4165

src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/indicatorView.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,15 @@ import { registerColor } from '../../../../../../platform/theme/common/colorUtil
1313
import { ObservableCodeEditor } from '../../../../../browser/observableCodeEditor.js';
1414
import { OffsetRange } from '../../../../../common/core/offsetRange.js';
1515
import { InlineCompletionsModel } from '../../model/inlineCompletionsModel.js';
16+
import { localize } from '../../../../../../nls.js';
1617

1718
export interface IInlineEditsIndicatorState {
1819
editTop: number;
1920
showAlways: boolean;
2021
}
21-
22-
23-
export const inlineEditIndicatorForeground = registerColor('inlineEdit.indicator.foreground', buttonForeground, '');
24-
export const inlineEditIndicatorBackground = registerColor('inlineEdit.indicator.background', buttonBackground, '');
25-
export const inlineEditIndicatorBorder = registerColor('inlineEdit.indicator.border', buttonSeparator, '');
22+
export const inlineEditIndicatorForeground = registerColor('inlineEdit.indicator.foreground', buttonForeground, localize('inlineEdit.indicator.foreground', 'Foreground color for the inline edit indicator.'));
23+
export const inlineEditIndicatorBackground = registerColor('inlineEdit.indicator.background', buttonBackground, localize('inlineEdit.indicator.background', 'Background color for the inline edit indicator.'));
24+
export const inlineEditIndicatorBorder = registerColor('inlineEdit.indicator.border', buttonSeparator, localize('inlineEdit.indicator.border', 'Border color for the inline edit indicator.'));
2625

2726
export class InlineEditsIndicator extends Disposable {
2827
private readonly _indicator = h('div.inline-edits-view-indicator', {

src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/sideBySideDiff.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,48 +32,48 @@ import { InlineCompletionContextKeys } from '../../controller/inlineCompletionCo
3232
import { CustomizedMenuWorkbenchToolBar } from '../../hintsWidget/inlineCompletionsHintsWidget.js';
3333
import { PathBuilder, StatusBarViewItem, getOffsetForPos, mapOutFalsy, maxContentWidthInRange, n } from './utils.js';
3434
import { InlineEditWithChanges } from './viewAndDiffProducer.js';
35+
import { localize } from '../../../../../../nls.js';
3536

3637
export const originalBackgroundColor = registerColor(
3738
'inlineEdit.originalBackground',
3839
Color.transparent,
39-
'',
40+
localize('inlineEdit.originalBackground', 'Background color for the original text in inline edits.'),
4041
true
4142
);
4243
export const modifiedBackgroundColor = registerColor(
4344
'inlineEdit.modifiedBackground',
4445
Color.transparent,
45-
'',
46+
localize('inlineEdit.modifiedBackground', 'Background color for the modified text in inline edits.'),
4647
true
4748
);
4849

4950
export const originalChangedLineBackgroundColor = registerColor(
5051
'inlineEdit.originalChangedLineBackground',
5152
Color.transparent,
52-
'',
53+
localize('inlineEdit.originalChangedLineBackground', 'Background color for the changed lines in the original text of inline edits.'),
5354
true
5455
);
5556

5657
export const originalChangedTextOverlayColor = registerColor(
5758
'inlineEdit.originalChangedTextBackground',
5859
diffRemoved,
59-
'',
60+
localize('inlineEdit.originalChangedTextBackground', 'Overlay color for the changed text in the original text of inline edits.'),
6061
true
6162
);
6263

6364
export const modifiedChangedLineBackgroundColor = registerColor(
6465
'inlineEdit.modifiedChangedLineBackground',
6566
Color.transparent,
66-
'',
67+
localize('inlineEdit.modifiedChangedLineBackground', 'Background color for the changed lines in the modified text of inline edits.'),
6768
true
6869
);
6970

7071
export const modifiedChangedTextOverlayColor = registerColor(
7172
'inlineEdit.modifiedChangedTextBackground',
7273
diffInserted,
73-
'',
74+
localize('inlineEdit.modifiedChangedTextBackground', 'Overlay color for the changed text in the modified text of inline edits.'),
7475
true
7576
);
76-
7777
export const originalBorder = registerColor(
7878
'inlineEdit.originalBorder',
7979
{
@@ -82,7 +82,7 @@ export const originalBorder = registerColor(
8282
hcDark: editorLineHighlightBorder,
8383
hcLight: editorLineHighlightBorder
8484
},
85-
''
85+
localize('inlineEdit.originalBorder', 'Border color for the original text in inline edits.')
8686
);
8787

8888
export const modifiedBorder = registerColor(
@@ -93,7 +93,7 @@ export const modifiedBorder = registerColor(
9393
hcDark: editorLineHighlightBorder,
9494
hcLight: editorLineHighlightBorder
9595
},
96-
''
96+
localize('inlineEdit.modifiedBorder', 'Border color for the modified text in inline edits.')
9797
);
9898

9999
export class InlineEditsSideBySideDiff extends Disposable {

src/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/wordReplacementView.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { ILanguageService } from '../../../../../common/languages/language.js';
1919
import { LineTokens } from '../../../../../common/tokens/lineTokens.js';
2020
import { TokenArray } from '../../../../../common/tokens/tokenArray.js';
2121
import { mapOutFalsy, n, rectToProps } from './utils.js';
22-
22+
import { localize } from '../../../../../../nls.js';
2323
export const transparentHoverBackground = registerColor(
2424
'inlineEdit.wordReplacementView.background',
2525
{
@@ -28,7 +28,7 @@ export const transparentHoverBackground = registerColor(
2828
hcLight: transparent(editorHoverStatusBarBackground, 0.1),
2929
hcDark: transparent(editorHoverStatusBarBackground, 0.1),
3030
},
31-
'Background color for the inline edit word replacement view.'
31+
localize('inlineEdit.wordReplacementView.background', 'Background color for the inline edit word replacement view.')
3232
);
3333

3434
export class WordReplacementView extends Disposable {

0 commit comments

Comments
 (0)