13 releases

0.3.11 Jun 7, 2024
0.3.9 Mar 27, 2024
0.3.6 Sep 17, 2023
0.3.3 May 4, 2023
0.2.0 Mar 17, 2023

#8 in Text editors

Download history 79/week @ 2024-08-01 71/week @ 2024-08-08 55/week @ 2024-08-15 49/week @ 2024-08-22 65/week @ 2024-08-29 39/week @ 2024-09-05 56/week @ 2024-09-12 72/week @ 2024-09-19 63/week @ 2024-09-26 66/week @ 2024-10-03 57/week @ 2024-10-10 47/week @ 2024-10-17 48/week @ 2024-10-24 40/week @ 2024-10-31 35/week @ 2024-11-07 49/week @ 2024-11-14

180 downloads per month

Apache-2.0

86KB
2K SLoC

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 rule names.
  • Inline and extract rules.
  • Full-unicode support.
  • Formatting.
  • Update checking.

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

Usage

You can find documentation on how to set up the server for in the DOCS.md file.

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.
    • The extension is also available on OpenVSX
  • Sublime Text
  • Vim
    • Vim support is provided via the pest.vim package.
  • Zed

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.

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. This is the only method of debugging that we have pre set-up.

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

Dependencies

~17–30MB
~437K SLoC