OyvindSabo / gremlint

Linter/Code formatter for Gremlin
https://gremlint.com
Apache License 2.0
11 stars 6 forks source link

Initial horizontal position of query is not taken into account when determining if it should wrap #75

Closed OyvindSabo closed 3 years ago

OyvindSabo commented 3 years ago

Imagine that we want to format the following query with a max line length of 40:

List<Vertex> people = g.V().hasLabel("person").toList();

The expected result would be:

List<Vertex> people = g.V().
  hasLabel("person").
  toList();

Instead it is formatted like this:

List<Vertex> people = g.V().hasLabel("person").toList();

The problem is that when determining if the first line of the query should wrap, the fact that the query does not start at the beginning of the line is not taken into account.