Skip to content

适配 ege25.11 进行一些改进, 版本号更新至 1.0.0#10

Merged
wysaid merged 6 commits into
masterfrom
version_1.0
Nov 29, 2025
Merged

适配 ege25.11 进行一些改进, 版本号更新至 1.0.0#10
wysaid merged 6 commits into
masterfrom
version_1.0

Conversation

@wysaid
Copy link
Copy Markdown
Collaborator

@wysaid wysaid commented Nov 29, 2025

Summary by CodeRabbit

  • 新功能

    • 支持 Visual Studio 2026;新增配置项 ege.downloadFromOfficial(默认 false),安装时不再弹出版本选择对话框
    • 包含 EGE 25.11 更新:新增颜色类型与色彩转换、键盘按键查询接口、摄像头分辨率查询、图像改为预乘 alpha 提升渲染性能
  • 文档

    • 更新中/英文 README,添加配置说明与示例
  • 维护

    • 包版本升至 1.0.0;调整部分预构建二进制资产的存储方式

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Nov 29, 2025

Walkthrough

将包版本升至 1.0.0,加入对 Visual Studio 2026 的识别与构建映射,新增配置项 ege.downloadFromOfficial(默认 false)并由此简化 Windows 安装流程以基于配置清缓存并选择下载源;同步更新文档与本地化,并移除部分 vs2026 二进制的 Git LFS 指针元数据。

Changes

合群 / 文件 变更摘要
发布说明与文档
CHANGELOG.md, README.md, README.zh-CN.md
添加 1.0.0 版本条目;将 Windows 工具链依赖更新到 2026+;在示例与文档中加入并说明 ege.downloadFromOfficial 配置及其注意事项;示例 JSON 中加入 ege.downloadFromOfficial
包与本地化
package.json, package.nls.json, package.nls.zh-cn.json
包版本从 0.7.0 升级到 1.0.0;新增 contributes.configuration.properties.ege.downloadFromOfficial(boolean,默认 false);新增本地化键 config.downloadFromOfficial.description(中/英)。
编译器常量
src/compilers.ts
添加 TYPE_VS2026 常量并将其包含到现有 VS 判定/安装分支中以识别 VS2026。
安装器逻辑
src/installer.ts
安装流程读取 ege.downloadFromOfficial 配置以决定下载源;移除 Windows 安装时的交互 QuickPick;在检测到已存在安装时改为清理插件缓存并依配置执行下载或使用内置包;保留非 Windows 的既有流程与信息提示。
Win32 构建脚本
src/buildSingleFileWin32.ts
引入 vsVersion 判定并将 VS2026 映射为版本 18/2026 用于路径选择;调整 C++ 标准判定(含对 VS2026 的 C++17 支持判定);在 cl 命令中加入 /Zc:__cplusplus,并对 lib 目录查找加入 vs2022 回退。
捆绑包二进制元数据
Removed LFS pointers
bundle/ege_bundle/lib/vs2026/.../x64/graphics.lib, bundle/ege_bundle/lib/vs2026/.../x86/graphics.lib
从两个 vs2026 路径下的 graphics.lib 文件移除 Git LFS 指针元数据(删除 version/oid/size 等字段),改变这些二进制在仓库中的存储表示。

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Installer
    participant Compilers
    participant Cache
    participant Downloader
    participant BuiltinBundle

    Installer->>Compilers: 识别 VS 版本(含 VS2026)
    Installer->>Cache: 检查已有安装并清理插件缓存(若存在)
    alt Windows 且 downloadFromOfficial == true
        Installer->>Downloader: 请求从官方站点下载 EGE
        Downloader-->>Installer: 返回下载包或错误
        Installer->>BuiltinBundle: 部署下载包到内置路径并完成安装
    else Windows 且 downloadFromOfficial == false
        Installer->>BuiltinBundle: 使用仓内内置捆绑直接安装(无用户交互)
        BuiltinBundle-->>Installer: 安装完成
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • 重点审查 src/installer.ts:清缓存行为、downloadFromOfficial 分支、去除 QuickPick 的副作用及错误/回退路径。
  • 校验 src/compilers.tssrc/buildSingleFileWin32.ts:VS2026 映射、C++ 标准判定与新增编译标志兼容性。
  • 确认 package.json 的 schema 与 package.nls*.json 本地化键一致性。
  • 检查移除 Git LFS 指针对 CI/发布资产和二进制分发的影响(打包流程、发布脚本)。

