Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 449074

Summary: Investigate creating / using a script mapping
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: ClientAssignee: Eric Moffatt <emoffatt>
Status: RESOLVED WONTFIX QA Contact:
Severity: enhancement    
Priority: P3    
Version: 7.0   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 427033, 450152    
Attachments:
Description Flags
WIP
none
copy into FileMap.js none

Description Michael Rennie CLA 2014-10-28 10:58:27 EDT
We should create a script mapping for Orion that can be used in some of the following ways:

1. help to find files related to logical paths (CSS imports, JS define, etc)
2. used as a starting point for customizable script mappings - i.e. allows users to annotate the mapping with their own choices of what paths map to what real world files
Comment 1 Michael Rennie CLA 2014-10-28 11:04:57 EDT
Created attachment 248230 [details]
WIP

This is the first patch Eric sent me, it does not include integration's into any of the tooling yet.

The file map can be used simply by requiring orion/FileMap and making calls like:

var foo = mFileMap.getWSPath("orion/Deferred.js");
	-> "bundles/org.eclipse.orion.client.core/web/orion/Deferred.js"
var bar = mFileMap.getWSPath("edit/content/images/string.png");
	-> "bundles/org.eclipse.orion.client.ui/web/edit/content/images/string.png"
Comment 2 Eric Moffatt CLA 2014-10-31 13:41:10 EDT
Mike, please feel free to add a 'mapFile' API that can be used to add entroes to the existing structure. I didn't do it because I'm too much of a JS noob to know the right pattern for adding 'API'...;-).

Also note that the entries in the map should use forward slashes ('/') and *not* contain either leading or trailing '/'s. This is because it's far easier to add them if needed than it is to remove them and the path's 'formatter' has to use some convention.
Comment 3 Eric Moffatt CLA 2014-11-05 11:10:54 EST
Created attachment 248413 [details]
copy into FileMap.js


Mike here's the updated version...
Comment 4 Michael Rennie CLA 2014-11-06 12:35:22 EST
I pushed the first cut of the mapping + an example JS usage of the map. The JS part is not officially hooked up to run during our hover yet though.
Comment 6 Eric Moffatt CLA 2014-11-20 14:25:12 EST
Mike, the current code shows a hover even when the mouse is over empty space (but on the same line as a 'define'. If possible we should limit the display to when the cursor is inside the quotes.
Comment 7 Michael Rennie CLA 2016-04-12 09:24:39 EDT
Back in Orion 10 we opt'd to stop using a script mapping.

Any of the work committed in this bug has already been removed, so I'll close this as wontfix.