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

Bug 311408

Summary: Function breakpoint toggle depends on cursor position
Product: [WebTools] JSDT Reporter: Michael Rennie <Michael_Rennie>
Component: DebugAssignee: Michael Rennie <Michael_Rennie>
Status: RESOLVED FIXED QA Contact: Simon Kaegi <simon_kaegi>
Severity: normal    
Priority: P3 CC: thatnitind
Version: 3.2Flags: thatnitind: review+
Target Milestone: 3.2 RC1   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
fix none

Description Michael Rennie CLA 2010-05-03 14:31:33 EDT
Created attachment 166829 [details]
fix

code from HEAD

using the following test script:

var func1 = func1 || {};
func1.fib = function f1(n) {};
var func2 = function f2(n) {};
function f3(n){};

trying to toggle function breakpoints with the cursor to the LHS of the assignment operator will fail in the editor, because we are trying to resolve the JS element at the cursor locale, which might not be what we want. The better solution would be to compute the start position while visiting the AST to find the valid locale for the breakpoint.

This would make a good RC1 fix, as it makes toggling a function breakpoint behave as expected.
Comment 1 Michael Rennie CLA 2010-05-04 10:09:30 EDT
applied patch to HEAD