opa-idea-plugin icon indicating copy to clipboard operation
opa-idea-plugin copied to clipboard

Plugin does not recognize key value form of `every`

Open anderseknert opened this issue 2 years ago • 2 comments

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
	}
}

anderseknert avatar Mar 31 '23 18:03 anderseknert

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.

dsorak avatar Mar 12 '24 15:03 dsorak

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

gitolicious avatar Apr 04 '24 14:04 gitolicious