v0.27.0
Debug Adapter Protocol Support
Back in #926 (v0.26.0), support was added for the Debug Adapter Protocol (DAP), based on the new OPA SDK added in #6876 (documentation). This release improves on this making it ready for consumption in clients. Namely, the addition of a new Debug Code Lens in #1103 and a bug fix for ast.ref_to_string
which brings the Regal implementation inline with OPA’s (#1106).
Please see our documentation here to get started.
Neovim DAP Support
Thanks to community member @rinx, DAP support is also available in the Neovim editor. This is based on nvim-dap, and @rinx’s own project nvim-dap-rego. This is an awesome contribution which represents an important improvement for Neovim users of Regal. Thank you Rintaro Okamura for all your work here, it is appreciated.
New Rule: comprehension-term-assignment
This rule flags cases where an intermediate assignment is used within a comprehension body when the value can be directly used as the comprehension term. It enforces the removal of redundant assignments, encouraging more concise and readable code.
# avoid
names := [name |
some user in input.users
name := user.name
]
# prefer
names := [user.name | some user in input.users]
Compiler Stage Source Explorer
A new Source Action has been added to allow users of compatible clients to explore the compiler stages of the Rego code they’re working on.
By integrating opa-explorer with Regal, it’s now possible to launch a web server to view the explorer output. Users will see a "Source Action" in the context menu of Rego files, which opens the explorer for that file. This feature is currently limited to VS Code due to available commands. Currently, only a single file is loaded into the explorer for compilation.
Source Action shown in VS Code
Browser showing the given file's compiler explorer
Test Flake Fixes
This release contains a number of fixes for flakey tests that have been disrupting the contributor experience. If you experience flakes and re-run checks on a PR, please leave a comment to let us know so we can look into it. #1112, #1102, #1101
Changelog
- b567b5d: Rule:
comprehension-term-assignment
(#1098) (@anderseknert) - da50d28: Add source action to explore compiler stages (#1096) (@anderseknert)
- a672964: lsp: Make length check of inlay hints fatal (#1101) (@charlieegan3)
- b4e5a8e: lsp: Update contents before diagnosticRequestFile (#1100) (@charlieegan3)
- d754094: Address races in test cases (#1102) (@charlieegan3)
- 822e42c: Add
Debug
Code Lens (#1103) (@anderseknert) - df31dda: More stringent ast.ref_to_string (#1106) (@anderseknert)
- ce26bbc: fix:
sprintf-arguments-mismatch
false positive when var used as format (#1107) (@anderseknert) - 67dc988: build(deps): bump peter-evans/create-pull-request from 7.0.1 to 7.0.2 (#1108) (@dependabot[bot])
- 7bf7685: docs/editor: write about nvim-dap (#1109) (@rinx)
- 03f14ff: build(deps): bump github/codeql-action from 3.26.6 to 3.26.7 (#1110) (@dependabot[bot])
- ba11c48: build(deps): bump peter-evans/create-pull-request from 7.0.2 to 7.0.3 (#1111) (@dependabot[bot])
- 06734bb: lsp: Address test concurrency issues (#1112) (@charlieegan3)
- f1606de: docs: Add docs for DAP support (#1113) (@charlieegan3)