Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>Pest IDE ToolsNew to Visual Studio Code? Get it now.

Pest IDE Tools

pest

|
268 installs
| (1) | Free
Tools for the Rust-based Pest parser generator
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Pest IDE Tools

IDE support for Pest, via the LSP.

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

A demo of the Pest VSCode extension.

Features

  • Error reporting.
  • Warnings for unused rules.
  • Syntax highlighting definitions available.
  • Rename rules.
  • Go to rule declaration, definition, or references.
  • Hover information for built-in rules and documented rules.
  • Autocompletion of defined rule names.
  • Formatting.
  • Update checking.

Please see the issues page to suggest features or view previous suggestions.

Usage

Supported IDEs

  • Visual Studio Code
    • VSCode has a pre-built extension that can compile, update, and start up the language server. It also includes syntax highlighting definitions.

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. Please see the tracking issue to request support for another IDE or view the current status of IDE support.

Config

The method of updating your config is editor specific.

The available options are:

{
  // Set a custom path to a Pest LS binary.
  "pestIdeTools.serverPath": "/path/to/binary",
  // Check for updates to the Pest LS binary via crates.io
  "pestIdeTools.checkForUpdates": true,
  // Ignore specific rule names for the unused rules diagnostics (useful for specifying root rules)
  "pestIdeTools.alwaysUsedRuleNames": [
    "rule_one",
    "rule_two"
  ]
}

Development

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

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

In VSCode, press F5 to build and debug the VSCode extension.

Architecture

The server itself is implemented in Rust using tower-lsp. It communicates with editors via JSON-RPC through standard input/output, according to the language server protocol.

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

  • OsoHQ, for their blog post, and open source code which was used as inspiration.
  • Stef Gijsberts for their Pest syntax highlighting TextMate bundle which is used in this extension under the MIT license.
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft