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

Completions: add suggestions for vars in local scope #792

Closed
anderseknert opened this issue Jun 4, 2024 · 1 comment · Fixed by #840
Closed

Completions: add suggestions for vars in local scope #792

anderseknert opened this issue Jun 4, 2024 · 1 comment · Fixed by #840

Comments

@anderseknert
Copy link
Member

This one might be trickier to do, but certainly helpful!

allow if {
    rules_with_annotations := [
        # ... some processing here
    ]

    # should suggest "rules_with_annotations"
    r|

    # should suggest "rules_with_annotations"
    count(r|
}
@anderseknert
Copy link
Member Author

We have some functions that does a best effort to determine which vars are in scope in Regal on the Rego side already, so perhaps this provider could make use of that.

@anderseknert anderseknert changed the title Competions: add suggestions for vars in local scope Completions: add suggestions for vars in local scope Jun 13, 2024
@anderseknert anderseknert self-assigned this Jun 13, 2024
anderseknert added a commit that referenced this issue Jun 17, 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 #792

Signed-off-by: Anders Eknert <anders@styra.com>
anderseknert added a commit that referenced this issue Jun 17, 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 #792

Signed-off-by: Anders Eknert <anders@styra.com>
srenatus pushed a commit to srenatus/regal that referenced this issue 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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant