{"id":15044772,"url":"https://github.com/rinx/nvim-dap-rego","last_synced_at":"2026-01-26T12:07:06.188Z","repository":{"id":257204312,"uuid":"853625331","full_name":"rinx/nvim-dap-rego","owner":"rinx","description":"An nvim-dap extension for debugging OPA/Rego using StyraInc/regal","archived":false,"fork":false,"pushed_at":"2024-10-14T08:28:04.000Z","size":31,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-31T01:06:53.814Z","etag":null,"topics":["neovim","nvim-dap","opa","open-policy-agent","rego"],"latest_commit_sha":null,"homepage":"","language":"Fennel","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rinx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-07T04:18:54.000Z","updated_at":"2024-10-14T05:08:56.000Z","dependencies_parsed_at":"2024-09-15T09:45:41.584Z","dependency_job_id":"0a64b275-a952-487b-9fc9-f8a5b14af6f5","html_url":"https://github.com/rinx/nvim-dap-rego","commit_stats":null,"previous_names":["rinx/nvim-dap-rego"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rinx%2Fnvim-dap-rego","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rinx%2Fnvim-dap-rego/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rinx%2Fnvim-dap-rego/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rinx%2Fnvim-dap-rego/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rinx","download_url":"https://codeload.github.com/rinx/nvim-dap-rego/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237964417,"owners_count":19394391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["neovim","nvim-dap","opa","open-policy-agent","rego"],"created_at":"2024-09-24T20:51:01.068Z","updated_at":"2025-10-24T12:30:38.323Z","avatar_url":"https://github.com/rinx.png","language":"Fennel","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nvim-dap-rego\n\nnvim-dap-rego is an extension for nvim-dap, used for debugging OPA/Rego using Regal (https://github.com/StyraInc/regal).\nThis extension sets up adapter and basic configurations for debugging Rego policies.\n\nThis extension also provides Neovim LSP handlers for Regal Codelenses.\nIt is useful if you use Regal's LSP feature.\n\n## Install\n\nThis extension requires both nvim-dap and Regal (\u003e= 0.26.0).\n\nPlease install nvim-dap-rego as usual.\n\n- vim-plug\n\n```vim\nPlug 'rinx/nvim-dap-rego'\n```\n\n- Packer\n\n```lua\nuse {\n  \"rinx/nvim-dap-rego\"\n}\n```\n\n- lazy.nvim\n\n```lua\n{\n  \"rinx/nvim-dap-rego\"\n}\n```\n\n## Configurations\n\nTo use nvim-dap-rego, you'll need to set up it.\nThis is done by calling `setup()` function.\n\n```lua\nrequire('dap-rego').setup()\n```\n\nIt is possible to custom nvim-dap-rego behavior by passing a config table to this function.\n\n```lua\nrequire('dap-rego').setup(\n  {\n    -- here's show the default parameters\n\n    -- dap adapter name\n    adapter_name = \"regal-debug\",\n\n    -- enable dap features\n    -- if you want to use only `regal/showEvalResult` handler, it is recommended to set it to false\n    enable_dap_setup = true,\n\n    -- regal executable options\n    regal = {\n      -- the path to the regal executable\n      path = \"regal\",\n      -- the arguments that passed to regal executable\n      args = {\"debug\"},\n    },\n\n    -- default parameters that passed to pre-defined dap configurations\n    defaults = {\n      -- log level\n      log_level = \"info\",\n      -- automatically stop on entry, fail, result\n      stop_on_entry = true,\n      stop_on_fail = false,\n      stop_on_result = true,\n      -- enable logging for dap\n      trace = true,\n      -- enable print statements\n      enable_print = true,\n      -- enable rule indexing\n      rule_indexing = true,\n    },\n\n    -- additional dap configurations\n    configurations = {},\n\n    codelens_handler = {\n      -- register `regal/startDebugging` handler to Neovim LSP\n      -- this enables to start debugger by `Debug` codelens\n      start_debugging = true,\n      -- register `regal/showEvalResult` handler to Neovim LSP\n      show_eval_result = true,\n    },\n  }\n)\n```\n\n## LSP Handlers\n\nThis extension additionally provides Neovim LSP handlers for these Regal's Codelens features.\n\n![nvim-regal-codelens](https://github.com/user-attachments/assets/582162c5-de4c-42f0-bbff-12d106ac53d1)\n\n- Evaluate Codelens (`regal/showEvalResult`)\n    - Provides a feature to evaluate rules on the buffer.\n      This handler shows the evaluation result as virtual texts.\n    - Ref: https://docs.styra.com/regal/language-server#code-lenses-evaluation\n- Debug Codelens (`regal/startDebugging`)\n    - Provides a feature to provide a launch configuration about a rule or package.\n      This handler starts a new debug session by the provided configuration.\n    - Ref: https://github.com/StyraInc/regal/releases/tag/v0.27.0\n\nTo enable these features, it is needed to enable codelens features by setting `init_options`.\n\n```lua\nrequire'lspconfig'.regal.setup(\n  {\n    init_options = {\n      enableDebugCodelens = true,\n      evalCodelensDisplayInline = true,\n    },\n  }\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinx%2Fnvim-dap-rego","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frinx%2Fnvim-dap-rego","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frinx%2Fnvim-dap-rego/lists"}