open-policy-agent / opa-idea-plugin

Open Policy Agent plugin for IntelliJ
MIT License
56 stars 22 forks source link

Plugin does not recognize key value form of `every` #145

Open anderseknert opened 1 year ago

anderseknert commented 1 year ago

It seems like the plugin doesn't know about the key-value version of every, as it complains about the ,.

allow {
    every key, val in input {
        key == val
    }
}
dsorak commented 5 months ago

As of release 0.12.0, it seems to have trouble with the every syntax in general. The syntax highlighting/analysis fails to parse past the every statement and leaves the remainder of the file incorrectly highlighted.

gitolicious commented 5 months ago

Same here. The problem does not seem to be the every keyword itself though, but a multiline block within it. After a single line block, everything is still fine, see line 7-11 and the proper highlighting in line 13.

image

Same thing happens with some by the way, even though some is actually registered as a keyword.

https://github.com/open-policy-agent/opa-idea-plugin/blob/f67f7a8c059889e6f2ef6be7f5cbbd0793023ecd/src/main/grammar/Rego.bnf#L37