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

Bug 457272

Summary: Navigation hover can show irrelevant paths to open
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: curtis.windatt.public
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Michael Rennie CLA 2015-01-12 11:45:21 EST
Steps:

1. create a file foo.js in a project A
2. create another file foo.js in a project B
3. add another file bar.js in B
4. add the following to bar.js
    var lib = require('./foo');
5. hover over './foo'

In the hover you should see both foo.js files proposed as nav targets, but we should have only shown the one in B due to the './'

We should also update the title of the hover to not include path qualification(s). In the given example the title looks like 'Open file for ./foo', when it should just read 'Open file for foo'
Comment 1 Michael Rennie CLA 2015-02-11 15:29:47 EST
Here are some paths to test with:

    /*globals importScripts */
    /*eslint-env node */
    var s = importScripts('../es6');
    s = importScripts('./es6.js');
    s = importScripts('es6.js');
    s = importScripts('../finding/es6.js');
    
    s = require('../es6');
    s = require('./es6');
    s = require('es6');
    s = require('../finding/es6');
Comment 2 Curtis Windatt CLA 2015-02-11 16:30:39 EST
Error computing hover tooltip              tooltip.js:376
Cancel: Cancel
at Object.internalRegistry.handleServiceError (http://client.orion.eclipse.org:9000/orion/pluginregistry.js:1071:29)

The file client is blowing up whenever I try to search for require/importscript.  It is working fine for define statements.  Unlikely to be related to the patch.

Everything in the patch looks good.
Comment 3 Michael Rennie CLA 2015-02-11 21:15:48 EST
Fixed in:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=885e2183b451eb115fdfe4a408860a539c7b9825

The changes:

1. make relative paths work as expected in importScripts() and require() call expressions (define() does not allow relative paths)
2. update the CSS hover to use the new function resolveRealtiveFiles from script resolver
3. adds relative file support in the HTML hovers