@@ -4,7 +4,7 @@ import { DiffWithCommand, OpenCommitInRemoteCommand, OpenFileRevisionCommand, Sh
44import { FileAnnotationType } from './../configuration' ;
55import { GlyphChars } from '../constants' ;
66import { Container } from '../container' ;
7- import { CommitFormatter , GitCommit , GitDiffChunkLine , GitService , GitUri , ICommitFormatOptions } from '../gitService' ;
7+ import { CommitFormatter , GitCommit , GitDiffChunkLine , GitRemote , GitService , GitUri , ICommitFormatOptions } from '../gitService' ;
88
99interface IHeatmapConfig {
1010 enabled : boolean ;
@@ -62,7 +62,7 @@ export class Annotations {
6262 return commandBar ;
6363 }
6464
65- static getHoverMessage ( commit : GitCommit , dateFormat : string | null , hasRemote : boolean , annotationType ?: FileAnnotationType , line : number = 0 ) : MarkdownString {
65+ static getHoverMessage ( commit : GitCommit , dateFormat : string | null , remotes : GitRemote [ ] , annotationType ?: FileAnnotationType , line : number = 0 ) : MarkdownString {
6666 if ( dateFormat === null ) {
6767 dateFormat = 'MMMM Do, YYYY h:mma' ;
6868 }
@@ -71,10 +71,18 @@ export class Annotations {
7171 let commandBar = '' ;
7272 let showCommitDetailsCommand = '' ;
7373 if ( ! commit . isUncommitted ) {
74- commandBar = `\n\n${ this . getHoverCommandBar ( commit , hasRemote , annotationType , line ) } ` ;
74+ commandBar = `\n\n${ this . getHoverCommandBar ( commit , remotes . length !== 0 , annotationType , line ) } ` ;
7575 showCommitDetailsCommand = `[\`${ commit . shortSha } \`](${ ShowQuickCommitDetailsCommand . getMarkdownCommandArgs ( commit . sha ) } "Show Commit Details")` ;
7676
77- message = commit . message
77+ message = commit . message ;
78+ for ( const r of remotes ) {
79+ if ( r . provider === undefined ) continue ;
80+
81+ message = r . provider . enrichMessage ( message ) ;
82+ break ;
83+ }
84+
85+ message
7886 // Escape markdown
7987 . replace ( escapeMarkdownRegEx , '\\$&' )
8088 // Escape markdown header (since the above regex won't match it)
@@ -135,12 +143,12 @@ export class Annotations {
135143 } as DecorationOptions ;
136144 }
137145
138- static detailsHover ( commit : GitCommit , dateFormat : string | null , hasRemote : boolean , annotationType ?: FileAnnotationType , line : number = 0 ) : DecorationOptions {
139- const message = this . getHoverMessage ( commit , dateFormat , hasRemote , annotationType ) ;
140- return {
141- hoverMessage : message
142- } as DecorationOptions ;
143- }
146+ // static detailsHover(commit: GitCommit, dateFormat: string | null, hasRemote: boolean, annotationType?: FileAnnotationType, line: number = 0): DecorationOptions {
147+ // const message = this.getHoverMessage(commit, dateFormat, hasRemote, annotationType);
148+ // return {
149+ // hoverMessage: message
150+ // } as DecorationOptions;
151+ // }
144152
145153 static gutter ( commit : GitCommit , format : string , dateFormatOrFormatOptions : string | null | ICommitFormatOptions , renderOptions : IRenderOptions ) : DecorationOptions {
146154 const decoration = {
@@ -227,28 +235,28 @@ export class Annotations {
227235 } as IRenderOptions ;
228236 }
229237
230- static hover ( commit : GitCommit , renderOptions : IRenderOptions , now : number ) : DecorationOptions {
231- const decoration = {
232- renderOptions : { before : { ...renderOptions } }
233- } as DecorationOptions ;
238+ // static hover(commit: GitCommit, renderOptions: IRenderOptions, now: number): DecorationOptions {
239+ // const decoration = {
240+ // renderOptions: { before: { ...renderOptions } }
241+ // } as DecorationOptions;
234242
235- this . applyHeatmap ( decoration , commit . date , now ) ;
243+ // this.applyHeatmap(decoration, commit.date, now);
236244
237- return decoration ;
238- }
245+ // return decoration;
246+ // }
239247
240- static hoverRenderOptions ( heatmap : IHeatmapConfig ) : IRenderOptions {
241- if ( ! heatmap . enabled ) return { before : undefined } ;
248+ // static hoverRenderOptions(heatmap: IHeatmapConfig): IRenderOptions {
249+ // if (!heatmap.enabled) return { before: undefined };
242250
243- return {
244- borderStyle : 'solid' ,
245- borderWidth : '0 0 0 2px' ,
246- contentText : GlyphChars . ZeroWidthSpace ,
247- height : '100%' ,
248- margin : '0 26px 0 0' ,
249- textDecoration : 'none'
250- } as IRenderOptions ;
251- }
251+ // return {
252+ // borderStyle: 'solid',
253+ // borderWidth: '0 0 0 2px',
254+ // contentText: GlyphChars.ZeroWidthSpace,
255+ // height: '100%',
256+ // margin: '0 26px 0 0',
257+ // textDecoration: 'none'
258+ // } as IRenderOptions;
259+ // }
252260
253261 static trailing ( commit : GitCommit , format : string , dateFormat : string | null ) : DecorationOptions {
254262 const message = CommitFormatter . fromTemplate ( format , commit , {
@@ -269,20 +277,20 @@ export class Annotations {
269277 } as DecorationOptions ;
270278 }
271279
272- static withRange ( decoration : DecorationOptions , start ?: number , end ?: number ) : DecorationOptions {
273- let range = decoration . range ;
274- if ( start !== undefined ) {
275- range = range . with ( {
276- start : range . start . with ( { character : start } )
277- } ) ;
278- }
279-
280- if ( end !== undefined ) {
281- range = range . with ( {
282- end : range . end . with ( { character : end } )
283- } ) ;
284- }
285-
286- return { ...decoration , range : range } ;
287- }
280+ // static withRange(decoration: DecorationOptions, start?: number, end?: number): DecorationOptions {
281+ // let range = decoration.range;
282+ // if (start !== undefined) {
283+ // range = range.with({
284+ // start: range.start.with({ character: start })
285+ // });
286+ // }
287+
288+ // if (end !== undefined) {
289+ // range = range.with({
290+ // end: range.end.with({ character: end })
291+ // });
292+ // }
293+
294+ // return { ...decoration, range: range };
295+ // }
288296}
0 commit comments