Repository navigation
feat(java): 在项目结构中安全编辑 Eclipse WTP Web Facet 版本 - #31
Merged
Merged
Conversation
- 读取 Facet 失败只跳过该来源,上报一次 webFacetUnreadable 降级 - 补齐 2.2/2.3/2.4/6.1,并按 jst.java 过滤可选版本,保存时同样拒绝 - xmltree 开启 attribute-order,写回不再打乱属性顺序,自闭合标签沿用 Eclipse 的 /> - test-module-structure 用真实 JDT LS 覆盖 Facet 读取、不合规文件、版本限制和保存 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Core 只接受小写字母、数字和 - 组成的字段 ID,webFacetVersion 会让 宿主拒绝整个项目结构页(plugin.settings.invalidSourceEditor)。 - 字段 ID 改为 web-facet-version - test-module-structure 检查所有分组、来源和字段 ID 符合 Core 规则 - visual.mjs 增加选中 Web Facet 来源的截图,存入 docs/assets/module-structure Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
背景
目前 Java Support 4.x 已显示模块、源码根、JDK 和依赖,也能只读探测 Eclipse WTP 工程。传统 JavaEE 项目还需要维护 Dynamic Web Module(
jst.web)Facet 版本。变更
.classpath的 Eclipse 工程,读取.settings/org.eclipse.wst.common.project.facet.core.xml中现有的jst.web,在「Java 项目结构」增加独立的「Web Facets」原生来源,提供已知版本的选择。jst.web的version,保留其他 Facet、注释和 XML 元素,不修改.classpath、IDEA.iml或 WTP.component。jst.web、非标准 XML、DOCTYPE、未知字段、非法修改;增加五个 Rust 单元测试并更新文档与验证矩阵。验证与限制
fmt/clippy/test结果;在当前执行环境未运行本机 Rust 编译、Lithe 原生窗口和跨平台实测,因此保持 Draft。目标分支:
main;不合并。接手跟进(
1133236、d276634)原提交合入后会有两个阻断问题,已修复:
webFacetVersion不符合 Core 标识符规则(只允许小写字母、数字、-)plugin.settings.invalidSourceEditor),WTP 工程打不开该页web-facet-version;test-module-structure检查所有分组、来源、字段 ID?向上抛错jst.web等),整页失败webFacetUnreadable降级(WARN)其他改动:
jst.java过滤可选项(Eclipse 的 Facet 约束:3.0→Java 6、3.1→7、4.0/5.0→8、6.0→11、6.1→17),保存时同样拒绝不兼容的版本;说明文案提示 5.0 起要迁移 jakarta 命名空间。attribute-order,自闭合标签按 Eclipse 的/>写出:保存后 diff 只有版本这一处(原来会打乱属性顺序、改动每个自闭合行)。同一写回函数也用于.classpath,那边同样受益;remove相应改为shift_remove。visual.mjs增加选中 Web Facet 来源的一张,存于docs/assets/module-structure/web-facet-*.png。验证(macOS arm64 本机,JDK 21,JDT LS 1.61)
cargo test --workspace、cargo clippy --workspace --all-targets -- -D warnings:通过scripts/build-package.sh --arch arm64:通过test-module-structure.mjs(新增 Web Facet 读取、不合规文件、版本限制、保存、ID 规则)、test-project-models.mjs、test-live.mjs(两种工程):全部通过visual.mjs(宿主81d01a25,Core788e61eb):经 CoreReadSourceSettings渲染通过;原提交在此步被 Core 拒绝test-module-structure.mjs