Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
#72 DOC.RS links
Browse files Browse the repository at this point in the history
  • Loading branch information
serayuzgur committed Mar 16, 2020
1 parent b66b2f2 commit 398a69e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/toml/decorations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,10 @@ function decoration(
const currentVersion = item.value;
const hasLatest = satisfies(versions[0], currentVersion || "0.0.0");

const hoverMessage = error ? new MarkdownString(`**${error}**`) : new MarkdownString(`**Available Versions**`);
const hoverMessage = error ? new MarkdownString(`**${error}**`) : new MarkdownString(`### Docs`);
hoverMessage.appendMarkdown(`\n * [Latest](https://docs.rs/crate/${item.key}/${versions[0]})`);
hoverMessage.appendMarkdown(`\n * [Current](https://docs.rs/crate/${item.key}/${currentVersion}) \n\n`);
hoverMessage.appendMarkdown("### Available Versions");
hoverMessage.isTrusted = true;

if (versions.length > 0) {
Expand All @@ -67,7 +70,7 @@ function decoration(
end,
};
const encoded = encodeURI(JSON.stringify(replaceData));
const command = `[${version}](command:crates.replaceVersion?${encoded})`;
const command = `[${version}](command:crates.replaceVersion?${encoded}) [ (docs)](https://docs.rs/crate/${item.key}/${version})`;
hoverMessage.appendMarkdown("\n * ");
hoverMessage.appendMarkdown(command);
}
Expand Down

0 comments on commit 398a69e

Please sign in to comment.