Git - add author email to the blame/graph hover (#237360)
parent
3b92e71162
commit
abe43ed1d5
|
@ -227,7 +227,12 @@ export class GitBlameController {
|
|||
markdownString.supportThemeIcons = true;
|
||||
|
||||
if (blameInformationOrCommit.authorName) {
|
||||
markdownString.appendMarkdown(`$(account) **${blameInformationOrCommit.authorName}**`);
|
||||
if (blameInformationOrCommit.authorEmail) {
|
||||
const emailTitle = l10n.t('Email');
|
||||
markdownString.appendMarkdown(`$(account) [**${blameInformationOrCommit.authorName}**](mailto:${blameInformationOrCommit.authorEmail} "${emailTitle} ${blameInformationOrCommit.authorName}")`);
|
||||
} else {
|
||||
markdownString.appendMarkdown(`$(account) **${blameInformationOrCommit.authorName}**`);
|
||||
}
|
||||
|
||||
if (blameInformationOrCommit.authorDate) {
|
||||
const dateString = new Date(blameInformationOrCommit.authorDate).toLocaleString(undefined, { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' });
|
||||
|
|
|
@ -260,6 +260,7 @@ export class GitHistoryProvider implements SourceControlHistoryProvider, FileDec
|
|||
parentIds: commit.parents,
|
||||
message: emojify(commit.message),
|
||||
author: commit.authorName,
|
||||
authorEmail: commit.authorEmail,
|
||||
icon: new ThemeIcon('git-commit'),
|
||||
displayId: getCommitShortHash(Uri.file(this.repository.root), commit.hash),
|
||||
timestamp: commit.authorDate?.getTime(),
|
||||
|
|
|
@ -1606,6 +1606,7 @@ export interface SCMHistoryItemDto {
|
|||
readonly message: string;
|
||||
readonly displayId?: string;
|
||||
readonly author?: string;
|
||||
readonly authorEmail?: string;
|
||||
readonly timestamp?: number;
|
||||
readonly statistics?: {
|
||||
readonly files: number;
|
||||
|
|
|
@ -459,10 +459,14 @@ class HistoryItemRenderer implements ITreeRenderer<SCMHistoryItemViewModelTreeEl
|
|||
const historyItem = element.historyItemViewModel.historyItem;
|
||||
|
||||
const markdown = new MarkdownString('', { isTrusted: true, supportThemeIcons: true });
|
||||
// markdown.appendMarkdown(`$(git-commit) \`${historyItem.displayId ?? historyItem.id}\`\n\n`);
|
||||
|
||||
if (historyItem.author) {
|
||||
markdown.appendMarkdown(`$(account) **${historyItem.author}**`);
|
||||
if (historyItem.authorEmail) {
|
||||
const emailTitle = localize('emailLinkTitle', "Email");
|
||||
markdown.appendMarkdown(`$(account) [**${historyItem.author}**](mailto:${historyItem.authorEmail} "${emailTitle} ${historyItem.author}")`);
|
||||
} else {
|
||||
markdown.appendMarkdown(`$(account) **${historyItem.author}**`);
|
||||
}
|
||||
|
||||
if (historyItem.timestamp) {
|
||||
const dateFormatter = safeIntl.DateTimeFormat(platform.language, { year: 'numeric', month: 'long', day: 'numeric', hour: 'numeric', minute: 'numeric' });
|
||||
|
|
|
@ -63,6 +63,7 @@ export interface ISCMHistoryItem {
|
|||
readonly message: string;
|
||||
readonly displayId?: string;
|
||||
readonly author?: string;
|
||||
readonly authorEmail?: string;
|
||||
readonly timestamp?: number;
|
||||
readonly statistics?: ISCMHistoryItemStatistics;
|
||||
readonly references?: ISCMHistoryItemRef[];
|
||||
|
|
|
@ -51,6 +51,7 @@ declare module 'vscode' {
|
|||
readonly message: string;
|
||||
readonly displayId?: string;
|
||||
readonly author?: string;
|
||||
readonly authorEmail?: string;
|
||||
readonly timestamp?: number;
|
||||
readonly statistics?: SourceControlHistoryItemStatistics;
|
||||
readonly references?: SourceControlHistoryItemRef[];
|
||||
|
|
Loading…
Reference in New Issue