Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
fisheva committed Feb 3, 2025
1 parent 33d8d28 commit b48e4b7
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 2 deletions.
4 changes: 4 additions & 0 deletions VSCode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
2.7.6 (2025-02-03)

* Show Eva Theme for JetBrains ad tab.

2.7.5 (2025-01-18)

* Add Eva Theme for JetBrains link in README.
Expand Down
Binary file added VSCode/eva-theme-2.7.6.vsix
Binary file not shown.
53 changes: 53 additions & 0 deletions VSCode/extension.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import * as vscode from 'vscode';
import * as path from 'path';
import * as fs from 'fs';

export function activate(context: vscode.ExtensionContext) {
const currentVersion = '2.7.6'; // 当前插件版本
const previousVersion = context.globalState.get<string>('extensionVersion');

if (!previousVersion) {
// 首次安装
showMarkdownPreview('欢迎使用', getWelcomeMarkdownContent());
} else if (previousVersion !== currentVersion) {
// 更新版本
showMarkdownPreview('更新日志', getUpdateMarkdownContent(previousVersion, currentVersion));
}

// 更新版本号
context.globalState.update('extensionVersion', currentVersion);
}

function showMarkdownPreview(title: string, markdownContent: string) {
// 创建一个临时 Markdown 文件
const tempDir = path.join(__dirname, 'temp');
if (!fs.existsSync(tempDir)) {
fs.mkdirSync(tempDir);
}

const tempFilePath = path.join(tempDir, `${title}.md`);
fs.writeFileSync(tempFilePath, markdownContent, 'utf8');

// 调用 VSCode 内置 Markdown 渲染功能
vscode.commands.executeCommand('markdown.showPreview', vscode.Uri.file(tempFilePath));
}

function getWelcomeMarkdownContent(): string {
return `
### Happy Spring Festival! See what's new of Eva Theme in 2025.
### [Eva Theme for JetBrains](https://plugins.jetbrains.com/plugin/26338-eva-theme) has coming! :)
<img src="https://raw.githubusercontent.com/fisheva/Eva-Theme/refs/heads/master/VSCode/images/screenshots/Eva-Dark-IDEA.png" referrerpolicy="no-referrer" style="max-width:100%;">
`;
}

function getUpdateMarkdownContent(previousVersion: string, currentVersion: string): string {
return `
### Happy Spring Festival! See what's new of Eva Theme in 2025.
### [Eva Theme for JetBrains](https://plugins.jetbrains.com/plugin/26338-eva-theme) has coming! :)
<img src="https://raw.githubusercontent.com/fisheva/Eva-Theme/refs/heads/master/VSCode/images/screenshots/Eva-Dark-IDEA.png" referrerpolicy="no-referrer" style="max-width:100%;">
`;
}
Binary file modified VSCode/images/screenshots/Eva-Dark-IDEA-new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified VSCode/images/screenshots/Eva-Dark-IDEA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified VSCode/images/screenshots/Eva-Light-IDEA-new.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified VSCode/images/screenshots/Eva-Light-IDEA.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions VSCode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "eva-theme",
"displayName": "Eva Theme",
"description": "A comfortable and semantic theme.",
"version": "2.7.5",
"version": "2.7.6",
"publisher": "fisheva",
"license": "SEE LICENSE IN<LICENSE.md>",
"icon": "eva.jpg",
Expand All @@ -15,7 +15,7 @@
"url": ""
},
"engines": {
"vscode": "^1.12.0"
"vscode": "^1.63.0"
},
"extensionKind": [
"ui",
Expand Down

0 comments on commit b48e4b7

Please sign in to comment.