Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the Julia TeXmacs plugin by splitting the former monolithic entry file into smaller focused modules, renaming the plugin entrypoint to julia.jl, and adding end-to-end Scheme tests to validate session execution and symbolic/LaTeX output.
Changes:
- Replace
MoganJulia.jlwith a new modular entrypointjulia.jland newtmjl/*implementation files (protocol, stream capture, display, completion). - Update the Scheme launcher (
init-julia.scm) to startjulia.jl. - Add new integration tests
TeXmacs/tests/0801.scmandTeXmacs/tests/0804.scm.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| TeXmacs/tests/0801.scm | Adds Julia plugin integration tests (serialization + session execution). |
| TeXmacs/tests/0804.scm | Adds Symbolics/Latexify integration tests for LaTeX formatting output. |
| TeXmacs/plugins/julia/progs/init-julia.scm | Updates plugin entrypoint path from MoganJulia.jl to julia.jl. |
| TeXmacs/plugins/julia/julia/tmjl/protocol.jl | Introduces protocol constants and TeXmacs/Mogan framing helpers. |
| TeXmacs/plugins/julia/julia/tmjl/capture.jl | Implements stdout/stderr redirection and flushing to TeXmacs. |
| TeXmacs/plugins/julia/julia/tmjl/display.jl | Implements rich display routing (HTML/LaTeX/images) and symbolic-object formatting. |
| TeXmacs/plugins/julia/julia/tmjl/completion.jl | Implements tab-completion command parsing and Scheme tuple output. |
| TeXmacs/plugins/julia/julia/MoganJulia.jl | Removes the previous monolithic Julia plugin implementation. |
| TeXmacs/plugins/julia/julia/julia.jl | New plugin entrypoint wiring submodules + main REPL loop. |
| devel/0805.md | Developer documentation for this refactor and the added tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+53
to
+60
| display(d::InlineDisplay, m::MIME"image/png", x) = | ||
| sendimage("png", m, x) | ||
|
|
||
| display(d::InlineDisplay, m::MIME"image/jpeg", x) = | ||
| sendimage("jpg", m, x) | ||
|
|
||
| display(d::InlineDisplay, m::MIME"application/pdf", x) = | ||
| sendimage("pdf", m, x) |
Comment on lines
+97
to
+104
| const tm_mimetypes = [ | ||
| MIME("image/svg"), | ||
| MIME("application/pdf"), | ||
| MIME("image/png"), | ||
| MIME("image/jpg"), | ||
| MIME("text/latex"), | ||
| MIME("text/html"), | ||
| MIME("text/markdown")] |
Comment on lines
+22
to
+23
| compls = join(unique!(map(x -> "\"$(completion_text(x)[range.stop+2-range.start:end])\"",ret))," ") | ||
| tm_out("scheme:", "(tuple \"$(arg1[range])\" $(compls))") |
Comment on lines
+111
to
+112
| (let* ((julia-bin (if (os-windows?) "julia" "env -u LD_LIBRARY_PATH julia")) | ||
| (cmd (string-append julia-bin " --startup-file=no " julia-script " < " input-path " > " output-path " 2>&1"))) |
Comment on lines
+133
to
+134
| (let* ((julia-bin (if (os-windows?) "julia" "env -u LD_LIBRARY_PATH julia")) | ||
| (cmd (string-append julia-bin " --startup-file=no " julia-script " < " input-path " > " output-path " 2>&1"))) |
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.
[0805] 重构 Julia 代码结构 & 补充测试
1 相关文档
2 任务相关的代码文件
TeXmacs/plugins/julia/julia/julia.jl- 插件入口,主交互循环 (由原MoganJulia.jl重命名并重构)TeXmacs/plugins/julia/julia/tmjl/protocol.jl- 核心通信协议实现TeXmacs/plugins/julia/julia/tmjl/capture.jl- 标准输入输出流拦截重定向TeXmacs/plugins/julia/julia/tmjl/display.jl- 多媒体显示与符号对象自动 LaTeX 格式化TeXmacs/plugins/julia/julia/tmjl/completion.jl- Tab 自动补全驱动TeXmacs/plugins/julia/progs/init-julia.scm- 更新 Julia 启动入口脚本为julia.jlTeXmacs/plugins/julia/tests/runtests.jl- 80个 Julia 插件后端单元测试TeXmacs/tests/0801.scm- 13个 Julia 插件通用端到端集成测试TeXmacs/tests/0804.scm- 13个 Julia 插件符号计算端到端集成测试3 如何测试
3.1 确定性测试(集成/单元测试)
集成测试:
单元测试(确保环境中安装了 Julia):
3.2 非确定性测试(文档验证)
4 What
重构 Julia 后端插件支持的代码结构,并补充集成/单元测试。