浏览代码

Enables html support in hovers

main
Eric Amodio 3 年前
父节点
当前提交
9d0593dd11
共有 11 个文件被更改,包括 48 次插入7 次删除
  1. +3
    -0
      src/hovers/hovers.ts
  2. +3
    -0
      src/views/nodes/branchNode.ts
  3. +6
    -1
      src/views/nodes/branchTrackingStatusNode.ts
  4. +1
    -0
      src/views/nodes/commitNode.ts
  5. +4
    -1
      src/views/nodes/contributorNode.ts
  6. +1
    -0
      src/views/nodes/fileRevisionAsCommitNode.ts
  7. +6
    -1
      src/views/nodes/mergeConflictCurrentChangesNode.ts
  8. +6
    -1
      src/views/nodes/mergeConflictIncomingChangesNode.ts
  9. +6
    -1
      src/views/nodes/mergeStatusNode.ts
  10. +6
    -1
      src/views/nodes/rebaseStatusNode.ts
  11. +6
    -1
      src/views/nodes/repositoryNode.ts

+ 3
- 0
src/hovers/hovers.ts 查看文件

@ -129,6 +129,7 @@ export namespace Hovers {
message = `${diff}\n---\n\nChanges  ${previous}  ${GlyphChars.ArrowLeftRightLong}  ${current}   |   ${message}`;
const markdown = new MarkdownString(message, true);
markdown.supportHtml = true;
markdown.isTrusted = true;
return markdown;
}
@ -174,6 +175,7 @@ export namespace Hovers {
}  ${current}${message == null ? '' : `   |   ${message}`}`;
const markdown = new MarkdownString(message, true);
markdown.supportHtml = true;
markdown.isTrusted = true;
return markdown;
}
@ -238,6 +240,7 @@ export namespace Hovers {
});
const markdown = new MarkdownString(details, true);
markdown.supportHtml = true;
markdown.isTrusted = true;
return markdown;
}

+ 3
- 0
src/views/nodes/branchNode.ts 查看文件

@ -389,6 +389,9 @@ export class BranchNode
}
tooltip = new MarkdownString(tooltip, true);
tooltip.supportHtml = true;
tooltip.isTrusted = true;
if (this.branch.starred) {
tooltip.appendMarkdown('\\\n$(star-full) Favorited');
}

+ 6
- 1
src/views/nodes/branchTrackingStatusNode.ts 查看文件

@ -256,7 +256,12 @@ export class BranchTrackingStatusNode extends ViewNode impleme
tooltip += `\n\nLast fetched ${Dates.getFormatter(new Date(lastFetched)).fromNow()}`;
}
item.iconPath = icon;
item.tooltip = new MarkdownString(tooltip, true);
const markdown = new MarkdownString(tooltip, true);
markdown.supportHtml = true;
markdown.isTrusted = true;
item.tooltip = markdown;
return item;
}

+ 1
- 0
src/views/nodes/commitNode.ts 查看文件

@ -167,6 +167,7 @@ export class CommitNode extends ViewRefNode
);
const markdown = new MarkdownString(tooltip, true);
markdown.supportHtml = true;
markdown.isTrusted = true;
return markdown;

+ 4
- 1
src/views/nodes/contributorNode.ts 查看文件

@ -120,7 +120,7 @@ export class ContributorNode extends ViewNode
})}`
: '';
item.tooltip = new MarkdownString(
const markdown = new MarkdownString(
`${avatarMarkdown != null ? avatarMarkdown : ''}  __[${this.contributor.name}](mailto:${
this.contributor.email
} "Email ${this.contributor.name} (${
@ -131,7 +131,10 @@ export class ContributorNode extends ViewNode
{ format: numberFormatter.format },
)}${stats}`,
);
markdown.supportHtml = true;
markdown.isTrusted = true;
item.tooltip = markdown;
item.iconPath = avatarUri;
return item;

+ 1
- 0
src/views/nodes/fileRevisionAsCommitNode.ts 查看文件

@ -246,6 +246,7 @@ export class FileRevisionAsCommitNode extends ViewRefFileNode
);
const markdown = new MarkdownString(tooltip, true);
markdown.supportHtml = true;
markdown.isTrusted = true;
return markdown;

