| Summary: | Unable to navigate to function using RequireJS | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | Steve Northover <steve_northover> |
| Component: | JS Tools | Assignee: | Michael Rennie <Michael_Rennie> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | major | ||
| Priority: | P2 | CC: | curtis.windatt.public, Michael_Rennie, Silenio_Quarti, simon_kaegi |
| Version: | unspecified | ||
| Target Milestone: | 10.0 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Steve Northover
Reproduced, it is failing sometime before resolving counter.js. Since it doesn't resolve counter.js it can't find any types defined in it. Can't reproduce after importing the code into an Orion target site for debugging. Both navigation and open declaration work. Is this the old "I need to have opened the file somewhere before it works" thing? Shouldn't the RequireJS statement find the file for me? (In reply to Steve Northover from comment #3) > Is this the old "I need to have opened the file somewhere before it works" > thing? Shouldn't the RequireJS statement find the file for me? The problem is the project name combined with the encoding of the URL. Notice in beta3 the file is encoded like so: https://beta3.hub.jazz.net/code/edit/edit.html#/code/file/mrennie-OrionContent/snorthov%2520%257C%2520minesweeper-require/public/javascript/main.js and that the part of the name ' | ' is doubly encoded. So that when we try to find the file the URLs do not match and Tern records the file as 'not found' (no types). Silenio, do you recall why there would be double encoding happening? If I rename Steves' project in Orion to include ' | ' and encode that I get %20|%20 (which is also wrong) Perhaps there would be value in adding a util function in URL-shim like URL#urlsEqual(string, string), so clients can easily compare URLs regardless of encoding foibles. Simon, thoughts on this? Is there anything I can do to temporarily work around the problem locally to see things working? I thought all the stupid project names had "|" in them. SSQ, we need to release / finish the code that makes project.json optional. I forget where we were on that ... (In reply to Steve Northover from comment #6) > Is there anything I can do to temporarily work around the problem locally to > see things working? I thought all the stupid project names had "|" in them. > > SSQ, we need to release / finish the code that makes project.json optional. > I forget where we were on that ... Rename the project to remove the offending spaces + '|' and you should be good to go I don't remember putting them in there. The project was created by doing a 'Fork' menu operation (not sure that matters). What I'm getting at is, shouldn't everyone be seeing this? I believe that I am just using the default name that was created for me. I distilled it down to a relativey simple fix in the JS bundle (+ tests): http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=4a0705be04e261fa6204709ca4cf4a65e9b05ed1 |