Community
Participate
Working Groups
This is related to bug #313013. That is a much higher priority bug. Version: Helios Release Build id: 20100617-1415 WTP: Version: 3.2.0.v201005290030-377A78s73533D5L355B The main issue is that JSDT tries to restrict where breakpoints can be set. This currently causes bug #313013, where breakpoints cannot be set at valid lines, but also causes the following issues: 1. Start with the following JavaScript. --------------------- var state = 'hello'; function toggle() { var helloElem = document.getElementById("hello"); var hello_againElem = document.getElementById("hello_again"); if(state == 'hello') { helloElem.style.display = 'none'; hello_againElem.style.display = 'block'; state='hello_again'; } else { helloElem.style.display = 'block'; hello_againElem.style.display = 'none'; state='hello'; } } 2. Set a breakpoint anywhere in function 3. Change toggle to a function literal as shown below: ---------------------- var state = 'hello'; toggle = function() { var helloElem = document.getElementById("hello"); var hello_againElem = document.getElementById("hello_again"); if(state == 'hello') { helloElem.style.display = 'none'; hello_againElem.style.display = 'block'; state='hello_again'; } else { helloElem.style.display = 'block'; hello_againElem.style.display = 'none'; state='hello'; } }; 4. The breakpoint can no longer be removed. This scenario also happens when lines are shifted through editing the file, and the breakpoint ends up on an invalid line. 1. Switch code back to first version of function toggle(). 2. Set a breakpoint in function toggle() at line 8 (the if statement) 3. Go to the start of line 8, and add a newline 4. The breakpoint, now on blank line, cannot be removed.
(In reply to comment #0) > > The main issue is that JSDT tries to restrict where breakpoints can be set. No, you just found a bug in our location verifier... > This scenario also happens when lines are shifted through editing the file, and > the breakpoint ends up on an invalid line. This is another bug: for the fact that we do not a have a marker updater. Changing the bug to reflect the need for a marker updater.
Created attachment 183631 [details] fix The patch provides a marker updater for all markers that subclass the wst.jsdt.debug.marker type. Also has a couple of performance fixes to leverage the shared AST from JSDT core instead of creating a new one to find breakpoint locations.
applied to HEAD