Reputation: 6101
I have seen extensions display an important notification in the bottom right when vscode auto-dates them, like this:
How can I display a message like this the first time someone runs the new version of an extension I maintain?
Upvotes: 0
Views: 2974
Reputation: 28663
I have looked at the source code of the Material Theme
how they do it. It was the first extension to show me such a message and a theme extension would not have a lot of code.
What they do is: write a file in the directory of the extension that contains the version number of the extension the last time they showed the message. It is stored in JSON format because package.json
is too.
On activation:
user_config.json
in the extension directory (place where package.json
is)user_config.json
and package.json
package.json
version is bigger (major - minor - patch)package.json
version in user_config.json
Upvotes: 1
Reputation: 943
You can use vscode.window.showInformationMessage
API, to show buttons you can pass as many arguments you want after 1st one, which is title
const resp = await vscode.window.showInformationMessage(
"There are multiple formatters for 'JSON' files...",
"Configure..."
);
if (resp === "Configure...") {
//your logic here
}
Upvotes: 1