opa-idea-plugin
opa-idea-plugin copied to clipboard
Error using expression inside of array index
Could be the problem is more generic that this, but the plugin currently flags this line on the -1 location, which should be valid Rego.
is_path(path, x) := path[count(path) - 1] == x
Hey @anderseknert, i can not reproduce this one. if it's a parsing problem (the plugin flags your file as invalid with an error pointing on -1 location ), may you provide me the complete rego file? Otherwise, give me instructions to reproduce it.
Hey @vgramer 👋 It looks like the plugin is missing support for the latest IDEA / Goland, so I'm unable to test this currently. Is that fix about to be pushed? Once it is, I'll come back to this and will try and provide a reproducible example, or close if it's not present.
I publish the new version of the plugin with support for the last IDE versions, it should be available after the JB team review.
Thanks for the update! 👍 It's still flagged as an error for me. This is probably the simplest case to reproduce:
package p
import future.keywords.if
foo if input[1 - 1]
Obviously a nonsensical policy, but it's a valid one. The - is shown as an error though.