ArangoDB-Community / aql-intellij-plugin

Intellij plugin for AQL, ArangoDB language support
Apache License 2.0
30 stars 4 forks source link

Bind parameters as function arguments result in syntax error #21

Closed sepbot closed 3 years ago

sepbot commented 3 years ago

Consider the following query, which executes without any issues on arangodb:

FOR record IN records
  FILTER HAS(record.haystack, @needle)
  RETURN record

It results in the following syntax error with the plugin where the comma appears right after record.haystack:

'(', ')', ',', '.' or '[' expected, got ','

Interesting note: the error doesn't make sense because it states expected comma but instead got comma 😄

If I use a bind parameter as a first argument instead I get a slightly different error message where the comma appears. The same error will appear regardless of whether the following arguments are bound or not.

'(', ')' or ',' expected, got ','

If I replace @needle with a double quoted string, the syntax error goes away.

I tried it with a bunch of different functions and it yielded the same result.

IDE: IntelliJ IDEA 2021.1.1 Plugin: 1.0.6-2020.3.2 ArangoDB: 3.7.11