Repository navigation
feat(settings): 为语言与编译器设置页添加实时预览画布(settingRegions.view) - #40
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
关联 Issue / Linked issue
lithe-plugin-go的设置页settingRegions[].view实时画布预览,关联宿主Lithe-IDEA#2183 / #2191)PR 类型 / Type
改动说明 / What changes
背景 / Why
Previously,
lithe-plugin-javaonly declaredsettingRegionskeywords onlanguage(语言与框架 › Java) andcompiler(构建、执行、部署 › 编译器 › Java 编译器), without contributing aview.functionpreview canvas likelithe-plugin-go. Users editing Java Language Server heap size, folder, log level, project model detection, or servlet container folder had no live visual preview above the setting rows, and the Java Compiler page did not show the configuration precedence hierarchy before clicking读取编译设置.改动 / Changes
io.github.lithe-idea.java-support/plugin.json:requires中新增"ui": 0,在permissions中新增"ui.contribute"。settingRegions的language与compiler两项补充"view": { "function": "settings.view" }。contract.lock.json与compiler-host.json:contract.lock.json升级至Lithe-IDEA/Lithe-core-rust0b6da2725ded74de7c3b62b49d12c1947dc0a38a,并锁定plugin-ui.schema.json的 SHA-256。compiler-host.json升级至宿主76f8a663f18cafa3405da47ceede1ebd450d858f与同一 Core 修订。backend/src/settings_view.rs与backend/src/lib.rs:settings.view(SETTINGS_VIEW_FUNCTION_ID)视图处理函数,支持open/settings/resize事件、中英文双语、草稿高亮与宽度自适应(带"on": ["resize"],无width时省略on并回退安全默认宽度):language区域:渲染 4 张实时联动草稿的预览卡片(JDT LS 内存与目录、语言服务器日志级别、自动识别工程模型、Servlet 容器文件夹),宽度>= 594时双列 2×2 网格,窄宽度下自动切为单列。compiler区域:渲染三层编译配置生效顺序图(模块.settings/org.eclipse.jdt.core.prefs› 构建工具pom.xml / build.gradle (.kts)› 项目 JDK 默认级别),默认回退宽度340.0以适配三栏编译器页最窄详情区。backend/src/lib.rs注册settings.view并调用suppress_success_diagnostics("settings.view")抑制高频成功 INFO 日志;参数非法返回settings_view.invalid_params(-32602),未识别设置值通过context.diagnostics().degraded("settings.view", "settings_view.setting_unrecognized", Some(count))上报计数并回退默认值;将VIEW_ERROR_CODES与VIEW_CATEGORIES纳入全局错误码唯一性断言。backend/tests/repository_pins.rs:manifest_and_zh_hans_declare_setting_regions中新增requires.ui == 0、permissions含"ui.contribute"及两个settingRegions的view.function == "settings.view"断言。scripts/compiler/visual.mjs与e2e/host/desktop/internal/settingswindow/plugin_native_source_test.go:visual.mjs先编译lithe-java-backend并通过LITHE_NATIVE_BACKEND传给无头测试。plugin_native_source_test.go通过 CoreStartPluginBackend启动有界生命周期的后端会话(t.Cleanup等待在途请求并执行StopPluginBackend+DestroyPluginBackend),实现PluginViewLoader.View调用settings.view与ApplyPluginViewResult,等待区域预览绘制完成后同时抓取java-settings-{zh-Hans,en}-{dark,light}.png与java-compiler-settings-{zh-Hans,en}-{dark,light}.png。docs/feature-matrix.md、README.md与docs/assets/project-models/java-settings-zh-light.png:不在本 PR 范围内 / Out of scope
类型专属:feat
多平台对齐
Lithe 的目标是 macOS 与 Windows 能力对齐。必须选下面一项:
settings.view与plugin.json声明跨平台共用,由 Viva 桌面端统一渲染)platform-specific),理由:范围检查 / Scope checks
功能矩阵 / Feature matrix
docs/feature-matrix.md:记录requires.ui: 0、ui.contribute与settings.view在 macOS 的无头实机验证证据,Windows 与 Linux 原生验证保持pending./scripts/platform-feature-matrix/verify-platform-feature-matrix.sh:本仓库为独立插件仓库,不修改宿主shared/platform-feature-matrix/.artifacts/下生成的临时产物插件归属 / Plugin ownership
lithe-plugin-java仓库维护,Lithe-IDEA与Lithe-core-rust零改动、对本插件零依赖go test -overlay注入,不向宿主仓库写入任何文件UI 验证 / UI evidence
node scripts/compiler/visual.mjs <Lithe-IDEA checkout at 76f8a663f18cafa3405da47ceede1ebd450d858f>java-settings-{zh-Hans,en}-{dark,light}.png(1120×1600)与java-compiler-settings-{zh-Hans,en}-{dark,light}.png(1120×900)共 8 张明暗主题、中英文截图,以及全部既有工程模型与模块结构截图docs/assets/project-models/java-settings-zh-light.pngdocs/feature-matrix.md中如实记为pending统一日志系统 / Structured logging
litheLogging0 上报诊断,无stderr、println!或手写日志输出settings.view已调用backend.suppress_success_diagnostics("settings.view")抑制成功 INFO;参数错误返回稳定错误码settings_view.invalid_params;未识别设置值通过context.diagnostics().degraded("settings.view", "settings_view.setting_unrecognized", Some(count))记录settings_relay_codes_never_share_a_name_with_another_code唯一性测试界面文案 / i18n
language(zh*/en*)在插件内部完整提供中英文双语,不写入宿主shared/i18n/l10n/zh-Hans.json已通过scripts/verify-contract.py校验逻辑归属 / Logic placement
lithe-plugin-javaRust 后端,视图协议校验复用 Rust Core 的ApplyPluginViewResult(plugin-ui)性能与内存 / Performance and memory
settings.view为纯内存无状态 JSON 计算,无磁盘 I/O、无轮询或额外常驻缓存;仅在设置页打开对应区域或草稿/宽度变化时按需调用设置 / Settings
effective与draft快照,打开页面不写任何配置文件;未保存草稿改动时即时高亮卡片边框并标记“包含尚未保存的改动”插件契约 / Plugin contract
0b6da2725ded74de7c3b62b49d12c1947dc0a38a已发布的ui0 /settingRegions[].view契约,未新增或修改宿主方法发行包与资源 / Bundle and resources
无用代码与重构 / Dead code and refactoring
验证 / Verification
cargo fmt --all --checkcargo clippy --workspace --all-targets --locked -- -D warningscargo test --workspace --lockedlithe_java_backend155 passed 含 7 个settings_view单测、repository_pins10 passed、session4 passed、lithe_java_domain282 passed)bash scripts/verify-sdk-lock.sh --downloadVerified manifest and 1 translations against Core 0b6da2725ded74de7c3b62b49d12c1947dc0a38a)node --test --test-timeout=60000 scripts/package/*.test.mjsnode --test --test-timeout=15000 scripts/compiler/process.test.mjsnode scripts/compiler/visual.mjs <Lithe-IDEA 76f8a663f>ok github.com/1lck/Lithe-IDEA/desktop/internal/settingswindow 7.135s,8 张语言/编译器设置页深浅色中英截图均已核查)未能执行的检查和原因:
docs/feature-matrix.md中如实标记为implemented / pending。提交前确认 / Final checks
main创建;目标分支为maintarget/、dist/、.artifacts/等产物,没有凭据或未脱敏的个人路径