Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rinx/nvim-dap-rego
An nvim-dap extension for debugging OPA/Rego using StyraInc/regal
https://github.com/rinx/nvim-dap-rego
neovim nvim-dap opa open-policy-agent rego
Last synced: 3 months ago
JSON representation
An nvim-dap extension for debugging OPA/Rego using StyraInc/regal
- Host: GitHub
- URL: https://github.com/rinx/nvim-dap-rego
- Owner: rinx
- License: unlicense
- Created: 2024-09-07T04:18:54.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-15T12:31:23.000Z (4 months ago)
- Last Synced: 2024-09-27T18:21:49.898Z (3 months ago)
- Topics: neovim, nvim-dap, opa, open-policy-agent, rego
- Language: Fennel
- Homepage:
- Size: 10.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nvim-dap-rego
nvim-dap-rego is an extension for nvim-dap, used for debugging OPA/Rego using Regal (https://github.com/StyraInc/regal).
This extension sets up adapter and basic configurations for debugging Rego policies.## Install
This extension requires both nvim-dap and Regal (>= 0.26.0).
Please install nvim-dap-rego as usual.
- vim-plug
```vim
Plug 'rinx/nvim-dap-rego'
```- Packer
```lua
use {
"rinx/nvim-dap-rego"
}
```- lazy.nvim
```lua
{
"rinx/nvim-dap-rego"
}
```## Configurations
To use nvim-dap-rego, you'll need to set up it.
This is done by calling `setup()` function.```lua
require('dap-rego').setup()
```It is possible to custom nvim-dap-rego behavior by passing a config table to this function.
```lua
require('dap-rego').setup(
{
-- here's show the default parameters-- dap adapter name
adapter_name = "regal-debug",-- regal executable options
regal = {
-- the path to the regal executable
path = "regal",
-- the arguments that passed to regal executable
args = {"debug"},
},-- default parameters that passed to pre-defined dap configurations
defaults = {
-- log level
log_level = "info",
-- automatically stop on entry, fail, result
stop_on_entry = true,
stop_on_fail = false,
stop_on_result = true,
-- enable logging for dap
trace = true,
-- enable print statements
enable_print = true,
-- enable rule indexing
rule_indexing = true,
},-- additional dap configurations
configurations = {},codelens_handler = {
-- register `regal/startDebugging` handler to Neovim LSP
-- this enables to start debugger by `Debug` codelens
start_debugging = true,
},
}
)
```