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

Error using expression inside of array index

Open anderseknert opened this issue 2 years ago • 4 comments
trafficstars

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

anderseknert avatar Apr 03 '23 10:04 anderseknert

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.

vgramer avatar Apr 10 '23 08:04 vgramer

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.

anderseknert avatar Apr 10 '23 09:04 anderseknert

I publish the new version of the plugin with support for the last IDE versions, it should be available after the JB team review.

vgramer avatar Apr 11 '23 08:04 vgramer

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.

anderseknert avatar Apr 11 '23 16:04 anderseknert