A Language Server Protocol (LSP) compliant analyzer for the P4 language.
ℹ Note
This project is very much a Work in Progress. Development is on-going and we're not even at Alpha quality yet. Our aim is to have a preview release in June. Please remember this when raising issues.
The analyzer is provided standalone (for integration with LSP clients supported in tools such as VIM and EMacs), or as an extension for Visual Studio Code that uses an in-built WebAssembly version of the analyzer. The Visual Studio Code extension can also be configured to use the standalone analyzer if required.
Both the standalone and WebAssembly based analyzer is built from the same code and aims to support all LSP features, including:
- Code Completion
- Find References
- Variable Information
- Diagnostics
- Jump to Definition
- Hover
To begin, you will requrie the following prerequisites:
-
Rust
If usingrustup
then the version configured in the rootrust-toolchain.toml
file will be installed.
This repository uses Nx as a build system. Once the above prerequisites have been installed, run the
following commands. This will install the required Node.js modules, build the Rust and TypeScript projects, and finally
produce a '.vsix'
package that can be installed into Visual Studio Code.
npm ci
npm run build
npm run package
ℹ Note
The repository can be built on both Linux and Windows platforms.
Looking to contribute? Read the Contributing to P4 Analyzer guide to get started, and read the Developer guide for insight into how the code is structured and put together.