I should add, that there is already support for non-workspace resources.
So far there is IStorage implemented like this:
protected class URLStorage extends PlatformObject implements IStorage {
public InputStream getContents() throws CoreException {
try {
URLConnection conn = _url.openConnection();
conn.connect();
return new BufferedInputStream(conn.getInputStream());
} catch (MalformedURLException mue) {
throw new CoreException(new Status(IStatus.ERROR,
MozideCorePlugin.PLUGIN_ID,
IStatus.ERROR, "Malformed source URL" /*TODO:i18n*/, mue));
} catch (IOException ioe) {
throw new CoreException(new Status(IStatus.ERROR,
MozideCorePlugin.PLUGIN_ID,
IStatus.ERROR, "I/O Exception reading source" /*TODO:i18n*/, ioe));
}
}
so you can access non-workspace resources, but can't put breakpoints
and don't have Content-Type information.
I'm still going to use it, but also support IResource interface which
gives you access to markers (IMarker) and allows for setting
breakpoints.
And this implementation is weak because it opens separate HTTP
connections, so in case of server-generated _javascript_s might fail.
Jacek
Jacek Pospychala wrote:
hi there,
there's an interesting bug in ATF queue:
285596: Adding a breakpoint impossible for files outside of Eclipse
workspace
https://bugs.eclipse.org/bugs/show_bug.cgi?id=285596
Most of time when debugging, we'd like to do some advanced things with
resources not in our workspace, but are identified by some URL.
For example we'd like to put there breakpoints (markers) or examine URL
content-type to open it in correct editor. From Eclipse APIs
perspective this falls under Resources API, so we'd have to make that
URLs look like workspace resources.
So here we come to questions:
1. Where should we take the resource information
a) perform HTTP requests
-> This can be risky because second HTTP request can be confusing to
server and end up failing, ot we might get different data if file is
generated on the fly.
b) query Mozilla cache/internals/API to get the file that is rendered
without any extra HTTP requests
c) any alternative?
2. When do we update resources? Because they're not in workspace, we
don't get any change notifications
a) listen to Mozilla to catch any refresh actions invoked by user and
update resources accordingly
b) everytime when accessing resource
c) any alternative?
3. How do we make non-workspace being look like workspace resources?
a) implement Eclipse File System (EFS)
b) create hidden project and cache resources there
c) any alternative?
So far, I've been experimenting with EFS and it's not very difficult to
implement some simple filesystem there, however it has rather tiny
documentation and here and there I'm finding new extra requirements.
For example, to make EFS actually work you still have to create a
project in workspace with location set to the same scheme as your
virtual FS.
For now, I'm going to work on EFS approach (3a.) and try to get as much
information as possible from Mozilla (1b. and 2a.), however if anyone
has any opinions or sees better approach (e.g. other way to implement
breakpoint, than via IMarker and IResource) - pls speak up.
thanks!
Jacek
_______________________________________________
atf-dev mailing list
atf-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/atf-dev
|