neueda / jetbrains-plugin-graph-database-support

Graph Databases support for JetBrains family IDEs.
Apache License 2.0
222 stars 56 forks source link

Reformat uglifies query and incorrectly interprets it. #72

Closed mjmare closed 5 years ago

mjmare commented 6 years ago

The code

MATCH p = ((head:Topic)<-[:FOLLOWS*]-(t:Topic))
WHERE NOT (head)-[:FOLLOWS]->(:Topic)
RETURN nodes(p), length(p)
ORDER BY length(p) DESC
LIMIT 1

is mangled by the plugin (v2.5) when doing a 'reformat code' to:

MATCH p = ((head:Topic) < - [:FOLLOWS *] -(t:Topic))
WHERE NOT (head)- [:FOLLOWS] - >(:Topic)

RETURN nodes(p), length(p)
  ORDER BY length(p) DESC
  LIMIT 1

Note the extra spaces, indents, and empty line. Also it is not recognised as a single query, so it cannot be run by the plugin.

FylmTM commented 6 years ago

Hi @mjmare ,

Thanks for report! We added card to fix this to our backlog. We will notify you in this issue, when we will have PR.

GreYko commented 5 years ago

Fixed and delivered in plugin v2.5.5. Should be available for updating soon.