asciidoctor/asciidoctor-intellij-plugin

Explain one-sentence-per-line to user

Aperta

#315 aperta il 8 ago 2019

 (1 commento) (1 reazione) (0 assegnatari)Java (155 fork)auto 404
enhancementgood first issue

Metriche repository

Star
 (392 stelle)
Metriche merge PR
 (Merge medio 4g 11h) (3 PR mergiate in 30 g)

Descrizione

Situation

When a user re-formats the AsciiDoc source for the first time, she/he might be surprised by the on-sentence-per-line wrapping.

Suggestion

An editor notification like EditorNotificationPanel for "JCEF could be enabled" (JCEFCouldBeEnabledNotificationProvider) or could show the moment a user first triggers a re-format that performs a reformat of one-sentence-per-line.

It could link to the plugin's documentation site explaining why this might be a good thing and where to disable it.

(this issue was created after a user's feedback in #314)

Good First Issue

This issue is labeled "good first issue", and maintainers are willing to help. Please comment in this ticket to exchange ideas how this could be implemented. Feel free to pair up with a maintainer to help when you don't know where to start if when you're stuck.

Find out more about how to contribute at "Contribute as a coder" in the Contributor's guide.

Implementation Idea

  1. The method AsciiDocFormattingBlock.getSpacing() is the one responsible for one-sentence-per-line. When calling Spacing.createSpacing() to define the spaces that should be used, it can check at the same time the current spaces being present via ((AsciiDocFormattingBlock) child1).getNode().getTreeNext().

  2. To communicate this to the NotificationProvider, the simplest way would be to call a (static) method on the notification provider. See AsciiDocDownloadNotificationProvider.showNotification() for an example.

Guida contributor