This repository was archived by the owner on Jun 28, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed
Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -48,10 +48,7 @@ function decoration(
4848 const currentVersion = item . value ;
4949 const hasLatest = satisfies ( versions [ 0 ] , currentVersion || "0.0.0" ) ;
5050
51- const hoverMessage = error ? new MarkdownString ( `**${ error } **` ) : new MarkdownString ( `### Docs` ) ;
52- hoverMessage . appendMarkdown ( `\n * [Latest](https://docs.rs/crate/${ item . key } /${ versions [ 0 ] } )` ) ;
53- hoverMessage . appendMarkdown ( `\n * [Current](https://docs.rs/crate/${ item . key } /${ currentVersion } ) \n\n` ) ;
54- hoverMessage . appendMarkdown ( "### Available Versions" ) ;
51+ const hoverMessage = error ? new MarkdownString ( `**${ error } **` ) : new MarkdownString ( `### Versions` ) ;
5552 hoverMessage . isTrusted = true ;
5653
5754 if ( versions . length > 0 ) {
@@ -69,8 +66,10 @@ function decoration(
6966 start,
7067 end,
7168 } ;
69+ const isCurrent = version === currentVersion ;
7270 const encoded = encodeURI ( JSON . stringify ( replaceData ) ) ;
73- const command = `[${ version } ](command:crates.replaceVersion?${ encoded } ) [ (docs)](https://docs.rs/crate/${ item . key } /${ version } )` ;
71+ const docs = ( i === 0 || isCurrent ) ? `[ (docs)](https://docs.rs/crate/${ item . key } /${ version } )` : "" ;
72+ const command = `${ isCurrent ? "**" : "" } [${ version } ](command:crates.replaceVersion?${ encoded } )${ docs } ${ isCurrent ? "**" : "" } ` ;
7473 hoverMessage . appendMarkdown ( "\n * " ) ;
7574 hoverMessage . appendMarkdown ( command ) ;
7675 }
You can’t perform that action at this time.
0 commit comments