Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Format code action (and the rego v1 formatting action) should report errors from formatting #944

Closed
anderseknert opened this issue Jul 29, 2024 · 0 comments · Fixed by #955
Labels
bug Something isn't working language server protocol

Comments

@anderseknert
Copy link
Member

package p

allow {
    re_match("foo", "bar")
}

Formatting this for Rego v1 using the command line:

opa fmt --rego-v1 -w policy
failed to format Rego source file: 1 error occurred: p.rego:4: rego_type_error: deprecated built-in function calls in expression: re_match

However, when trying to do this via LSP code actions, no error is reported back and the file is simply left unchanged.

I assume the same goes for the "normal" (non-v1) formatter too, but it might be tricky to have it produce errors that aren't parse errors.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working language server protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant