Community
Participate
Working Groups
code from HEAD When a source look up ocurrs that requires us to open (or touch) the Extenral JavaScript Source project, we get the following exception and no source is displayed: java.lang.IllegalArgumentException: Attempted to beginRule: P/External JavaScript Source, does not match outer scope rule: Debug Source Lookup(596) at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63) at org.eclipse.core.internal.jobs.ThreadJob.illegalPush(ThreadJob.java:136) at org.eclipse.core.internal.jobs.ThreadJob.push(ThreadJob.java:335) at org.eclipse.core.internal.jobs.ImplicitJobs.begin(ImplicitJobs.java:85) at org.eclipse.core.internal.jobs.JobManager.beginRule(JobManager.java:286) at org.eclipse.core.internal.resources.WorkManager.checkIn(WorkManager.java:118) at org.eclipse.core.internal.resources.Workspace.prepareOperation(Workspace.java:2248) at org.eclipse.core.internal.resources.Project.open(Project.java:1084) at org.eclipse.core.internal.resources.Project.open(Project.java:1178) at org.eclipse.wst.jsdt.debug.internal.core.JavaScriptDebugPlugin.getExternalSourceProject(JavaScriptDebugPlugin.java:111) at org.eclipse.wst.jsdt.debug.internal.core.launching.JavaScriptSourcePathComputerDelegate.computeSourceContainers(JavaScriptSourcePathComputerDelegate.java:33) at org.eclipse.debug.internal.core.sourcelookup.SourcePathComputer.computeSourceContainers(SourcePathComputer.java:69) at org.eclipse.debug.core.sourcelookup.containers.DefaultSourceContainer.createSourceContainers(DefaultSourceContainer.java:112) at org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer.getSourceContainers(CompositeSourceContainer.java:129) at org.eclipse.debug.core.sourcelookup.containers.CompositeSourceContainer.findSourceElements(CompositeSourceContainer.java:46) at org.eclipse.wst.jsdt.debug.internal.core.launching.JavaScriptSourceLookupParticipant.findSourceElements(JavaScriptSourceLookupParticipant.java:54) at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector$SourceLookupQuery.run(AbstractSourceLookupDirector.java:141) at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42) at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.doSourceLookup(AbstractSourceLookupDirector.java:490) at org.eclipse.debug.core.sourcelookup.AbstractSourceLookupDirector.getSourceElement(AbstractSourceLookupDirector.java:758) at org.eclipse.debug.internal.ui.sourcelookup.SourceLookupFacility.lookup(SourceLookupFacility.java:148) at org.eclipse.debug.ui.DebugUITools.lookupSource(DebugUITools.java:958) at org.eclipse.debug.internal.ui.elements.adapters.StackFrameSourceDisplayAdapter$SourceLookupJob.run(StackFrameSourceDisplayAdapter.java:111) at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54) The part-fix for bug 327497 added the new source look up rule. Perhaps there is more to do here (or there) to avoid this problem.
I guess our solution to serialize the source lookup operations jobs was a little too simplistic. We have to assume that source display could touch (or open as is the case here) any resource in the workspace. I guess that would be the IResourceRuleFactory.buildRule()?
Created attachment 190957 [details] Patch to use the build rule in source lookup. This patch changes the source lookup job to use the buildRule(). It may have the weird side effect that source lookup will be delayed until a running build is completed. The alternative is to forbid modifying resources during source lookup, which is not backward compatible in this case. Or we could back out our partial fix for bug 327497.
Mike reported that use of build rule resulted in deadlocks... not good :-( So I reverted the use of scheduling rule in source lookup job. Mike, please verify.
looks good.