A simple Language Server Protocol implementation using the vscode-languageserver library with TypeScript support.
- Live preview
- Inverse search
- Forward search following cursor
This is an experimental implementation of a Language Server Protocol (LSP) server wrapping around TeXpresso executable. See let-def/texpresso#36.
This is a "cheap" nodeJS implementation for quick and easy testing. However this could also still be fit for purpose in its final form since it is a pretty thin interface where the JavaScript is not responsible for much and what it is responsible for (JSON parsing and manipulation) is stuff that is well suited to (in terms of performance and ergonomics).
- Install TeXpresso, more specifically it needs to be built from this branch: https://github.com/lnay/texpresso/tree/utf-8.
- Make the
texpresso
executable available in your PATH, or make sure to specify its path in step 4. - Install the language server, either from this repo or just:
npm install -g texpresso-lsp
- Set up the editor to run the language server with
texpresso-lsp --stdio
with the following initialization options:
For zed
, just install the following extension instead of step 4 (and maybe 3 soon): https://github.com/lnay/zed-texpresso
The language server supports the following workspace settings that can be configured in your editor:
{
"texpresso.preview_follow_cursor": true // default: true
// Controls whether the preview window follows the cursor position
}
These settings can be changed at runtime and the language server will respond to configuration changes immediately.
- Install dependencies:
npm install
- Build the TypeScript code:
npm run build
- Run the server:
npm start
For development:
npm run dev