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

lsp/completions: No rego.v1 import when in v1 file #1327

Merged

Conversation

charlieegan3
Copy link
Member

Also, use new version cache to determine version for formatting

Also, use new version cache to determine version for formatting

Signed-off-by: Charlie Egan <charlie@styra.com>
Copy link
Member

@anderseknert anderseknert left a comment

Choose a reason for hiding this comment

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

Looks good! Thanks 😃

@@ -11,6 +11,7 @@ import data.regal.lsp.completion.location
# description: completion suggestion for rego.v1
items contains item if {
not strings.any_prefix_match(input.regal.file.lines, "import rego.v1")
not input.regal.context.rego_version == 3 # the rego.v1 import is not used in v1 rego
Copy link
Member

Choose a reason for hiding this comment

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

I'd put this first as it's the cheaper check.. but no big deal.


# METADATA
# description: same as input_with_location but with option to set rego_version too
input_with_location_and_version(policy, location, rego_version) := {"regal": {
Copy link
Member

Choose a reason for hiding this comment

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

👍

@anderseknert anderseknert merged commit 128c92b into StyraInc:opa1.0 Jan 9, 2025
5 checks passed
anderseknert pushed a commit that referenced this pull request Jan 9, 2025
Also, use new version cache to determine version for formatting

Signed-off-by: Charlie Egan <charlie@styra.com>
anderseknert pushed a commit that referenced this pull request Jan 13, 2025
Also, use new version cache to determine version for formatting

Signed-off-by: Charlie Egan <charlie@styra.com>
charlieegan3 added a commit to charlieegan3/regal that referenced this pull request Jan 14, 2025
StyraInc#1327 (comment)

Signed-off-by: Charlie Egan <charlie@styra.com>
charlieegan3 added a commit to charlieegan3/regal that referenced this pull request Jan 14, 2025
StyraInc#1327 (comment)

Signed-off-by: Charlie Egan <charlie@styra.com>
charlieegan3 added a commit that referenced this pull request Jan 14, 2025
#1327 (comment)

Signed-off-by: Charlie Egan <charlie@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.

2 participants