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

Bug 488337

Summary: [html][hover] HTML relative path hovers are not working with encoded URLs
Product: [ECD] Orion Reporter: Michael Rennie <Michael_Rennie>
Component: JS ToolsAssignee: Curtis Windatt <curtis.windatt.public>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3 CC: curtis.windatt.public, steve_northover
Version: unspecified   
Target Milestone: 12.0   
Hardware: All   
OS: All   
See Also: https://bugs.eclipse.org/bugs/show_bug.cgi?id=486516
Whiteboard:
Attachments:
Description Flags
Fix none

Description Michael Rennie CLA 2016-02-23 16:17:41 EST
Consider a URL like the following:

https://beta3.hub.jazz.net/code/edit/edit.html#/code/file/mrennie-OrionContent/mrennie%2520%257C%2520simplenode/public/index.html

relative path hovers in that file do not work, with the following reported to the console:

Failed to load resource: the server responded with a status of 500 (Internal Server Error)
edit.js:26 Error computing hover tooltip
edit.js:26 undefined

We fixed a bug like this for the JS tools a while back. I;m guessing there is something wrong in the HTML content type case.
Comment 1 Curtis Windatt CLA 2016-02-23 16:37:41 EST
Can't determine what regressed this.  The code that appears to be causing the issue has been there for over half a year.  That being said this is only broken when all three of the following are true, so perhaps no one ever had this kind of setup:
1) You are in an HTML file
2) You are hovering over a non-HTML file (JS)
3) Both files must be in a project with encoded characters (space and bar)

When we fall into scriptResolver._samePaths() to compare the file path to the set of returned files from scriptResolver, there is a check to see if the content types match.  However, each potential match is compared against the editor's content type, not the type we are looking for.

If there are no encoded characters, this check is never reached because the file paths will match exactly.
Comment 2 Curtis Windatt CLA 2016-02-23 16:42:11 EST
Created attachment 259892 [details]
Fix
Comment 3 Curtis Windatt CLA 2016-02-23 16:46:31 EST
I've attached a potential fix.  Removes the check in _samePaths.  scriptResolver:216.  All JS and WebTools tests pass.  Mike, please review.
Comment 4 Curtis Windatt CLA 2016-02-29 10:31:58 EST
Looks like there is something else going on here in the WebIDE.  My fix is sufficient to get everything working in Orion, but on WebIDE i see 500 server errors still.
Comment 5 Curtis Windatt CLA 2016-02-29 13:03:19 EST
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=d7eeb99d22c5ad1da12575b8e6fa17e01130a14f
This fixes the issue I outlined, but on webIDE I see a 500 server error for the XHR search request.
Comment 6 Curtis Windatt CLA 2016-02-29 14:47:50 EST
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=7ae335888fb254b02449b86484087ba8dac94f47
This works around the issue seen in WebIDE.  The server side bug is Bug 486516 for this issue.