This section helps you install and configure the Noir Language Server.
The Server component is provided by the Nargo command line tool that you installed at the beginning of this guide. As long as Nargo is installed and you've used it to run other commands in this guide, it should be good to go!
If you'd like to verify that the
nargo lsp command is available, you can run
nargo --help and look for
lsp in the list of commands. If you see it, you're using a version of Noir with LSP support.
The Client component is usually an editor plugin that launches the Server. It communicates LSP messages between the editor and the Server. For example, when you save a file, the Client will alert the Server, so it can try to compile the project and report any errors.
When you language server is running correctly and the VSCode plugin is installed, you should see handy codelens buttons for compilation, execution, and tests:
- Noir: Enable LSP - If checked, the extension will launch the Language Server via
nargo lspand communicate with it.
- Noir: Nargo Flags - Additional flags may be specified if you require them to be added when the extension calls
- Noir: Nargo Path - An absolute path to a Nargo binary with the
lspcommand. This may be useful if Nargo is not within the
PATHof your editor.
- Noir > Trace: Server - Setting this to
"verbose"will log LSP messages between the Client and Server. Useful for debugging.