Static analysis of expl3 programs (2½): Status update and TeX language servers
Between family holiday, my wife’s trip to Кыргызстан, freelance work, and TUG 2024, I have had precious little time for the project since my previous post.
In the past month, I opened a repository with project documentation and I registered the expl3 prefix expltools
that will be used in the documentation and any other expl3 code.
Furthermore, at TUG 2024, I discussed neovim’s support for language servers with Michal Hoftich. Michal helped me realize that language servers are static analysis tools and that at least two language servers for TeX already exist: TeXLab and digestif. Both servers focus mainly on document markup and cannot analyse expl3 code. Therefore, they don’t meet the project requirements (yet). However, they are still related work and should be taken into consideration in the design of my tool.
Ideally, I would be able to contribute code to one of the language servers to make it work with expl3 code. This would likely be digestif, which is written in Lua and which already supports different TeX formats with different category codes such as LaTeX, ConTeXt, and plain TeX. Alternatively, if the scope is too different, reusing some code and design from the existing language servers should still save time. Regardless, my tool should either support the language server protocol (LSP) or be designed in a way that makes it easy to write an LSP wrapper for it. This way, my tool can be used not just from the command line but also to highlight errors in text editors.
In August, I plan to update the project requirements to include support for the LSP and a short section about related work. Then, I will analyze the requirements, discuss the design of the linter, and start the implementation.