Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error using expression inside of array index #146

Open
anderseknert opened this issue Apr 3, 2023 · 4 comments
Open

Error using expression inside of array index #146

anderseknert opened this issue Apr 3, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@anderseknert
Copy link
Member

anderseknert commented Apr 3, 2023

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 anderseknert added the bug Something isn't working label Apr 3, 2023
@vgramer vgramer self-assigned this Apr 3, 2023
@vgramer
Copy link
Member

vgramer commented Apr 10, 2023

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.

@anderseknert
Copy link
Member Author

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.

@vgramer
Copy link
Member

vgramer commented Apr 11, 2023

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

@anderseknert
Copy link
Member Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants