feat(compiler): add TeXpresso integration#3267
Conversation
Add a VimTeX compiler backend for TeXpresso, a live-rendering LaTeX tool that updates the preview incrementally as the buffer changes. The backend communicates with TeXpresso through its JSON protocol over stdio and supports SyncTeX forward/inverse search, quickfix integration, and live buffer synchronization. Neovim buffer synchronization is handled through lua/vimtex/compiler/texpresso.lua. This revives the work from PR lervag#2975 and addresses the main review comments from that discussion: - Move the Neovim buffer-attach Lua code to lua/vimtex/compiler/texpresso.lua, with type annotations and a defensive check for compiler state during shutdown or reload. - Add documentation in doc/vimtex.txt modeled on the existing compiler backend sections, including a Requirements block and option docs. - Internalize the required -json and -lines flags so users cannot accidentally break the protocol by editing g:vimtex_compiler_texpresso. - Normalize passed_options spacing in __build_cmd with trim() so the function is robust regardless of whether the caller includes a leading space. - Add a stdin_pipe flag to the compiler template so that only TeXpresso enables stdin piping for its job, rather than changing the default for all continuous compiler backends. - Register texpresso in the valid compiler methods list in compiler.vim. - Add tests (test/test-compiler-texpresso/): - Unit tests (`make` / `make vim`) verify stdin_pipe, continuous mode, __build_cmd output, and passed_options spacing without requiring TeXpresso to be installed. These run under both Neovim and Vim. - Integration smoke test (`make integration`) starts a real TeXpresso process under Neovim, sends a reload message, and verifies that it stops cleanly. Note: I'm a bit unfamiliar with the vim codebase, so additional tests may be needed; however, neovim has been tested. Co-Authored-By: Tsung-Ju Chiang <71379180+tsung-ju@users.noreply.github.com>
There was a problem hiding this comment.
Thanks! This seems to be a good PR, and I only have a couple of minor code comments.
Note: I'm a bit unfamiliar with the vim codebase, so additional tests may be needed; however, neovim has been tested.
Thanks! I can probably test this with Vim when I get the time. I'm assuming that it should be easy to install texpresso on Arch Linux (which seems to be the case).
Is there anything specific you would advice me to test before accepting this?
|
If the PR is ever merged, it should resolve #3262. |
Open stdin for continuous Neovim compiler jobs that declare stdin_pipe, and cover live edit propagation with protocol tests.
|
Thanks for the updates! You're a person of few words; should I consider the PR ready for merge from your side? |
|
Omg, sorry, for some reason I didn't read the previous comment.
It would do wonders for me if you can confirm that vim works fine with this compiler. I tested it a bit, but honestly, I feel like you would have more experience on this compiler backend stuff. Other than that, I do think it's ready to merge. |
|
Great! I'll test it with Vim as soon as I get the time, then merge this after (unless I find a surprising glaring issue). I assume you agree that this resolves #3262? |
|
Yes! Though I only tested it on one large file. I think it did it's job! |
|
I've tested with Vim, and it seems to work fine. Thanks for your contribution! |
Add a VimTeX compiler backend for TeXpresso, a live-rendering LaTeX tool that updates the preview incrementally as the buffer changes. The backend communicates with TeXpresso through its JSON protocol over stdio and supports SyncTeX forward/inverse search, quickfix integration, and live buffer synchronization. Neovim buffer synchronization is handled through lua/vimtex/compiler/texpresso.lua.
This revives the work from PR #2975 and addresses the main review comments from that discussion:
make/make vim) verify stdin_pipe, continuous mode, __build_cmd output, and passed_options spacing without requiring TeXpresso to be installed. These run under both Neovim and Vim.make integration) starts a real TeXpresso process under Neovim, sends a reload message, and verifies that it stops cleanly.Note: I'm a bit unfamiliar with the vim codebase, so additional tests may be needed; however, neovim has been tested.
Co-Authored-By: Tsung-Ju Chiang 71379180+tsung-ju@users.noreply.github.com