Skip to content

Commit

Permalink
lsp/completions: Reorder for cheap rego.v1 check (#1335)
Browse files Browse the repository at this point in the history
#1327 (comment)

Signed-off-by: Charlie Egan <charlie@styra.com>
  • Loading branch information
charlieegan3 authored Jan 14, 2025
1 parent 351b5bb commit d9ba656
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bundle/regal/lsp/completion/providers/regov1/regov1.rego
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import data.regal.lsp.completion.location
# METADATA
# description: completion suggestion for rego.v1
items contains item if {
input.regal.context.rego_version != 3 # the rego.v1 import is not used in v1 rego (3)
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

position := location.to_position(input.regal.context.location)
line := input.regal.file.lines[position.line]
Expand Down

0 comments on commit d9ba656

Please sign in to comment.