Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 291526 - Custom resource loading in xpand / xtend editors
Summary: Custom resource loading in xpand / xtend editors
Status: CLOSED FIXED
Alias: None
Product: M2T
Classification: Modeling
Component: Xpand (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: M5   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 292771 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-10-06 15:18 EDT by Hendrik David Post CLA
Modified: 2013-02-21 08:11 EST (History)
2 users (show)

See Also:
sven.efftinge: helios+


Attachments
Patch for bug 291526 (5.95 KB, patch)
2010-01-27 10:13 EST, Darius Jockel CLA
sven.efftinge: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hendrik David Post CLA 2009-10-06 15:18:23 EDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.0.11; .NET CLR 2.0.50727; ffco7) Gecko/2009060215 Firefox/3.0.11
Build Identifier: 20090619-0625

Our group wants to modify the resource loading mechanism used to locate xpand and xtend files used by the editors.

Example:

extension fully::qualified::ExtensionFileName;

The corresponding file may (in our use case) be located in other directories than {any classpath entry}/fully/qualified/ .

Reasons why custom resource loading in the editor would be necessary / helpful:

At the moment, it is possible (and common) to modify the resource loading mechanism when invoking workflows programmatically. However, when writing script files for such use cases, it is not possible to use the same resource loading mechanism in the editor.

Thus, the custom resource loading mechanism can only be used for execution, but not for development of the scripts. For us, this means that we have to write the scripts without full editor support (no code completition because the editor throws exceptions on each failed source lookup, no error markers and so on).

The reason why custom resource loading is used in our setting, is that file locations change often and automatic updates of references cannot be achieved easily.

Rough implementation ideas:

- A new extension point for resource loading of files with a certain file extension.
- A refactoring of the "org.eclipse.xtend.shared.ui.resourceContributor" extension point in a way such that custom resource loading is supported.
- Probably, a setter for the org.eclipse.xtend.shared.ui.Activator modelManager attribute.

Possible workarounds:

- Implement modified editors
- Use a managed and modified Java classpath (This "works" in our use case.) 

 

Reproducible: Always
Comment 1 Sven Efftinge CLA 2009-12-10 12:50:56 EST
*** Bug 292771 has been marked as a duplicate of this bug. ***
Comment 2 Darius Jockel CLA 2010-01-27 10:13:41 EST
Created attachment 157404 [details]
Patch for bug 291526

(In reply to comment #0)

> - A new extension point for resource loading of files with a certain file
> extension.

We introduced a new extension point:
org.eclipse.xtend.shared.ui.storageFinder

This extension point hold a (priority-sorted-)list of StorageFinders.
The StorageFinders will be ask one by one to get the resource.
The first successfull will return the result.
Comment 3 Sven Efftinge CLA 2010-01-28 09:40:55 EST
patch applied. Thanks!
Comment 4 Karsten Thoms CLA 2013-02-21 08:11:47 EST
Bug resolved before Xpand 1.2 release date => Closing