Community
Participate
Working Groups
Created attachment 204309 [details] After doing "Open Source" by programatically set a local project as source, it wants to retrieve it from a URL. Problem summary : Trying to add a project name programmatically to Remote JavaScript launch it looks like work by looking at the Edit Source Lookup... options, however files cannot be retried from the local project. 1. Add ISourceLocator into the Remote JavaScript launch configuration e.g. myJsLunch.setSourceLocator(launchManager.newSourceLocator("org.eclipse.wst.jsdt.debug.core.sourceLocator")); 2. Then adding the setting the container theSourceDirector.setSourceContainers(theNewContainers); 3. After launching the Remote JavaScript, I can see that I have certainly set the desired project in the "Edit Source Lookup..." Current Result: Trying "Open Source" of a JS file that belongs to the previously project, looks like it wants to be retrieved from the a hots e.g. http://server:port/projectname/folderX/myJSfile.js Expected Result: By setting a project name as part of the Source Lookup, match JS files should be retrieved from local project (for this example) instead of looking in a remote host.
Created attachment 204771 [details] patch Testing the default source lookup from the IDE the scenario works as expected. I did find a case where a script node that had no JS-like extension would fail to be found (which is what this patch fixes). Leopoldo, can you post more of your code on how you are composing your launch, etc ? I am thinking there is a missing initialization step that is not happening.
I applied the patch to HEAD with a minor update.
For this particular scenario, I've changed the following line myLaunch.setSourceLocator((ISourceLocator) launchManager.newSourceLocator("org.eclipse.wst.jsdt.debug.core.sourceLocator")); by this JavaScriptSourceDirector myJSdirector = (JavaScriptSourceDirector) launchManager.newSourceLocator("org.eclipse.wst.jsdt.debug.core.sourceLocator"); myJSdirector.initializeParticipants(); myLaunch.setSourceLocator(myJSdirector); Having this update I'm now able to open/locate resources from a pro grammatically JS launch.
(In reply to comment #3) > Having this update I'm now able to open/locate resources from a pro > grammatically JS launch. Thanks for reporting back Leopoldo, I will mark this bug as a readme in case anyone else encounters a similar issue.