Temporary Files & Editors [message #545744] |
Thu, 08 July 2010 20:59 |
|
Okay, I've been banging my head against this, in one form or another, off and on for a couple months now, with no help from the forums... so lets step back a bit.
What's the Approved/Official way to create temporary files for use in editors?
EDIT:
Eureka! The answer is right here:
http://www.eclipse.org/forums/index.php?t=msg&goto=52618 2&#msg_526182
Hallvard does things a bit differently than what I ended up with, but the results are the same. A String that can be loaded into an editor, modified, and saved back into memory.
So: Happy ending after all.
--Mark Storer
Senior Software Engineer
Autonomy Cardiff
import legalese.disclaimer;
Disclaimer<Cardiff> disCard = null;
Google Code Search
[Updated on: Thu, 08 July 2010 22:41] Report message to a moderator
|
|
|
Re: Temporary Files & Editors [message #545951 is a reply to message #545744] |
Fri, 09 July 2010 16:55 |
|
My happy ending is wilted and moldy.
It turns out that the Java & JS editors both have issues when the IStorage.getFullPath returns null... but only when "quick diff" is turned on. :/ Turn it off, and getFullPath -> null is fine.
And there's already a bug open on the issue. Sadly, this bug has been open since March of 2009. The good news is that I may have sparked some activity with my comments.
Returning other fudged up paths from getFullPath produces Other Issues:
Path.Empty: NPE while trying to determine the file type
new Path("/blah/blah.TheRightExtension") produces an editor with no line numbers that throws a wrapped IndexOutOfBounds exception during code completion.
The stack traces are attached to my most recent comment on the bug if you're curious.
I believe Hallvard was working with some XML editor that apparently doesn't share this issue. Good for him. Not so good for me.
So until this year-plus-old bug is fixed, my question remains:
How should I create temporary files to be opened in an editor?
Anyone?
FOLLOWUP (July 14, 2010): The bug has a patch awaiting review. Looks like I might get a "happily ever after" after all.
Turns out the Eclipse devs like it when you can reproduce your bug in a simple plugin that they can test with. Go figure.
--Mark Storer
Senior Software Engineer
Autonomy Cardiff
import legalese.disclaimer;
Disclaimer<Cardiff> disCard = null;
Google Code Search
[Updated on: Wed, 14 July 2010 16:40] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02904 seconds