| Summary: | Investigate creating / using a script mapping | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Michael Rennie <Michael_Rennie> | ||||||
| Component: | Client | Assignee: | 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
Michael Rennie
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"
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.
Created attachment 248413 [details]
copy into FileMap.js
Mike here's the updated version...
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. The link would probably help: http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=e1e82ed066d743aed024bedd653a04ff150f0c7b 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. 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. |