Fixes #162028 by improving merge editor tooltips

This commit is contained in:
Henning Dieterichs 2022-09-28 12:22:15 +02:00
parent 2df70ee366
commit 43d851d1b0
No known key found for this signature in database
GPG key ID: 771381EFFDB9EC06

View file

@ -113,7 +113,7 @@ export class ConflictActionsFactory extends Disposable {
tx
);
});
})
}, localize('acceptTooltip', "Accept {0} in the result document.", inputData.title))
: command(localize('remove', "Remove {0}", inputData.title), async () => {
transaction((tx) => {
model.setState(
@ -123,7 +123,7 @@ export class ConflictActionsFactory extends Disposable {
tx
);
});
}),
}, localize('removeTooltip', "Remove {0} from the result document.", inputData.title)),
);
if (modifiedBaseRange.canBeCombined && state.isEmpty) {
@ -138,7 +138,7 @@ export class ConflictActionsFactory extends Disposable {
tx
);
});
})
}, localize('removeBothTooltip', "Remove both changes from the result document."))
: command(localize('acceptBoth', "Accept Both"), async () => {
transaction((tx) => {
model.setState(
@ -150,7 +150,7 @@ export class ConflictActionsFactory extends Disposable {
tx
);
});
}, localize('acceptBothTooltip', "Both changes can be combined automatically")),
}, localize('acceptBothTooltip', "Accept an automatic combination of both sides in the result document.")),
);
}
}
@ -161,10 +161,11 @@ export class ConflictActionsFactory extends Disposable {
createResultWidget(lineNumber: number, viewModel: MergeEditorViewModel, modifiedBaseRange: ModifiedBaseRange): IContentWidget {
function command(title: string, action: () => Promise<void>): IContentWidgetAction {
function command(title: string, action: () => Promise<void>, tooltip?: string): IContentWidgetAction {
return {
text: title,
action
action,
tooltip
};
}
@ -178,12 +179,15 @@ export class ConflictActionsFactory extends Disposable {
if (state.conflicting) {
result.push({
text: localize('manualResolution', "Manual Resolution"),
tooltip: localize('manualResolutionTooltip', "This conflict has been resolved manually"),
tooltip: localize('manualResolutionTooltip', "This conflict has been resolved manually."),
});
} else if (state.isEmpty) {
result.push({
text: localize('noChangesAccepted', 'No Changes Accepted'),
tooltip: localize('noChangesAcceptedTooltip', "The current resolution of this conflict equals the common ancestor of both the right and left changes."),
tooltip: localize(
'noChangesAcceptedTooltip',
'The current resolution of this conflict equals the common ancestor of both the right and left changes.'
),
});
} else {
@ -213,7 +217,7 @@ export class ConflictActionsFactory extends Disposable {
tx
);
});
}),
}, localize('removeTooltip', "Remove {0} from the result document.", model.input1.title)),
);
}
if (state.input2) {
@ -226,7 +230,7 @@ export class ConflictActionsFactory extends Disposable {
tx
);
});
}),
}, localize('removeTooltip', "Remove {0} from the result document.", model.input2.title)),
);
}
if (state.input2First) {
@ -247,7 +251,7 @@ export class ConflictActionsFactory extends Disposable {
tx
);
});
})
}, localize('resetToBaseTooltip', "Reset this conflict to the common ancestor of both the right and left changes.")),
);
}
return result;