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

Completion suggestions for variables in local scope #840

Merged
merged 1 commit into from
Jun 17, 2024

Conversation

anderseknert
Copy link
Member

This is the first provider that is using Rego policy to determine suggestions!

That makes the PR more extensive than normally, but much of this will be reusable for future providers, or even existing ones we may choose to convert.

Fixes #792

This is the first provider that is using Rego policy to determine suggestions!

That makes the PR more extensive than normally, but much of this will be reusable
for future providers, or even existing ones we may choose to convert.

Fixes #792

Signed-off-by: Anders Eknert <anders@styra.com>
func TestPolicyProvider(t *testing.T) {
t.Parallel()

locals := NewPolicy()
Copy link
Member

@charlieegan3 charlieegan3 Jun 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if there's a way here to make it so that only one of the Rego providers is run, so that when we have more, testing them individually is easier.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Rego providers are "all" (well, in the future anyway) thoroughly tested in Rego. What we do here should be closer to an integration test... but you're still right — it'd be good to be able to have at least a very basic such test for each provider. Let's look into that as we add more.

Copy link
Member

@charlieegan3 charlieegan3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really great! Looking forward to seeing which of the other providers we can migrate to it, too.

@anderseknert anderseknert merged commit fb0250c into main Jun 17, 2024
3 checks passed
@anderseknert anderseknert deleted the locals-completions branch June 17, 2024 10:03
srenatus pushed a commit to srenatus/regal that referenced this pull request Oct 1, 2024
This is the first provider that is using Rego policy to determine suggestions!

That makes the PR more extensive than normally, but much of this will be reusable
for future providers, or even existing ones we may choose to convert.

Fixes StyraInc#792

Signed-off-by: Anders Eknert <anders@styra.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Completions: add suggestions for vars in local scope
2 participants