Repository navigation
feat(java): JSP/JSPF 与 EL 基础 TextMate 语法支持 - #30
Merged
Merged
Conversation
This was referenced Nov 18, 2026
- 恢复 assemble-package.sh、verify-package.sh 的 755,单测检查可执行位 - 语法 include text.html.basic,HTML 及 <script>/<style> 着色与原来一致;JSP 结构和 EL 通过注入在属性值、脚本、样式中也能识别 - 脚本片段只用 Java 词法规则,// 与 /* 注释在 %> 结束;带前缀的标签库标签不再被标成无法识别 - 新增 scripts/grammar/host-jsp.mjs:经 Go overlay 用宿主 TextMate 分词器逐项检查着色,CI 新增对应任务(Draft 也运行) - 版本号改回 4.0.1,由发版提交统一确定 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…p-syntax # Conflicts: # docs/feature-matrix.md
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 插件对传统 JavaEE 的 JSP 文件提供不依赖新的常驻语言服务器的基础语法能力,与现有 Java 项目结构、Tomcat 插件的 Web 模块识别相互配合。
改动
.jsp/.jspf/.tag/.tagf注册为jsp语言;新增自包含 TextMate 语法,覆盖 JSP 注释、指令、声明、脚本片段、JSP/JSTL 与 HTML 标签、EL${...}/#{...}。grammars/;macOS 包白名单明确验证 JSP grammar 存在。scripts/package/jsp-grammar.test.mjs:语法 JSON、正则、本地规则引用、典型 JSP/EL 样例、各平台打包入口。验证
#rule引用完整,EL 转义反例正确。languages[].grammar和configuration字段。范围边界
这是语法着色,不是 JSP/EL 语言服务器。JSP 补全/诊断/跨文件导航、JSP 断点、Facet 可视化编辑另行实现;不假称已完成。
与 Tomcat PR #1 并行,Tomcat 端仍需真实服务器与原生宿主验收。保持 Draft 直到 CI 和实际窗口回归完成。
提交:
1a793b407c8619dde910caaf86d05a2c6e4f1e2f接手跟进(
36c35ed)assemble-package.sh、verify-package.sh权限被改成 644build-package.sh、archive-package.sh直接执行它们,macOS 打包和发版报 Permission denied(Draft 跳过了 macOS 任务所以 CI 没发现).jsp交给内置完整 HTML 语法;插件语言优先,自写的简化语法会取代它<script>/<style>的 JS/CSS 着色全部丢失include宿主的text.html.basic,JSP 结构和 EL 以注入方式出现在 HTML 任何位置(属性值、脚本、样式内也识别);根层同时列出 JSP 规则,0.8.4 之前不支持注入的宿主仍能识别正文层级的 JSP//.*$%>,后面整个文件被当作 Java%>处结束;脚本片段只用 Java 词法规则(source.java#strings/numbers/keywords/...),因为 JSP 常把一个代码块拆在多个片段里<c:forEach>、<jsp:include>invalid.illegal.unrecognized-tagchore(release)提交定版本新增
scripts/grammar/host-jsp.mjs:经 Go overlay 把e2e/host/.../plugin_jsp_grammar_test.go加入固定的宿主检出(grammar-host.json),用宿主自己的 TextMate 分词器和内置 HTML/CSS/JS/Java 语法逐项检查 24 处着色,并断言没有任何invalid作用域。CI 新增 “JSP grammar on the host tokenizer” 任务,纯 Go、不需要 Core,Draft 也运行。验证
node scripts/grammar/host-jsp.mjs:macOS 本机与 CI 通过%>的问题复现,新语法结果一致node --test scripts/package/*.test.mjs、cargo test --workspace:通过scripts/build-package.sh --arch arm64+archive-package.sh:通过,包内含grammars/jsp.tmLanguage.json