Repository navigation
feat(java): 项目结构页按模块配置源文件夹、输出、JRE 和依赖(4.0.0) - #26
Merged
Merged
Conversation
对标 IDEA“项目结构 → 模块”(1lck/Lithe-IDEA#2086),需要宿主 sourceSettings 1: - Eclipse 工程成为侧栏模块,按“源 / 路径 / 依赖”编辑源文件夹(测试标记)、 输出文件夹、JRE 执行环境和依赖(JAR/ZIP、类文件夹、库容器、模块依赖, 导出与仅测试),写回 .classpath,按种类和路径复用已有条目,保留源码附件、 注释和页面不显示的条目。 - Maven/Gradle 模块只读,显示 java.project.getClasspaths 解析的类路径; 解析失败的模块不显示并上报一次降级。 - 删除不再使用的 .classpath 库字段代码;设置动作改名“读取项目结构”。 - 新增真实 JDT LS 端到端 test-module-structure.mjs 并接入 CI;test-live 的 Eclipse 模式改用依赖列表;截图覆盖项目结构页;compiler-host 固定到宿主 81d01a2 与 Core 788e61e。 - 版本 4.0.0(主版本:要求 sourceSettings 1),文档、功能矩阵与发布说明。 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.
关联 Issue
背景
用户希望像 IDEA“项目结构 → 模块”一样逐个模块配置依赖。宿主和 Core 已支持
sourceSettings版本 1(模块侧栏、标签页、条目列表),本 PR 让 Java 插件把工作区的模块投影成这个页面。改动
backend/src/module_structure.rs.classpath:源文件夹(test属性)、输出文件夹、JRE 容器、依赖(lib按扩展名分 JAR/ZIP 与类文件夹,con为库,/项目为模块依赖,var为变量),exported与嵌套test属性。.project名称);有变量项时才声明“类路径变量”种类(无候选,只能保留和排序)。sourcepath、Javadoc、访问规则等属性;新条目依次占用原条目的位置,注释和其他节点不动;新模块依赖带combineaccessrules="false";选择器给的绝对路径在模块内转相对,否则写正斜杠绝对路径;源文件夹和输出必须在模块内;拒绝未声明的字段、种类、JRE 以外的 JRE 值和新变量。project_settings.rs:库页面(libraries.settings)改为“Java 项目结构”:modules侧栏组:Eclipse 工程可编辑;Maven/Gradle 模块只读,依赖来自java.project.getClasspaths(选项按 vscode-java 的写法传 JSON 字符串),工作区内路径相对显示;解析失败的模块跳过并通过diagnostics().degraded上报一次。parent(最多 8 层)。.classpath的文件夹仍在“引用的库”分组;“工程模型”只读分组不变。.classpath改走module_structure::edit;抽出write_classpath复用序列化。classpath_libraries/edit_classpath及其测试、classpath_label、container_lines的brief分支和MAX_LABEL_BYTES。requires.sourceSettings0 → 1;设置动作改名“读取项目结构 / Read project structure”(含中文翻译)。scripts/compiler/test-module-structure.mjs(真实 JDT LS,两个 Eclipse 工程 + 一个 Maven 模块),接入 CI 的 macOS 与 Linux 任务。test-live.mjs的 Eclipse 模式改用依赖列表添加外部 JAR。lsp-client.mjs增加可选的通知回调,用于在构建失败时打印 JDT 诊断。compiler-host.json:固定到宿主81d01a2(#2087)和 Core788e61e(#79)。docs/module-structure.md、docs/releases/v4.0.0.md;更新 README、docs/native-settings.md、功能矩阵。截图(宿主
81d01a2无头渲染的真实 JDT 投影)验证(macOS arm64,JDT LS 1.61.0,JDK 21)
cargo fmt --all -- --check、cargo clippy -p lithe-java-backend --all-targetscargo test --workspace --lockedscripts/build-package.sh --arch arm64node scripts/compiler/test-module-structure.mjs <包>.classpath保留注释与源码附件;JDT 编译到新输出文件夹;插件包与 JDT LS 不变node scripts/compiler/test-project-models.mjs <包>node scripts/compiler/test-live.mjs <包>(普通与LITHE_JAVA_PROJECT_KIND=eclipse)node scripts/compiler/visual.mjs <宿主 81d01a2>未执行: Windows 与 Linux 由 CI 跑;原生文件选择器需要实机。
发布
主版本(要求
sourceSettings1)。合并后打v4.0.0标签,发布为预发布版,不设为 Latest,暂不更新商店索引;等支持它的宿主稳定版发布后再转正并上架。🤖 Generated with Claude Code