Possibly related PRs

  • 更新 ege 源码至 25.11 #9 — 与本次捆绑与文档更新直接相关,包含将捆绑 EGE 升级到 25.11(新增 color_type、image_convertcolor、键盘/相机查询等 API)。

Poem

🐰 跳一跃,新包到,
VS2026 路已搭,
下载源选项轻轻挠,
文档本地化齐声笑,
兔子送上小胡萝卜 🥕

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed 标题清晰具体地总结了主要变更:适配EGE 25.11并进行改进,版本号升级至1.0.0,与代码变更内容相符。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch version_1.0

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 03980ea and f846b00.

📒 Files selected for processing (1)
  • src/buildSingleFileWin32.ts (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/buildSingleFileWin32.ts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/installer.ts (1)

65-85: 建议改进递归逻辑和用户体验。

当前实现在 Windows 系统检测到已有安装时,会自动清理缓存并重新安装。虽然逻辑上是安全的(clearPluginCache() 会删除 egeTempDir,递归调用时条件不再满足),但存在以下问题:

  1. 递归调用模式不够清晰:在 lines 74 和 80 处调用 await this.performInstall() 会让代码流程难以追踪,建议重构为更直接的控制流。

  2. 缺少用户提示:在清理已有安装前,应该通知用户将要执行的操作,避免用户困惑。当前只有在 clearPluginCache() 内部才显示"清理缓存完成"的提示。

  3. 参数行为不一致:函数的 needDownload 参数在新的代码路径中被忽略,改为由 downloadFromOfficial 配置决定,这可能导致调用者的预期行为不一致。

建议的改进方案:

 async performInstall(needDownload?: boolean): Promise<boolean | undefined> {
     // 检查是否配置了从官网下载
     const config = vscode.workspace.getConfiguration('ege');
     const downloadFromOfficial = config.get<boolean>('downloadFromOfficial', false);

     if (fs.existsSync(this.egeInstallerDir)) {
         if (isWindows()) {
-            // 如果配置了从官网下载,直接清理缓存并下载
-            if (downloadFromOfficial) {
-                this.clearPluginCache();
-                await this.performInstall(true);
-                return;
-            }
-
-            // 默认:直接使用内置版本,重新安装
-            this.clearPluginCache();
-            await this.performInstall(false);
-            return;
+            // 通知用户并清理已有安装
+            const action = await vscode.window.showInformationMessage(
+                t('message.reinstallPrompt'),
+                t('button.continue'),
+                t('button.cancel')
+            );
+            if (action !== t('button.continue')) {
+                return false;
+            }
+            this.clearPluginCache();
+            // 继续执行安装流程,使用配置决定下载源
+            needDownload = downloadFromOfficial;
         } else {
             ege.printInfo("正在非 Windows 系统上执行编译...");
         }
     }
+    
+    // 如果 needDownload 未明确指定,则使用配置
+    if (needDownload === undefined) {
+        needDownload = downloadFromOfficial;
+    }

这样可以:

  • 消除递归调用,使控制流更清晰
  • 在清理前征求用户确认
  • 统一 needDownload 参数和配置的处理逻辑
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 65fc07f and 3598cdc.

📒 Files selected for processing (8)
  • CHANGELOG.md (1 hunks)
  • README.md (2 hunks)
  • README.zh-CN.md (2 hunks)
  • package.json (2 hunks)
  • package.nls.json (1 hunks)
  • package.nls.zh-cn.json (1 hunks)
  • src/compilers.ts (2 hunks)
  • src/installer.ts (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
src/installer.ts (1)
src/utils.ts (1)
  • isWindows (83-85)
🪛 LanguageTool
README.md

[grammar] ~45-~45: Ensure spelling is correct
Context: ...ial`**: By default, the plugin uses the builtin EGE library (tested and stable). If you...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (11)
package.nls.zh-cn.json (1)

11-12: LGTM!

新增的本地化配置项格式正确,中文描述清晰准确,与英文版本保持一致。

package.nls.json (1)

11-12: LGTM!

英文本地化配置项添加正确,描述清晰,与中文版本保持一致。

README.zh-CN.md (2)

18-18: LGTM!

正确更新了 Windows 工具链版本支持范围,包含了新增的 Visual Studio 2026+ 支持。


37-45: LGTM!

新增的配置说明清晰易懂,既提供了配置示例,又详细说明了配置项的用途和注意事项。文档结构合理,有助于用户理解何时使用此选项。

CHANGELOG.md (1)

7-19: LGTM!

1.0.0 版本的更新日志完整详细,清晰记录了所有重要变更,包括:

  • 大版本更新(EGE 25.11)
  • VS 2026 支持
  • 新配置项
  • 用户体验改进
  • EGE 新特性列表

文档结构清晰,有助于用户了解版本变化。

src/compilers.ts (2)

27-27: LGTM!

新增的 VS2026 常量定义与现有的 Visual Studio 版本常量保持一致。


276-276: LGTM!

正确地将 TYPE_VS2026 添加到安装流程的 switch 语句中,与其他 Visual Studio 版本的处理方式保持一致。

README.md (2)

18-18: LGTM!

正确更新了 Windows Visual Studio 版本支持范围,与中文文档保持一致。


39-45: LGTM!

新增的配置项文档清晰完整,与中文版本保持一致。

注:静态分析工具关于 "builtin" 拼写的提示是误报,"builtin" 是编程领域的标准术语,表示"内置的"。

package.json (2)

5-5: LGTM!

版本号正确更新至 1.0.0,符合此次大版本更新的语义化版本规范。


76-82: LGTM!

新增的配置项定义规范完整:

  • 类型定义正确(boolean)
  • 默认值合理(false,使用内置版本)
  • 使用了本地化引用
  • 作用域设置恰当(resource)

JSON 格式正确,与现有配置项保持一致。

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
src/buildSingleFileWin32.ts (1)

114-114: 添加 /Zc:__cplusplus 标志是一个改进。

此标志确保 __cplusplus 宏正确反映所使用的 C++ 标准版本,这对于标准兼容的代码和条件编译很重要。

可选的代码清理:

Line 112 的 executionCharsetCommand 始终为空字符串,可以考虑从 Line 114 的构建命令中移除它以提高可读性:

-const buildCommand = `call "${cmdTool}" ${arch} && cl /nodefaultlib:"MSVCRT" /MDd ${defineConsole} ${extraIncludeCommand} /std:${cppStandard} /Zc:__cplusplus ${sourceCharsetCommand} ${executionCharsetCommand} /EHsc "${filePath}" /link ${extraLibsCommand}`;
+const buildCommand = `call "${cmdTool}" ${arch} && cl /nodefaultlib:"MSVCRT" /MDd ${defineConsole} ${extraIncludeCommand} /std:${cppStandard} /Zc:__cplusplus ${sourceCharsetCommand} /EHsc "${filePath}" /link ${extraLibsCommand}`;

同时可以移除 Line 111-112 的 executionCharsetexecutionCharsetCommand 变量定义。

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4d71118 and f6cfe1e.

📒 Files selected for processing (1)
  • src/buildSingleFileWin32.ts (2 hunks)

Comment thread src/buildSingleFileWin32.ts Outdated
@wysaid wysaid merged commit 6d5e24a into master Nov 29, 2025
3 checks passed
@wysaid wysaid deleted the version_1.0 branch November 29, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant