From d784e720274b2a9ced94aa6fcc703f53db132163 Mon Sep 17 00:00:00 2001 From: Charlie Egan Date: Mon, 23 Sep 2024 14:38:54 +0100 Subject: [PATCH] docs: Add Rego language (#18217) Release Notes: - N/A --------- Signed-off-by: Charlie Egan Co-authored-by: Charlie Egan Co-authored-by: Marshall Bowers --- docs/src/SUMMARY.md | 1 + docs/src/languages.md | 1 + docs/src/languages/rego.md | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 docs/src/languages/rego.md diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index 8bb8035c61..bb0c9d79f5 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -93,6 +93,7 @@ - [PureScript](./languages/purescript.md) - [Python](./languages/python.md) - [R](./languages/r.md) +- [Rego](./languages/rego.md) - [ReStructuredText](./languages/rst.md) - [Racket](./languages/racket.md) - [Roc](./languages/roc.md) diff --git a/docs/src/languages.md b/docs/src/languages.md index 7ec586f1f5..4bc6e7d3d7 100644 --- a/docs/src/languages.md +++ b/docs/src/languages.md @@ -45,6 +45,7 @@ Zed supports hundreds of programming languages and text formats. Some work out-o - [PureScript](./languages/purescript.md) - [Python](./languages/python.md) - [R](./languages/r.md) +- [Rego](./languages/rego.md) - [ReStructuredText](./languages/rst.md) - [Racket](./languages/racket.md) - [Roc](./languages/roc.md) diff --git a/docs/src/languages/rego.md b/docs/src/languages/rego.md new file mode 100644 index 0000000000..3709c6a1fe --- /dev/null +++ b/docs/src/languages/rego.md @@ -0,0 +1,38 @@ +# Rego + +Rego language support in Zed is provided by the community-maintained [Rego extension](https://github.com/StyraInc/zed-rego). + +- Tree Sitter: [FallenAngel97/tree-sitter-rego](https://github.com/FallenAngel97/tree-sitter-rego) +- Language Server: [StyraInc/regal](https://github.com/StyraInc/regal) + +## Installation + +The extensions is largely based on the [Regal](https://docs.styra.com/regal/language-server) language server which should be installed to make use of the extension. Read the [getting started](https://docs.styra.com/regal#getting-started) instructions for more information. + +## Configuration + +The extension's behavior is configured in the `.regal/config.yaml` file. The following is an example configuration which disables the `todo-comment` rule, customizes the `line-length` rule, and ignores test files for the `opa-fmt` rule: + +```yaml +rules: + style: + todo-comment: + # don't report on todo comments + level: ignore + line-length: + # custom rule configuration + max-line-length: 100 + # warn on too long lines, but don't fail + level: warning + opa-fmt: + # not needed as error is the default, but + # being explicit won't hurt + level: error + # files can be ignored for any individual rule + # in this example, test files are ignored + ignore: + files: + - "*_test.rego" +``` + +Read Regal's [configuration documentation](https://docs.styra.com/regal#configuration) for more information.