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

ttl formatting not respecting comments in blank nodes. #4

Closed somanythings closed 3 years ago

somanythings commented 3 years ago

if i have something like this:

<some-iri>
  with:aPredicateToBlankNode [ a                :BlankNode ;
#                               some:commentedPO :commented 
                             ] ;

after applying formatting, i get

<some-iri>
  with:aPredicateToBlankNode [ a :BlankNode ;
                             #                               some:commentedPO :commented  ] ;

so the closing ]; is pulled up, behind the comment, breaking the file.

lunisolar commented 3 years ago

I see two issues with how plugin handled the comment in that fragment.

  1. The inclusion of the next line - closing bracket.
  2. The indent adjustment of the comment- It should not change.

I will try to investigate during the week how the fix looks like.

lunisolar commented 3 years ago

Due to the issues in other project I need to park this issue for few weeks.

lunisolar commented 3 years ago

At. 1 Fixed . Also fixed for lists: ( object+ ) - the same issue.

At 2. Formatting now will detect if comment starts at the beginning of a line (usually a effect of commenting a line by Ctrl-/ ) and does not indent such comment. Otherwise the comment is indented as usual. I wanted reproduce here similar behavior to Java.

Will be part of next release.