Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 333987 - [Formatter/api] clean up FormattingConfigBasedStream an allow custom formatting rules
Summary: [Formatter/api] clean up FormattingConfigBasedStream an allow custom formatti...
Status: CLOSED WONTFIX
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext Backlog (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-11 10:21 EST by Moritz Eysholdt CLA
Modified: 2016-07-21 05:04 EDT (History)
2 users (show)

See Also:
moritz.eysholdt: indigo+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Moritz Eysholdt CLA 2011-01-11 10:21:48 EST
The implementation of FormattingConfigBasedStream needs to be seriously cleand up since everybody who is not satisfied with the formatters builtin capabilities needs to customize this behavior. 

Furthermore, the API for formatting rules should be extended so that custom formatting rules can be implemented. 

A formatting rule is basically an object that can be registered for a certain position in the grammar. During formatting, when this position in the grammar is being hit, this object is passed to the FormattingConfigBasedStream so that formatting can "act" according to this rule. This mechanism is already implemented, however, not to be extensible.
Comment 1 Mary Komor CLA 2011-04-26 17:25:23 EDT
Are there any plans to fix this for v2.0?

I am trying to get the formatter to indent wrapped lines, but it's not simple
to do with the current FormattingConfigBasedStream. I have to get to
FormattingConfigBasedStream.Line.flushLine() and there is no easy way to do it.
I tried extending/overriding, but I end up overriding most of
FormattingConfigBasedStream -- which ends up looking more like a copy of
FormattingConfigBasedStream with some minor changes. 

I've also had some challenges with enabling user level custom formatting. See
my post in the forum: 
http://www.eclipse.org/forums/index.php?t=msg&th=207769&start=0&S=baf1586abcd94cd412e7a4007b11a3d8
Comment 2 Mary Komor CLA 2011-05-10 11:14:35 EDT
I have opened BUG 345281 for supporting indentation of wrapped lines. I know this bug is a placeholder for custom formatting support, but this is targeting a major overhaul. I'm hoping to get small (incremental) fixes to support custom formatting and really hoping to get some fixes in v2.0.
Comment 3 Moritz Eysholdt CLA 2016-07-21 05:04:07 EDT
won't fix because it affects the old formatter infrastructure