A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/coder3101/protols below:

coder3101/protols: Language Server for protocol buffers

Protols - Protobuf Language Server


Protols is an open-source, feature-rich Language Server Protocol (LSP) for Protocol Buffers (proto) files. Powered by the efficient tree-sitter parser, Protols offers intelligent code assistance for protobuf development, including features like auto-completion, diagnostics, formatting, and more.

You can install Protols via mason.nvim, or install it directly from crates.io:

Then, configure it in your init.lua using nvim-lspconfig:

require'lspconfig'.protols.setup{}

Protols supports various command line options to customize its behavior:

protols [OPTIONS]

Options:
  -i, --include-paths <INCLUDE_PATHS>  Include paths for proto files, comma-separated
  -V, --version                        Print version information
  -h, --help                           Print help information

For example, to specify include paths when starting the language server:

protols --include-paths=/path/to/protos,/another/path/to/protos

If you're using Visual Studio Code, you can install the Protobuf Language Support extension, which uses this LSP under the hood.

Note: This extension is open source, but is not officially maintained by us.

Protols can be configured using a protols.toml file, which you can place in root of your project directory.

[config]
include_paths = ["foobar", "bazbaaz"] # Include paths to look for protofiles during parsing

[config.path]
clang_format = "clang-format"
protoc = "protoc"

The [config] section contains stable settings that should generally remain unchanged.

The [config.path] section contains path for various tools used by LSP.

Protols offers a rich set of features to enhance your .proto file editing experience.

Protols offers intelligent autocompletion for messages, enums, and proto3 keywords within the current package. Simply start typing, and Protols will suggest valid completions.

Syntax errors are caught by the tree-sitter parser, which highlights issues directly in your editor. More advanced error reporting, is done by protoc which runs after a file saved. You must have protoc installed and added to your path or you can specify its path in the configuration above

Format your .proto files using clang-format. To customize the formatting style, add a .clang-format file to the root of your project. Both document and range formatting are supported.

Protols provides a list of symbols in the current document, including nested symbols such as messages and enums. This allows for easy navigation and reference.

Jump directly to the definition of any custom symbol or imports, including those in other files or packages. This feature works across package boundaries.

Hover over any symbol or imports to get detailed documentation and comments associated with it. This works seamlessly across different packages and namespaces.

Rename symbols like messages or enums, and Propagate the changes throughout the codebase. Currently, field renaming within symbols is not supported.

Find all references to user-defined types like messages or enums. Nested fields are fully supported, making it easier to track symbol usage across your project.

We welcome contributions from developers of all experience levels! To get started:

  1. Fork the repository and clone it to your local machine.
  2. Create a new branch for your feature or fix.
  3. Run the tests to ensure everything works as expected.
  4. Open a pull request with a detailed description of your changes.
  1. Clone the repository:

    git clone https://github.com/coder3101/protols.git
    cd protols
  2. Build and test the project:

This project is licensed under the MIT License. See the LICENSE file for more details.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4