{"id":23773850,"url":"https://github.com/styrainc/zed-rego","last_synced_at":"2026-02-14T16:03:35.898Z","repository":{"id":313613902,"uuid":"1038268334","full_name":"StyraInc/zed-rego","owner":"StyraInc","description":null,"archived":false,"fork":false,"pushed_at":"2025-08-14T22:56:46.000Z","size":2080,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-22T00:36:52.747Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/StyraInc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"docs/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"docs/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"docs/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-08-14T22:37:54.000Z","updated_at":"2025-08-14T22:38:10.000Z","dependencies_parsed_at":"2025-09-07T10:35:08.328Z","dependency_job_id":"ce4c0019-d747-46b7-b441-8436845b2743","html_url":"https://github.com/StyraInc/zed-rego","commit_stats":null,"previous_names":["styrainc/zed-rego"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/StyraInc/zed-rego","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraInc%2Fzed-rego","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraInc%2Fzed-rego/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraInc%2Fzed-rego/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraInc%2Fzed-rego/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StyraInc","download_url":"https://codeload.github.com/StyraInc/zed-rego/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StyraInc%2Fzed-rego/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29448969,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-quality","developer-experience","editor","opa","open-policy-agent","policy-as-code","regal","rego","zed"],"created_at":"2025-01-01T05:45:51.833Z","updated_at":"2026-02-14T16:03:35.881Z","avatar_url":"https://github.com/StyraInc.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Zed Rego Extension\n\n[![Build Status](https://github.com/styrainc/zed-rego/workflows/Build/badge.svg)](https://github.com/styrainc/zed-rego/actions)\n\nZed extension for the Rego policy language from [Open Policy Agent](https://github.com/open-policy-agent/opa/) (OPA).\n\n![usage of the extension](./docs/usage.gif)\n\nSee the blog\n[introducing the zed-rego extension](https://www.styra.com/blog/introducing-the-rego-extension-for-the-zed-editor/)\nif you want to learn more about the background and motivation for this extension, as well as a detailed overview of its\nfeatures.\n\n## Features\n\n### Rego Syntax Support\n\nBasic features like syntax highlighting and indentation works out of the box. More advanced features are provided\nby [Regal](https://github.com/styrainc/regal).\n\n### Regal Language Server Support\n\nThis extension uses the Regal language server for Rego to provide most of its\nfunctionality. The following features of the language server are currently supported:\n\n- [x] Diagnostics (linting)\n- [x] Hover (inline docs on built-in functions)\n- [x] Go to definition (cmd + click on a reference to go to definition)\n- [x] Folding ranges (expand/collapse blocks, imports, comments)\n- [x] Document and workspace symbols (cmd+t to navigate to rules, functions, packages)\n- [x] Inlay hints (but may need to be enabled in settings \"Toggle inlay hints\")\n- [x] Formatting\n- [x] Code actions\n- [x] Code completion\n- [ ] Code lenses (click to evaluate package or rule) - not yet supported by Zed\n\nTo learn more about each language server feature provided, see the\nRegal [language server](https://docs.styra.com/regal/language-server) documentation.\n\n## Installation\n\nThis extension is available in the Zed extension marketplace, and you'll find it by searching for \"rego\" in the\nextensions view.\n\nSince the extension makes use of [Regal](https://github.com/styrainc/regal) for language server features, the extension\nwill automatically try to download the latest version of Regal to use, unless the `regal` binary is found on `$PATH`.\n\nIf you want to have updates of Regal managed automatically, you can use Homebrew to install the `regal` binary instead\n(MacOS \u0026 Linux):\n\n```shell\nbrew install styrainc/packages/regal\n```\n\n## Tasks\n\nThis extension additionally provides two [tasks](https://zed.dev/docs/tasks) for running tests. Note that both of the\ntasks assume that the workspace can be read as a bundle (similarly to what the\n[OPA extension for VS Code](https://marketplace.visualstudio.com/items?itemName=tsandall.opa) expects).\n\n### opa test (workspace)\n\nRuns all tests found in the workspace. This is a normal task made available in the command palette (`task: spawn`).\n\n### opa test (single test)\n\nThis is a special task (called a _runnable_) which is made available inside of test packages, and\nwhere a \"play\" button will appear next to any test rule. Pressing this button will run only that test.\n\n### opa eval ?\n\nThe `opa eval` command requires a query containing the full path to what should be evaluated. This is commonly the\npackage path + the name of the rule to be evaluated. While we can use a tree-sitter query to extract the rule name —\nlike we do for running single tests — we have yet to understand if it's possible / how to extract both the package\npath and the rule name and concatenate them to build a query.\n\nYou can however easily create a [custom task](#custom-tasks) for `opa eval` where you provide the query yourself, and\nuse that in your project. Such a task may look something like the example below:\n\n**.zed/tasks.json**\n```json\n[\n  {\n    \"label\": \"opa eval (data.policy.main)\",\n    \"command\": \"opa\",\n    \"args\": [\"eval\", \"--bundle\", \"$ZED_WORKTREE_ROOT\", \"--input\", \"$ZED_WORKTREE_ROOT/input.json\", \"data.policy.main\"],\n  }\n]\n```\n\n## Custom Tasks\n\nSee the Zed documentation [tasks](https://zed.dev/docs/tasks) for information about how to easily add your own custom\ntasks, either globally or to a specific project. These docs also details which environment variables are available in\nthe task execution context.\n\n## Development\n\nSee the docs on [contributing](docs/CONTRIBUTING.md) if you're interested in hacking on this extension.\n\n## Credits\n\n- Tree-sitter grammar provided by the [tree-sitter-rego](https://github.com/FallenAngel97/tree-sitter-rego) project\n- Language server for Rego provided by [Regal](https://github.com/StyraInc/regal)\n\n## Community\n\nFor questions, discussions and announcements related to Styra products, services and open source projects, please join\nthe Styra community on [Slack](https://inviter.co/styra)!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyrainc%2Fzed-rego","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstyrainc%2Fzed-rego","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstyrainc%2Fzed-rego/lists"}