Skip to content

Commit 2135a9d

Browse files
authored
Merge pull request microsoft#162356 from microsoft/hediet/motionless-lizard
Fixes microsoft#162028 by improving merge editor tooltips
2 parents 9bc43c7 + 43d851d commit 2135a9d

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

src/vs/workbench/contrib/mergeEditor/browser/view/conflictActions.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class ConflictActionsFactory extends Disposable {
117117
tx
118118
);
119119
});
120-
})
120+
}, localize('acceptTooltip', "Accept {0} in the result document.", inputData.title))
121121
: command(localize('remove', "Remove {0}", inputData.title), async () => {
122122
transaction((tx) => {
123123
model.setState(
@@ -127,7 +127,7 @@ export class ConflictActionsFactory extends Disposable {
127127
tx
128128
);
129129
});
130-
}),
130+
}, localize('removeTooltip', "Remove {0} from the result document.", inputData.title)),
131131
);
132132

133133
if (modifiedBaseRange.canBeCombined && state.isEmpty) {
@@ -142,7 +142,7 @@ export class ConflictActionsFactory extends Disposable {
142142
tx
143143
);
144144
});
145-
})
145+
}, localize('removeBothTooltip', "Remove both changes from the result document."))
146146
: command(localize('acceptBoth', "Accept Both"), async () => {
147147
transaction((tx) => {
148148
model.setState(
@@ -154,7 +154,7 @@ export class ConflictActionsFactory extends Disposable {
154154
tx
155155
);
156156
});
157-
}, localize('acceptBothTooltip', "Both changes can be combined automatically")),
157+
}, localize('acceptBothTooltip', "Accept an automatic combination of both sides in the result document.")),
158158
);
159159
}
160160
}
@@ -165,10 +165,11 @@ export class ConflictActionsFactory extends Disposable {
165165

166166
createResultWidget(lineNumber: number, viewModel: MergeEditorViewModel, modifiedBaseRange: ModifiedBaseRange): IContentWidget {
167167

168-
function command(title: string, action: () => Promise<void>): IContentWidgetAction {
168+
function command(title: string, action: () => Promise<void>, tooltip?: string): IContentWidgetAction {
169169
return {
170170
text: title,
171-
action
171+
action,
172+
tooltip
172173
};
173174
}
174175

@@ -182,12 +183,15 @@ export class ConflictActionsFactory extends Disposable {
182183
if (state.conflicting) {
183184
result.push({
184185
text: localize('manualResolution', "Manual Resolution"),
185-
tooltip: localize('manualResolutionTooltip', "This conflict has been resolved manually"),
186+
tooltip: localize('manualResolutionTooltip', "This conflict has been resolved manually."),
186187
});
187188
} else if (state.isEmpty) {
188189
result.push({
189190
text: localize('noChangesAccepted', 'No Changes Accepted'),
190-
tooltip: localize('noChangesAcceptedTooltip', "The current resolution of this conflict equals the common ancestor of both the right and left changes."),
191+
tooltip: localize(
192+
'noChangesAcceptedTooltip',
193+
'The current resolution of this conflict equals the common ancestor of both the right and left changes.'
194+
),
191195
});
192196

193197
} else {
@@ -217,7 +221,7 @@ export class ConflictActionsFactory extends Disposable {
217221
tx
218222
);
219223
});
220-
}),
224+
}, localize('removeTooltip', "Remove {0} from the result document.", model.input1.title)),
221225
);
222226
}
223227
if (state.input2) {
@@ -230,7 +234,7 @@ export class ConflictActionsFactory extends Disposable {
230234
tx
231235
);
232236
});
233-
}),
237+
}, localize('removeTooltip', "Remove {0} from the result document.", model.input2.title)),
234238
);
235239
}
236240
if (state.input2First) {
@@ -251,7 +255,7 @@ export class ConflictActionsFactory extends Disposable {
251255
tx
252256
);
253257
});
254-
})
258+
}, localize('resetToBaseTooltip', "Reset this conflict to the common ancestor of both the right and left changes.")),
255259
);
256260
}
257261
return result;

0 commit comments

Comments
 (0)