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: rule head (if, contains, etc) improvements #811

Closed
anderseknert opened this issue Jun 8, 2024 · 0 comments · Fixed by #836
Closed

Completions: rule head (if, contains, etc) improvements #811

anderseknert opened this issue Jun 8, 2024 · 0 comments · Fixed by #836
Labels

Comments

@anderseknert
Copy link
Member

As this will be one of the more common completion suggestions, I think it's worth spending some time making it perfect.

Currently both the if and contains completions require the user to type i or c respectively to show up. Since there isn't much else that can follow a rule name, we should just suggest them already after the first whitespace. This would also help people new to Rego know what's possible at that location, without having to know about if or contains. On that note — we should add some docs on both of those keywords to show up in the suggestions! So that you can learn as you type.

there isn't much else that can follow a rule name

The one (?) exception is of course :=, which we should also add a suggestion for, with an explanation that is the value returned by the rule if evaluation succeeds.

@anderseknert anderseknert changed the title Completions: rule head (if, contains`, etc) improvements Completions: rule head (if, contains, etc) improvements Jun 8, 2024
charlieegan3 added a commit to charlieegan3/regal that referenced this issue Jun 13, 2024
This handles the manual trigger case better.

Fixes StyraInc#811

Signed-off-by: Charlie Egan <[email protected]>
charlieegan3 added a commit to charlieegan3/regal that referenced this issue Jun 13, 2024
This handles the manual trigger case better.

Fixes StyraInc#811

Signed-off-by: Charlie Egan <[email protected]>
anderseknert pushed a commit that referenced this issue Jun 13, 2024
This handles the manual trigger case better.

Fixes #811

Signed-off-by: Charlie Egan <[email protected]>
srenatus pushed a commit to srenatus/regal that referenced this issue Oct 1, 2024
This handles the manual trigger case better.

Fixes StyraInc#811

Signed-off-by: Charlie Egan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant