-
Notifications
You must be signed in to change notification settings - Fork 37
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
lsp/completions: No rego.v1 import when in v1 file #1327
Conversation
Also, use new version cache to determine version for formatting Signed-off-by: Charlie Egan <charlie@styra.com>
There was a problem hiding this 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 |
There was a problem hiding this comment.
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": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Also, use new version cache to determine version for formatting Signed-off-by: Charlie Egan <charlie@styra.com>
Also, use new version cache to determine version for formatting Signed-off-by: Charlie Egan <charlie@styra.com>
StyraInc#1327 (comment) Signed-off-by: Charlie Egan <charlie@styra.com>
StyraInc#1327 (comment) Signed-off-by: Charlie Egan <charlie@styra.com>
#1327 (comment) Signed-off-by: Charlie Egan <charlie@styra.com>
Also, use new version cache to determine version for formatting