Skip to content

Commit 43d851d

Browse files
committed
Fixes microsoft#162028 by improving merge editor tooltips
1 parent 2df70ee commit 43d851d

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
@@ -113,7 +113,7 @@ export class ConflictActionsFactory extends Disposable {
113113
tx
114114
);
115115
});
116-
})
116+
}, localize('acceptTooltip', "Accept {0} in the result document.", inputData.title))
117117
: command(localize('remove', "Remove {0}", inputData.title), async () => {
118118
transaction((tx) => {
119119
model.setState(
@@ -123,7 +123,7 @@ export class ConflictActionsFactory extends Disposable {
123123
tx
124124
);
125125
});
126-
}),
126+
}, localize('removeTooltip', "Remove {0} from the result document.", inputData.title)),
127127
);
128128

129129
if (modifiedBaseRange.canBeCombined && state.isEmpty) {
@@ -138,7 +138,7 @@ export class ConflictActionsFactory extends Disposable {
138138
tx
139139
);
140140
});
141-
})
141+
}, localize('removeBothTooltip', "Remove both changes from the result document."))
142142
: command(localize('acceptBoth', "Accept Both"), async () => {
143143
transaction((tx) => {
144144
model.setState(
@@ -150,7 +150,7 @@ export class ConflictActionsFactory extends Disposable {
150150
tx
151151
);
152152
});
153-
}, localize('acceptBothTooltip', "Both changes can be combined automatically")),
153+
}, localize('acceptBothTooltip', "Accept an automatic combination of both sides in the result document.")),
154154
);
155155
}
156156
}
@@ -161,10 +161,11 @@ export class ConflictActionsFactory extends Disposable {
161161

162162
createResultWidget(lineNumber: number, viewModel: MergeEditorViewModel, modifiedBaseRange: ModifiedBaseRange): IContentWidget {
163163

164-
function command(title: string, action: () => Promise<void>): IContentWidgetAction {
164+
function command(title: string, action: () => Promise<void>, tooltip?: string): IContentWidgetAction {
165165
return {
166166
text: title,
167-
action
167+
action,
168+
tooltip
168169
};
169170
}
170171

@@ -178,12 +179,15 @@ export class ConflictActionsFactory extends Disposable {
178179
if (state.conflicting) {
179180
result.push({
180181
text: localize('manualResolution', "Manual Resolution"),
181-
tooltip: localize('manualResolutionTooltip', "This conflict has been resolved manually"),
182+
tooltip: localize('manualResolutionTooltip', "This conflict has been resolved manually."),
182183
});
183184
} else if (state.isEmpty) {
184185
result.push({
185186
text: localize('noChangesAccepted', 'No Changes Accepted'),
186-
tooltip: localize('noChangesAcceptedTooltip', "The current resolution of this conflict equals the common ancestor of both the right and left changes."),
187+
tooltip: localize(
188+
'noChangesAcceptedTooltip',
189+
'The current resolution of this conflict equals the common ancestor of both the right and left changes.'
190+
),
187191
});
188192

189193
} else {
@@ -213,7 +217,7 @@ export class ConflictActionsFactory extends Disposable {
213217
tx
214218
);
215219
});
216-
}),
220+
}, localize('removeTooltip', "Remove {0} from the result document.", model.input1.title)),
217221
);
218222
}
219223
if (state.input2) {
@@ -226,7 +230,7 @@ export class ConflictActionsFactory extends Disposable {
226230
tx
227231
);
228232
});
229-
}),
233+
}, localize('removeTooltip', "Remove {0} from the result document.", model.input2.title)),
230234
);
231235
}
232236
if (state.input2First) {
@@ -247,7 +251,7 @@ export class ConflictActionsFactory extends Disposable {
247251
tx
248252
);
249253
});
250-
})
254+
}, localize('resetToBaseTooltip', "Reset this conflict to the common ancestor of both the right and left changes.")),
251255
);
252256
}
253257
return result;

0 commit comments

Comments
 (0)