eclipse-platform / eclipse.platform.ui

Eclipse Platform
https://projects.eclipse.org/projects/eclipse.platform
Eclipse Public License 2.0
81 stars 182 forks source link

[feature] Add support for indent lines in text editors #880

Open gayanper opened 2 years ago

gayanper commented 2 years ago

Today eclipse has whitespace char rendering but not indent lines in text editors. Adding indent lines will add lot of value into the text editor when working with structured text.

As discussed in this issue https://github.com/grosenberg/IndentGuide/issues/16#issuecomment-1203038964, The author is looking forward to contribute this feature.

@mickaelistria @vogella How can we proceed with this ?

vogella commented 2 years ago

Sounds great, please provide PR

grosenberg commented 1 year ago

Unfortunately, too many unknowns, given the parentage of the plugin's code, to be able to competently sign the ECA.

elsazac commented 9 months ago

Adding indent lines will add lot of value into the text editor when working with structured text.

@gayanper - I want to see if I can work on this. can you pls elaborate the requirement? which editor? text editor or generic text editor? I am already able to retain the indentation in the current line, deriving from the previous line. Or is the expectation / behaviour something else? thanks!

gayanper commented 9 months ago

I think starting with generic editor or the base component for all editors if possible might be a good idea. Ideally having this for editors which renders structured text based languages might add more value.

For example trying to add this to properties, manifest, plain text editors will not bring much value.

grosenberg commented 9 months ago

To correctly implement Indent Guides, the required changes must start with changing org.eclipse.ui.texteditor.AbstractTextEditor.

Examine, for example, all that is required to implement org.eclipse.jface.text.WhitespaceCharacterPainter, org.eclipse.ui.texteditor.ShowWhitespaceCharactersAction, etc. IndentGuide is an analogous IPainter. If memory serves, changes to files in the compare and other packages will be required (if guides are to be shown there too).

While the IndentGuide code has been recently rewritten to the point it can be contributed, I have neither the time nor experience to confidently make the kind of broad changes to the Eclipse code base that would be required for integration.

That said, for someone who has experience with making wide-ranging alterations to the code base (at the level of AbstractTextEditor) and driving the changes through QA, the task should be quite doable.

mickaelistria commented 9 months ago

While we can't do much for the time it takes, the Eclipse project doesn't mandate any initial experience to get started. The reviews will help getting feedback and grow the experience, until things get good to be merged in. As long as there is no new API introduced, I'd even claim that contributing to Eclipse Platform is simpler than contributing to some other plugins and doesn't require substantially more experience than maintaining any other Eclipse plugin.

grosenberg commented 9 months ago

JTBC, yes, no-one should be dissuaded from contributing, and Eclipse is welcoming to initial contributors.

That said, to caution about the complexity of a task is not the same as cautioning against making the effort.

The changes required for integration range across many different foundational packages with stability and performance implications, as would be expected for an IPainter addition.

I have already spent the time and effort to rewrite the IndentGuide code so that the fundamental components can be properly contributed. I will provide guidance, to the extent I can, to anyone willing to undertake the task.