Summary: | PDE text models don't honor line delimiter preferences | ||||||
---|---|---|---|---|---|---|---|
Product: | [Eclipse Project] PDE | Reporter: | Tobias Widmer <tobias_widmer> | ||||
Component: | UI | Assignee: | Dani Megert <daniel_megert> | ||||
Status: | RESOLVED FIXED | QA Contact: | |||||
Severity: | normal | ||||||
Priority: | P3 | CC: | b.muskalla, caniszczyk, contact, curtis.windatt.public, daniel_megert, darin.eclipse, dirk_baeumer, gunnar, markus.kell.r, simon.lieschke, xtnguyen | ||||
Version: | 3.1 | Keywords: | bugday, helpwanted | ||||
Target Milestone: | 3.8 M7 | ||||||
Hardware: | PC | ||||||
OS: | All | ||||||
Whiteboard: | |||||||
Attachments: |
|
Description
Tobias Widmer
2005-06-02 04:50:57 EDT
To fix this bug, we must have something like write(String indent, String lineSeparator, PrintWriter writer) in the org.eclipse.pde.core.IWritable API Without digging into the code, don't we have an IWritableDelimiter kicking around somewhere? Can't we just modify that? I'm afraid that IWritableDelimiter#writeDelimiter isn't to be used to write new lines ; here is the javadoc (whose meaning is confirmed by a quick look at the call hierarchy of the method) /* Write a customized delimeter to the serialized stream that delimits the * text representation of multiple model objects selected. * This is applicable when serializing multiple objects for copy, cut and * paste operations. */ What happens is that every org.eclipse.pde.core.IWritable#write(indent, writer) implementor (e.g. org.eclipse.pde.internal.core.plugin.Plugin) makes call to writer.println(xxxxx) ; instead, it should call something like writer.print(xxxx + lineSeparator). ah, duh, we need something like a IWritableLineDelimiter :P A patch against IWritable or creating a new IWritableLineDelimiter is fine with me. *** Bug 222389 has been marked as a duplicate of this bug. *** *** Bug 176014 has been marked as a duplicate of this bug. *** It's the PrintWriter that's used to create the line separators. We should be able to create a subclass of PrintWriter that does the write thing when "println()" is called. Created attachment 132983 [details]
patch
Here's a quick patch. However, this code path is not used at all when saving. Instaed the editor's document is saved in via the text framework. I'm not even sure this is an issue anymore - the text framework should be doing the right thing.
The print writer is not even used anymore. Closing as INVALID. The steps from comment 0 still reproduce that problem. This bug was only about wrong initial line delimiters in the newly created plugin.xml. Bug 176014 is a problem with mixed line delimiters but without steps to reproduce. In the setup from comment 0, I could not reproduce mixed delimiters, even when I added another extension. Bug 222389 is probably unrelated to this bug. That problem is still reproducible and should be fixed since it introduces mixed line delimiters (in a command that should not touch the file at all). Still an issue and build.properties is also wrong. Thx Dani! |