p4lang / p4analyzer

A Language Server Protocol (LSP) compliant analyzer for the P4 language
Apache License 2.0
19 stars 3 forks source link
lsp lsp-server p4 p4lang

P4 Analyzer

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:

Building the P4 Analyzer

To begin, you will requrie the following prerequisites:

Building using Nx

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.

Contributing

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.