lunisolar / LNKD.tech-Editor

Editor for Turtle (Terse RDF Triple Language, TTL) files. This is a plugin for IntelliJ IDEA, IDEA Community Edition and others IDE environments based on IntelliJ Platform (also described here)
https://plugins.jetbrains.com/plugin/12802-lnkd-tech-editor
4 stars 0 forks source link

Support new Alignment style for predicates #42

Closed NicoMakowe closed 1 year ago

NicoMakowe commented 2 years ago

As a developer I'd like to have the possibility to format Turtles with a consistent indentation of 4 spaces.

The current formatter supports two Alignments for Predicates:

  1. No new line after subject and vertical alignment of following predicates
ex:Alice a ex:Person ;
         ex:knows ex:Bob ;
         ex:likes ex:Claire .

ex:Bob a ex:Person ;
       ex:likes ex:Alice ;
       ex:knows ex:Claire .
  1. New line after subject and no vertical indentation
    ex:Alice 
    a ex:Person ;
    ex:knows ex:Bob ;
    ex:likes ex:Claire .

    Many developers don't like the first alignment style because the predicate lists won't be aligned with other predicate lists. The second one is also not perfect because one could easily confuse subjects, predicates and objects.

I would like to have an alignment method where the predicates in a new line have always the indentation that the user selected (e.g., 4 spaces)

ex:Alice a ex:Person ;
    ex:knows ex:Bob ;
    ex:likes ex:Claire .

This feature could also be expanded with object lists. Every object should then have a indentation of 8 spaces.

jak-ub commented 1 year ago

I think that same indent for all predicates is good idea. And I actually prefer this option. Including the objects. For the moment I need to fight with #37, but I will get back to this ticket.

jak-ub commented 1 year ago

TODO:

jak-ub commented 1 year ago

Pending release.