axle lsp
axle lspStarts the language server for every axle.toml in the repository. An editor starts it and talks to it over standard input and output with the Language Server Protocol; you don’t run it yourself. The VS Code extension and the JetBrains plugin start it for you.
It gives the editor:
- Errors as you type. It reads the unsaved text the way
axle runreads the file, so it finds the same mistakes, with the same code and a link to the error’s message page. A plugin that fails while it reads the repository is a warning on its table in the rootaxle.toml, and everything else keeps working without that plugin’s projects. - Completion of keys and their values, such as
continue = "never", of task names independsOnandwith, such as^buildorweb#build, and of package names inimplicitDependencies. A package’saxle.tomlonly offers the keys it can have. - Hover: what a key does, and what a task reference such as
^buildor a[tasks.<name>]table runs in each package, with the task’s description. - Go to definition from a task reference or a
[tasks.<name>]table to the script inpackage.jsonor the command it runs, from a package inimplicitDependenciesto itspackage.json, and from a preset inextendsto its file.
It reads the repository when it starts and again whenever an axle.toml is saved. It also asks the editor to tell it when any package.json or axle.toml changes, and reads the repository again then, in editors that let a server watch files.
Other editors
Section titled “Other editors”Any editor with a language client can use it. Start axle lsp in the repository’s root for files named axle.toml. In Neovim:
vim.lsp.config('axle', { cmd = { 'axle', 'lsp' }, filetypes = { 'toml' }, root_markers = { 'axle.toml', 'package.json' },})vim.lsp.enable('axle')In Helix, in languages.toml:
[language-server.axle]command = "axle"args = ["lsp"]
[[language]]name = "toml"language-servers = ["taplo", "axle"]If axle isn’t on your PATH, use the path of the binary the repository installs, such as node_modules/.bin/axle.