+ 6
- 1
src/views/nodes/mergeConflictCurrentChangesNode.ts 查看文件

@ -36,7 +36,8 @@ export class MergeConflictCurrentChangesNode extends ViewNode
? (await commit?.getAvatarUri({ defaultStyle: Container.instance.config.defaultGravatarsStyle })) ??
new ThemeIcon('diff')
: new ThemeIcon('diff');
item.tooltip = new MarkdownString(
const markdown = new MarkdownString(
`Current changes to $(file)${GlyphChars.Space}${this.file.fileName} on ${GitReference.toString(
this.status.current,
)}${
@ -56,6 +57,10 @@ export class MergeConflictCurrentChangesNode extends ViewNode
}`,
true,
);
markdown.supportHtml = true;
markdown.isTrusted = true;
item.tooltip = markdown;
item.command = this.getCommand();
return item;

+ 6
- 1
src/views/nodes/mergeConflictIncomingChangesNode.ts 查看文件

@ -41,7 +41,8 @@ export class MergeConflictIncomingChangesNode extends ViewNode
? (await commit?.getAvatarUri({ defaultStyle: Container.instance.config.defaultGravatarsStyle })) ??
new ThemeIcon('diff')
: new ThemeIcon('diff');
item.tooltip = new MarkdownString(
const markdown = new MarkdownString(
`Incoming changes to $(file)${GlyphChars.Space}${this.file.fileName}${
this.status.incoming != null
? ` from ${GitReference.toString(this.status.incoming)}${
@ -68,6 +69,10 @@ export class MergeConflictIncomingChangesNode extends ViewNode
}`,
true,
);
markdown.supportHtml = true;
markdown.isTrusted = true;
item.tooltip = markdown;
item.command = this.getCommand();
return item;

+ 6
- 1
src/views/nodes/mergeStatusNode.ts 查看文件

@ -80,7 +80,8 @@ export class MergeStatusNode extends ViewNode {
item.iconPath = this.status?.hasConflicts
? new ThemeIcon('warning', new ThemeColor('list.warningForeground'))
: new ThemeIcon('debug-pause', new ThemeColor('list.foreground'));
item.tooltip = new MarkdownString(
const markdown = new MarkdownString(
`${`Merging ${
this.mergeStatus.incoming != null ? GitReference.toString(this.mergeStatus.incoming) : ''
}into ${GitReference.toString(this.mergeStatus.current)}`}${
@ -90,6 +91,10 @@ export class MergeStatusNode extends ViewNode {
}`,
true,
);
markdown.supportHtml = true;
markdown.isTrusted = true;
item.tooltip = markdown;
return item;
}

+ 6
- 1
src/views/nodes/rebaseStatusNode.ts 查看文件

@ -106,7 +106,8 @@ export class RebaseStatusNode extends ViewNode {
item.iconPath = this.status?.hasConflicts
? new ThemeIcon('warning', new ThemeColor('list.warningForeground'))
: new ThemeIcon('debug-pause', new ThemeColor('list.foreground'));
item.tooltip = new MarkdownString(
const markdown = new MarkdownString(
`${`Rebasing ${
this.rebaseStatus.incoming != null ? GitReference.toString(this.rebaseStatus.incoming) : ''
}onto ${GitReference.toString(this.rebaseStatus.current)}`}\n\nStep ${
@ -121,6 +122,10 @@ export class RebaseStatusNode extends ViewNode {
}`,
true,
);
markdown.supportHtml = true;
markdown.isTrusted = true;
item.tooltip = markdown;
return item;
}

+ 6
- 1
src/views/nodes/repositoryNode.ts 查看文件

@ -270,7 +270,12 @@ export class RepositoryNode extends SubscribeableViewNode {
dark: Container.instance.context.asAbsolutePath(`images/dark/icon-repo${iconSuffix}.svg`),
light: Container.instance.context.asAbsolutePath(`images/light/icon-repo${iconSuffix}.svg`),
};
item.tooltip = new MarkdownString(tooltip, true);
const markdown = new MarkdownString(tooltip, true);
markdown.supportHtml = true;
markdown.isTrusted = true;
item.tooltip = markdown;
return item;
}

正在加载...
取消
保存