| Summary: | [formatter] formatting is slow for big files | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [Modeling] TMF | Reporter: | Knut Wannheden <knut.wannheden> | ||||||||
| Component: | Xtext | Assignee: | Project Inbox <tmf.xtext-inbox> | ||||||||
| Status: | CLOSED FIXED | QA Contact: | |||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | moritz.eysholdt, sebastian.zarnekow | ||||||||
| Version: | 1.0.1 | Flags: | sebastian.zarnekow:
indigo+
|
||||||||
| Target Milestone: | M3 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Knut Wannheden
Created attachment 181273 [details]
patch for PreferenceStoreIndentationInformation
Created attachment 181274 [details]
updated patch
Surprising how easy it is to introduce a new bug...
Hi Knuth, thanks for the observation and thanks for the patch. However, rather than adding a property listener to the property store, I'd like the idea to have org.eclipse.xtext.formatting.impl.FormattingConfigBasedStream.Line.getIndentation(int) cache the indentation-value. An instance of FormattingConfigBasedStream lasts exactly for one formatting operation (i.e. resource.save() or CTRL+SHIFT+F) and thereby provides the right context for caching. sry, never mind the "h" ;) Created attachment 181367 [details]
updated patch 2
Hi Moritz,
Makes sense. I've attached a revised patch.
Hi Knut, I prefered you former solution as it worked transparently for any possible client of IIndentationInformation. I'm currently discussing this with Moritz. Regards, Sebastian Then how about both? ;-) (In reply to comment #7) > Then how about both? ;-) We came to the conclusion that the PreferenceChangeListener-approach has the advantage that it works transparently for more clients. Please feel free to cache the indentation in the formatter, too, if it improves anything. PreferenceChangeListener patch applied and pushed to master. |