Skip to content

IDE tools for writing pest grammars, using the Language Server Protocol for Visual Studio Code, Vim and other editors

License

Notifications You must be signed in to change notification settings

pest-parser/pest-ide-tools

Repository files navigation

Pest IDE Tools

IDE support for Pest, via the LSP.

This repository contains an implementation of the Language Server Protocol for the Pest parser generator.

Features

  • Error reporting.
  • Syntax highlighting.
  • Rename support.
  • Go to declaration/definition.
  • Find references.
  • Highlighting a rule highlights it's references.
  • Hover information for built-in rules.
  • Intellisense/completion of rule names.
  • Formatting.
  • Debugging window (as on the Pest website).

Supported IDEs

  • Visual Studio Code

Due to the usage of the LSP by this project, adding support for new IDEs should be far more achievable than a custom implementation for each editor.

Planned Support

  • Neovim.
  • Fleet, once it releases.

Development

This repository uses a Taskfile; I recommend installing the task command for a better experience developing in this repository.

The task fmt-and-lint can be used to format and lint your code to ensure it fits with the rest of the repository.

Architecture

The server itself is implemented in Rust. It contains several methods which are called by each editor extension upon important events. The server is packaged into a WASM module.

Each extension is implemented in the language that makes the most sense for its respective editor.

Contributing

We appreciate contributions! I recommend reaching out on Discord (the invite to which can be found at pest.rs) before contributing, to check with us.

Credits