Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Allow Evaluate code lens backend to send coverage data #1097

Open
anderseknert opened this issue Sep 10, 2024 · 1 comment
Open

Allow Evaluate code lens backend to send coverage data #1097

anderseknert opened this issue Sep 10, 2024 · 1 comment

Comments

@anderseknert
Copy link
Member

While sprinkling some print calls here and there is often enlightening, having Regal (perhaps optionally) return coverage data from evaluation would allow clients to decorate evaluated expressions, similar to what's done in the VS Code OPA extension client side today, or in the Rego Playground.

@anderseknert anderseknert changed the title Allow Evaluate code lens backend to send coverage Allow Evaluate code lens backend to send coverage data Sep 10, 2024
@anderseknert
Copy link
Member Author

So, this one turned out to be more... interesting than I had imagined. After setting up the plumbing to look into this, I was surprised to see that the coverage always came back as empty / zero for all values of covered / not covered. Turns out that the tracer that records coverage relies heavily on the File attribute having a set value on Location structs all over the AST. We have of course wiped that information since way back, as duplicating the same string on all AST nodes across an entire file is an enormous waste of resources. I think we're going to have to implement our own coverage tracer in order to make this work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant